globus_xio-3.6/0000775000076400007640000000000012225614636010556 500000000000000globus_xio-3.6/globus_automake_pre0000644000076400007640000000120012225575522014437 00000000000000## Special globus installation directories setupdir = @setupdir@ ## setup = [ DATA,PROGRAMS,SCRIPTS ] testdir = @testdir@ ## test = [ DATA,PROGRAMS,SCRIPTS ] scriptsysconfdir = ${sysconfdir} ## scriptsysconf = [ PROGRAMS,SCRIPTS ] flavorincludedir = @flavorincludedir@ ## flavorinclude = [ HEADERS ] pkgdir = @pkgdir@ ## pkg = [ DATA ] aclocaldir = @aclocaldir@ ## aclocal = [ DATA ] amdirdir = ${datadir}/globus_amdir ## amdir = [ DATA ] perlmoduledir = @perlmoduledir@ ## perlmodule = [ DATA ] doxygendir = @doxygendir@ ## doxygen = [ DATA ] docdir = @docdir@ ## doc = [ DATA ] LINK_BAK = orig AUTOMAKE_OPTIONS=no-dependencies globus_xio-3.6/extensions.h.in0000666000076400007640000000135210363625117013453 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ @BUILTIN_EXTENSIONS_DEC@ static globus_extension_builtin_t local_extensions[] = { @BUILTIN_EXTENSIONS_DEF@ {NULL, NULL} }; globus_xio-3.6/globus_i_xio_win32_socket.c0000666000076400007640000014047011374254655015733 00000000000000/* * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ #include "globus_config.h" #ifdef TARGET_ARCH_WIN32 #include "globus_i_xio_win32.h" typedef struct globus_l_xio_win32_socket_s { win32_mutex_t lock; SOCKET socket; WSAEVENT event; long eventselect; /* ready_events is used only for select() functionality * note, select functionality is flawed due to winsock close notification * bug. It is possible that a read wont be signaled on a short lived * connection. To minimize the chance of being bit by this bug, * initialize ready_events with a read event */ long ready_events; globus_i_xio_win32_event_entry_t event_entry; globus_i_xio_system_op_info_t * read_info; globus_i_xio_system_op_info_t * write_info; } globus_l_xio_win32_socket_t; static void globus_l_xio_win32_socket_kickout( void * user_arg) { globus_i_xio_system_op_info_t * op_info; SOCKET fd; GlobusXIOName(globus_l_xio_win32_socket_kickout); op_info = (globus_i_xio_system_op_info_t *) user_arg; fd = op_info->handle->socket; GlobusXIOSystemDebugEnterFD(fd); if(op_info->op) { globus_xio_operation_disable_cancel(op_info->op); } switch(op_info->type) { case GLOBUS_I_XIO_SYSTEM_OP_CONNECT: case GLOBUS_I_XIO_SYSTEM_OP_ACCEPT: op_info->sop.non_data.callback( op_info->error ? globus_error_put(op_info->error) : GLOBUS_SUCCESS, op_info->user_arg); break; default: op_info->sop.data.callback( op_info->error ? globus_error_put(op_info->error) : GLOBUS_SUCCESS, op_info->nbytes, op_info->user_arg); GlobusIXIOSystemFreeIovec( op_info->sop.data.start_iovc, op_info->sop.data.start_iov); break; } GlobusIXIOSystemFreeOperation(op_info); GlobusXIOSystemDebugExitFD(fd); } static void globus_l_xio_win32_socket_complete( globus_i_xio_system_op_info_t * op_info, globus_bool_t win32_thread) { SOCKET fd; globus_result_t result; GlobusXIOName(globus_l_xio_win32_socket_complete); fd = op_info->handle->socket; GlobusXIOSystemDebugEnterFD(fd); if(!op_info->op) { /* internal usage */ globus_l_xio_win32_socket_kickout(op_info); result = GLOBUS_SUCCESS; } else if(win32_thread) { result = globus_i_xio_win32_complete( globus_l_xio_win32_socket_kickout, op_info); } else { result = globus_callback_register_oneshot( 0, 0, globus_l_xio_win32_socket_kickout, op_info); } /* really cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } GlobusXIOSystemDebugExitFD(fd); } /* must be safe to call from win32 thread */ static void globus_l_xio_win32_socket_handle_read( globus_l_xio_win32_socket_t * handle, globus_i_xio_system_op_info_t * read_info) { globus_size_t nbytes; globus_result_t result; GlobusXIOName(globus_l_xio_win32_socket_handle_read); GlobusXIOSystemDebugEnterFD(handle->socket); result = GLOBUS_SUCCESS; if(read_info->op) { globus_xio_operation_refresh_timeout(read_info->op); } switch(read_info->type) { case GLOBUS_I_XIO_SYSTEM_OP_ACCEPT: { SOCKET new_fd; new_fd = accept(handle->socket, 0, 0); if(new_fd == INVALID_SOCKET) { int error = WSAGetLastError(); if(error != WSAECONNRESET && error != WSAEWOULDBLOCK) { result = GlobusXIOErrorSystemError("accept", error); } } else { unsigned long flag = 0; /* clear inherited attrs */ WSAEventSelect(new_fd, 0, 0); ioctlsocket(new_fd, FIONBIO, &flag); *read_info->sop.non_data.out_fd = new_fd; read_info->nbytes++; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] Accepted new connection, fd=%lu\n", _xio_name, (unsigned long)new_fd)); } } break; case GLOBUS_I_XIO_SYSTEM_OP_READ: /* we loop repeatedly here to read all available data until * the read would return EWOULDBLOCK. at that time, we'll get * another event to land us back here. * (This looping is necessary to work around a winsock bug where we * aren't notified of the peer closing the connection on short lived * connections) */ do { result = globus_i_xio_system_socket_try_read( handle->socket, read_info->sop.data.iov, read_info->sop.data.iovc, read_info->sop.data.flags, read_info->sop.data.addr, &nbytes); if(result == GLOBUS_SUCCESS) { if(nbytes > 0) { read_info->nbytes += nbytes; GlobusIXIOUtilAdjustIovec( read_info->sop.data.iov, read_info->sop.data.iovc, nbytes); } else if(read_info->sop.data.iovc > 0 && read_info->sop.data.iov[0].iov_len > 0) { /* we consumed read event */ handle->ready_events &= ~FD_READ; } } } while(nbytes > 0 && read_info->nbytes < read_info->waitforbytes); break; default: globus_assert(0 && "Unexpected type for read operation"); return; break; } if(result != GLOBUS_SUCCESS) { read_info->error = globus_error_get(result); } /* always true for accept operations */ if(read_info->nbytes >= read_info->waitforbytes || result != GLOBUS_SUCCESS) { read_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; } GlobusXIOSystemDebugExitFD(handle->socket); } /* must be safe to call from win32 thread */ static void globus_l_xio_win32_socket_handle_write( globus_l_xio_win32_socket_t * handle, globus_i_xio_system_op_info_t * write_info) { globus_size_t nbytes; globus_result_t result; GlobusXIOName(globus_l_xio_win32_socket_handle_write); GlobusXIOSystemDebugEnterFD(handle->socket); result = GLOBUS_SUCCESS; if(write_info->op) { globus_xio_operation_refresh_timeout(write_info->op); } switch(write_info->type) { case GLOBUS_I_XIO_SYSTEM_OP_CONNECT: { int err; globus_socklen_t errlen; errlen = sizeof(err); if(getsockopt( handle->socket, SOL_SOCKET, SO_ERROR, (char *)&err, &errlen) == SOCKET_ERROR) { err = WSAGetLastError(); } if(err) { result = GlobusXIOErrorSystemError("connect", err); } } break; case GLOBUS_I_XIO_SYSTEM_OP_WRITE: /* we loop repeatedly here to use up all available space until * the write would return EWOULDBLOCK. at that time, we'll get * another event to land us back here */ do { result = globus_i_xio_system_socket_try_write( handle->socket, write_info->sop.data.iov, write_info->sop.data.iovc, write_info->sop.data.flags, write_info->sop.data.addr, &nbytes); if(result == GLOBUS_SUCCESS) { if(nbytes > 0) { write_info->nbytes += nbytes; GlobusIXIOUtilAdjustIovec( write_info->sop.data.iov, write_info->sop.data.iovc, nbytes); } else if(write_info->sop.data.iovc > 0 && write_info->sop.data.iov[0].iov_len > 0) { /* we consumed write event */ handle->ready_events &= ~FD_WRITE; } } } while(nbytes > 0 && write_info->nbytes < write_info->waitforbytes); break; default: globus_assert(0 && "Unexpected type for write operation"); return; break; } if(result != GLOBUS_SUCCESS) { write_info->error = globus_error_get(result); } /* always true for connect operations */ if(write_info->nbytes >= write_info->waitforbytes || result != GLOBUS_SUCCESS) { write_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; } GlobusXIOSystemDebugExitFD(handle->socket); } static void globus_l_xio_win32_socket_cancel_cb( globus_xio_operation_t op, void * user_arg, globus_xio_error_type_t reason) { globus_i_xio_system_op_info_t * op_info; GlobusXIOName(globus_l_xio_win32_socket_cancel_cb); GlobusXIOSystemDebugEnter(); op_info = (globus_i_xio_system_op_info_t *) user_arg; /* this access of the handle is not safe if users destroy it * with outstanding callbacks. I don't think that is allowed, so we * should be ok. */ win32_mutex_lock(&op_info->handle->lock); { if(op_info->state != GLOBUS_I_XIO_SYSTEM_OP_COMPLETE && op_info->state != GLOBUS_I_XIO_SYSTEM_OP_CANCELED) { op_info->error = reason == GLOBUS_XIO_ERROR_TIMEOUT ? GlobusXIOErrorObjTimeout() : GlobusXIOErrorObjCanceled(); if(op_info->state == GLOBUS_I_XIO_SYSTEM_OP_NEW) { op_info->state = GLOBUS_I_XIO_SYSTEM_OP_CANCELED; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] fd=%lu, Canceling NEW\n", _xio_name, (unsigned long)op_info->handle->socket)); } else { globus_result_t result; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] fd=%lu, Canceling Pending\n", _xio_name, (unsigned long)op_info->handle->socket)); if(op_info->handle->read_info == op_info) { op_info->handle->read_info = 0; } else { globus_assert(op_info->handle->write_info == op_info); op_info->handle->write_info = 0; } /* unregister and kickout now */ result = globus_callback_register_oneshot( 0, 0, globus_l_xio_win32_socket_kickout, op_info); /* really cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } } } } win32_mutex_unlock(&op_info->handle->lock); GlobusXIOSystemDebugExit(); } /* always called from win32 thread */ static globus_bool_t globus_l_xio_win32_socket_event_cb( void * user_arg) { globus_l_xio_win32_socket_t * handle; WSANETWORKEVENTS wsaevents; long events; long clearevents = 0; globus_i_xio_system_op_info_t * read_info = 0; globus_i_xio_system_op_info_t * write_info = 0; GlobusXIOName(globus_l_xio_win32_socket_event_cb); handle = (globus_l_xio_win32_socket_t *) user_arg; GlobusXIOSystemDebugEnterFD(handle->socket); if(WSAEnumNetworkEvents( handle->socket, handle->event, &wsaevents) == SOCKET_ERROR) { GlobusXIOSystemDebugSysError( "WSAEnumNetworkEvents error", WSAGetLastError()); goto error_enum; } events = wsaevents.lNetworkEvents; win32_mutex_lock(&handle->lock); { GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] Ready events: %s%s%s%s%s fd=%lu\n", _xio_name, events & FD_ACCEPT ? "accept;" : "", events & FD_CONNECT ? "connect;" : "", events & FD_READ ? "read;" : "", events & FD_WRITE ? "write;" : "", events & FD_CLOSE ? "close;" : "", (unsigned long)handle->socket)); if(events & (FD_ACCEPT|FD_READ|FD_CLOSE)) { /* cache for select() like functionality */ handle->ready_events |= FD_READ; if(handle->read_info) { globus_l_xio_win32_socket_handle_read( handle, handle->read_info); if(handle->read_info->state == GLOBUS_I_XIO_SYSTEM_OP_COMPLETE) { read_info = handle->read_info; handle->read_info = 0; } } else { clearevents |= FD_ACCEPT|FD_READ; } } if(events & (FD_CONNECT|FD_WRITE|FD_CLOSE)) { /* cache for select() like functionality */ handle->ready_events |= FD_WRITE; if(handle->write_info) { globus_l_xio_win32_socket_handle_write( handle, handle->write_info); if(handle->write_info->state == GLOBUS_I_XIO_SYSTEM_OP_COMPLETE) { write_info = handle->write_info; handle->write_info = 0; } } else { clearevents |= FD_CONNECT|FD_WRITE; } } /* clear any events we want to ignore */ if((handle->eventselect & clearevents)) { handle->eventselect &= ~clearevents; WSAEventSelect(handle->socket, handle->event, handle->eventselect); } } win32_mutex_unlock(&handle->lock); /* do this outside the lock to avoid unnecessary contention */ if(read_info) { globus_l_xio_win32_socket_complete(read_info, GLOBUS_TRUE); } if(write_info) { globus_l_xio_win32_socket_complete(write_info, GLOBUS_TRUE); } GlobusXIOSystemDebugExitFD(handle->socket); return GLOBUS_TRUE; error_enum: GlobusXIOSystemDebugExitWithErrorFD(handle->socket); return GLOBUS_TRUE; } static globus_result_t globus_l_xio_win32_socket_register_read( globus_l_xio_win32_socket_t * handle, globus_i_xio_system_op_info_t * read_info) { globus_result_t result; GlobusXIOName(globus_l_xio_win32_socket_register_read); GlobusXIOSystemDebugEnterFD(handle->socket); /* I have to do this outside the lock because of lock inversion issues */ if(read_info->op && globus_xio_operation_enable_cancel( read_info->op, globus_l_xio_win32_socket_cancel_cb, read_info)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } win32_mutex_lock(&handle->lock); { if(read_info->state == GLOBUS_I_XIO_SYSTEM_OP_CANCELED) { result = globus_error_put(read_info->error); goto error_canceled; } if(handle->read_info) { result = GlobusXIOErrorAlreadyRegistered(); goto error_already_registered; } read_info->state = GLOBUS_I_XIO_SYSTEM_OP_PENDING; /* if select() functionality requested, only handle after we recieve * read event */ if(read_info->waitforbytes > 0 || handle->ready_events & FD_READ) { globus_l_xio_win32_socket_handle_read(handle, read_info); } if(read_info->state != GLOBUS_I_XIO_SYSTEM_OP_COMPLETE) { /* make sure we're set up to be notified of events */ long needevents; if(read_info->type == GLOBUS_I_XIO_SYSTEM_OP_ACCEPT) { needevents = FD_ACCEPT; } else { needevents = FD_READ|FD_CLOSE; } if((handle->eventselect & needevents) != needevents) { if(WSAEventSelect( handle->socket, handle->event, handle->eventselect|needevents) == SOCKET_ERROR) { read_info->error = GlobusXIOErrorObjSystemError( "WSAEventSelect", WSAGetLastError()); } else { handle->eventselect |= needevents; } } if(!read_info->error) { handle->read_info = read_info; read_info = 0; } } } win32_mutex_unlock(&handle->lock); /* do this outside the lock to avoid unnecessary contention */ if(read_info) { globus_l_xio_win32_socket_complete(read_info, GLOBUS_FALSE); } GlobusXIOSystemDebugExitFD(handle->socket); return GLOBUS_SUCCESS; error_already_registered: error_canceled: read_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; win32_mutex_unlock(&handle->lock); if(read_info->op) { globus_xio_operation_disable_cancel(read_info->op); } error_cancel_enable: GlobusXIOSystemDebugExitWithErrorFD(handle->socket); return result; } static globus_result_t globus_l_xio_win32_socket_register_write( globus_l_xio_win32_socket_t * handle, globus_i_xio_system_op_info_t * write_info) { globus_result_t result; GlobusXIOName(globus_l_xio_win32_socket_register_write); GlobusXIOSystemDebugEnterFD(handle->socket); /* I have to do this outside the lock because of lock inversion issues */ if(write_info->op && globus_xio_operation_enable_cancel( write_info->op, globus_l_xio_win32_socket_cancel_cb, write_info)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } win32_mutex_lock(&handle->lock); { if(write_info->state == GLOBUS_I_XIO_SYSTEM_OP_CANCELED) { result = globus_error_put(write_info->error); goto error_canceled; } if(handle->write_info) { result = GlobusXIOErrorAlreadyRegistered(); goto error_already_registered; } write_info->state = GLOBUS_I_XIO_SYSTEM_OP_PENDING; /* if select() functionality requested, only handle after we recieve * write event * * also dont call for connect operations. waitforbytes == 0 in this * case and handle->ready_events should not yet have a write event */ if(write_info->waitforbytes > 0 || handle->ready_events & FD_WRITE) { globus_l_xio_win32_socket_handle_write(handle, write_info); } if(write_info->state != GLOBUS_I_XIO_SYSTEM_OP_COMPLETE) { /* make sure we're set up to be notified of events */ long needevents; if(write_info->type == GLOBUS_I_XIO_SYSTEM_OP_CONNECT) { needevents = FD_CONNECT|FD_CLOSE; } else { needevents = FD_WRITE|FD_CLOSE; } if((handle->eventselect & needevents) != needevents) { if(WSAEventSelect( handle->socket, handle->event, handle->eventselect|needevents) == SOCKET_ERROR) { write_info->error = GlobusXIOErrorObjSystemError( "WSAEventSelect", WSAGetLastError()); } else { handle->eventselect |= needevents; } } if(!write_info->error) { handle->write_info = write_info; write_info = 0; } } } win32_mutex_unlock(&handle->lock); /* do this outside the lock to avoid unnecessary contention */ if(write_info) { globus_l_xio_win32_socket_complete(write_info, GLOBUS_FALSE); } GlobusXIOSystemDebugExitFD(handle->socket); return GLOBUS_SUCCESS; error_already_registered: error_canceled: write_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; win32_mutex_unlock(&handle->lock); if(write_info->op) { globus_xio_operation_disable_cancel(write_info->op); } error_cancel_enable: GlobusXIOSystemDebugExitWithErrorFD(handle->socket); return result; } globus_result_t globus_xio_system_socket_init( globus_xio_system_socket_handle_t * uhandle, globus_xio_system_socket_t socket, globus_xio_system_type_t type) { globus_result_t result; globus_l_xio_win32_socket_t * handle; unsigned long flag; GlobusXIOName(globus_xio_system_socket_init); GlobusXIOSystemDebugEnterFD(socket); handle = (globus_l_xio_win32_socket_t *) globus_calloc(1, sizeof(globus_l_xio_win32_socket_t)); if(!handle) { result = GlobusXIOErrorMemory("handle"); goto error_alloc; } handle->socket = socket; win32_mutex_init(&handle->lock, 0); handle->ready_events = FD_READ; /* to avoid winsock fd_close bug */ handle->event = WSACreateEvent(); if(handle->event == 0) { result = GlobusXIOErrorSystemError( "WSACreateEvent", WSAGetLastError()); goto error_create; } flag = 1; if(ioctlsocket(socket, FIONBIO, &flag) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError( "ioctlsocket", WSAGetLastError()); goto error_ioctl; } result = globus_i_xio_win32_event_register( &handle->event_entry, handle->event, globus_l_xio_win32_socket_event_cb, handle); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_i_xio_win32_event_register", result); goto error_register; } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] Registered event handle=%lu\n", _xio_name, (unsigned long) handle->event)); *uhandle = handle; GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_register: flag = 0; ioctlsocket(socket, FIONBIO, &flag); error_ioctl: WSACloseEvent(handle->event); error_create: win32_mutex_destroy(&handle->lock); globus_free(handle); error_alloc: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } void globus_xio_system_socket_destroy( globus_xio_system_socket_handle_t handle) { unsigned long flag = 0; GlobusXIOName(globus_xio_system_socket_destroy); GlobusXIOSystemDebugEnterFD(handle->socket); globus_assert(!handle->read_info && !handle->write_info); /* no need to ensure entry is still registered, as I always return true * in the callback and this is only place i unregister */ globus_i_xio_win32_event_lock(handle->event_entry); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] Unregistering event handle=%lu\n", _xio_name, (unsigned long) handle->event)); globus_i_xio_win32_event_unregister(handle->event_entry); globus_i_xio_win32_event_unlock(handle->event_entry); WSAEventSelect(handle->socket, 0, 0); ioctlsocket(handle->socket, FIONBIO, &flag); WSACloseEvent(handle->event); win32_mutex_destroy(&handle->lock); GlobusXIOSystemDebugExitFD(handle->socket); globus_free(handle); } globus_result_t globus_xio_system_socket_register_connect( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, globus_sockaddr_t * addr, globus_xio_system_callback_t callback, void * user_arg) { globus_result_t result; int error; globus_i_xio_system_op_info_t * op_info; GlobusXIOName(globus_xio_system_socket_register_connect); GlobusXIOSystemDebugEnterFD(handle->socket); if(connect( handle->socket, (const struct sockaddr *) addr, GlobusLibcSockaddrLen(addr)) == SOCKET_ERROR && (error = WSAGetLastError()) != WSAEWOULDBLOCK) { result = GlobusXIOErrorSystemError("connect", error); goto error_connect; } GlobusIXIOSystemAllocOperation(op_info); if(!op_info) { result = GlobusXIOErrorMemory("op_info"); goto error_op_info; } op_info->type = GLOBUS_I_XIO_SYSTEM_OP_CONNECT; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW; op_info->op = op; op_info->handle = handle; op_info->user_arg = user_arg; op_info->sop.non_data.callback = callback; result = globus_l_xio_win32_socket_register_write(handle, op_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_win32_socket_register_write", result); goto error_register; } GlobusXIOSystemDebugExitFD(handle->socket); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeOperation(op_info); error_op_info: error_connect: GlobusXIOSystemDebugExitWithErrorFD(handle->socket); return result; } globus_result_t globus_xio_system_socket_register_accept( globus_xio_operation_t op, globus_xio_system_socket_handle_t listener_handle, globus_xio_system_socket_t * out_handle, globus_xio_system_callback_t callback, void * user_arg) { globus_result_t result; globus_i_xio_system_op_info_t * op_info; GlobusXIOName(globus_xio_system_socket_register_accept); GlobusXIOSystemDebugEnterFD(listener_handle->socket); GlobusIXIOSystemAllocOperation(op_info); if(!op_info) { result = GlobusXIOErrorMemory("op_info"); goto error_op_info; } op_info->type = GLOBUS_I_XIO_SYSTEM_OP_ACCEPT; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW; op_info->op = op; op_info->handle = listener_handle; op_info->user_arg = user_arg; op_info->sop.non_data.callback = callback; op_info->sop.non_data.out_fd = out_handle; op_info->waitforbytes = 1; result = globus_l_xio_win32_socket_register_read(listener_handle, op_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_win32_socket_register_read", result); goto error_register; } GlobusXIOSystemDebugExitFD(listener_handle->socket); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeOperation(op_info); error_op_info: GlobusXIOSystemDebugExitWithErrorFD(listener_handle->socket); return result; } /* calling this with null op could cause deadlock... * reserved for internal use */ /* if waitforbytes == 0 and iov[0].iov_len == 0 * behave like select()... ie notify when data ready */ globus_result_t globus_l_xio_system_socket_register_read( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, globus_size_t nbytes, int flags, globus_sockaddr_t * out_from, globus_xio_system_data_callback_t callback, void * user_arg) { globus_result_t result; globus_i_xio_system_op_info_t * op_info; struct iovec * iov; int iovc; GlobusXIOName(globus_l_xio_system_socket_register_read); GlobusXIOSystemDebugEnterFD(handle->socket); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Waiting for %ld bytes\n", _xio_name, (long) waitforbytes)); GlobusIXIOSystemAllocOperation(op_info); if(!op_info) { result = GlobusXIOErrorMemory("op_info"); goto error_op_info; } GlobusIXIOSystemAllocIovec(u_iovc, iov); if(!iov) { result = GlobusXIOErrorMemory("iov"); goto error_iovec; } GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc); iovc = u_iovc; op_info->type = GLOBUS_I_XIO_SYSTEM_OP_READ; op_info->sop.data.start_iov = iov; op_info->sop.data.start_iovc = iovc; GlobusIXIOUtilAdjustIovec(iov, iovc, nbytes); op_info->sop.data.iov = iov; op_info->sop.data.iovc = iovc; op_info->sop.data.addr = out_from; op_info->sop.data.flags = flags; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW; op_info->op = op; op_info->handle = handle; op_info->user_arg = user_arg; op_info->sop.data.callback = callback; op_info->waitforbytes = waitforbytes; op_info->nbytes = nbytes; result = globus_l_xio_win32_socket_register_read(handle, op_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_win32_socket_register_read", result); goto error_register; } GlobusXIOSystemDebugExitFD(handle->socket); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeIovec(u_iovc, op_info->sop.data.start_iov); error_iovec: GlobusIXIOSystemFreeOperation(op_info); error_op_info: GlobusXIOSystemDebugExitWithErrorFD(handle->socket); return result; } globus_result_t globus_xio_system_socket_register_read( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * out_from, globus_xio_system_data_callback_t callback, void * user_arg) { return globus_l_xio_system_socket_register_read( op, handle, u_iov, u_iovc, waitforbytes, 0, flags, out_from, callback, user_arg); } /* calling this with null op could cause deadlock... * reserved for internal use */ /* if waitforbytes == 0 and iov[0].iov_len == 0 * behave like select()... ie notify when data ready */ globus_result_t globus_l_xio_system_socket_register_write( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, globus_size_t nbytes, int flags, globus_sockaddr_t * to, globus_xio_system_data_callback_t callback, void * user_arg) { globus_result_t result; globus_i_xio_system_op_info_t * op_info; struct iovec * iov; int iovc; GlobusXIOName(globus_l_xio_system_socket_register_write); GlobusXIOSystemDebugEnterFD(handle->socket); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Waiting for %ld bytes\n", _xio_name, (long) waitforbytes)); GlobusIXIOSystemAllocOperation(op_info); if(!op_info) { result = GlobusXIOErrorMemory("op_info"); goto error_op_info; } GlobusIXIOSystemAllocIovec(u_iovc, iov); if(!iov) { result = GlobusXIOErrorMemory("iov"); goto error_iovec; } GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc); iovc = u_iovc; op_info->type = GLOBUS_I_XIO_SYSTEM_OP_WRITE; op_info->sop.data.start_iov = iov; op_info->sop.data.start_iovc = iovc; GlobusIXIOUtilAdjustIovec(iov, iovc, nbytes); op_info->sop.data.iov = iov; op_info->sop.data.iovc = iovc; op_info->sop.data.addr = to; op_info->sop.data.flags = flags; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW; op_info->op = op; op_info->handle = handle; op_info->user_arg = user_arg; op_info->sop.data.callback = callback; op_info->waitforbytes = waitforbytes; op_info->nbytes = nbytes; result = globus_l_xio_win32_socket_register_write(handle, op_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_win32_socket_register_write", result); goto error_register; } GlobusXIOSystemDebugExitFD(handle->socket); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeIovec(u_iovc, op_info->sop.data.start_iov); error_iovec: GlobusIXIOSystemFreeOperation(op_info); error_op_info: GlobusXIOSystemDebugExitWithErrorFD(handle->socket); return result; } globus_result_t globus_xio_system_socket_register_write( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * to, globus_xio_system_data_callback_t callback, void * user_arg) { return globus_l_xio_system_socket_register_write( op, handle, u_iov, u_iovc, waitforbytes, 0, flags, to, callback, user_arg); } typedef struct { HANDLE event; globus_size_t nbytes; globus_object_t * error; } globus_l_xio_win32_blocking_info_t; static globus_result_t globus_l_xio_win32_blocking_init( globus_l_xio_win32_blocking_info_t ** u_blocking_info) { globus_l_xio_win32_blocking_info_t * blocking_info; globus_result_t result; GlobusXIOName(globus_l_xio_win32_blocking_init); GlobusXIOSystemDebugEnter(); blocking_info = (globus_l_xio_win32_blocking_info_t *) globus_calloc(1, sizeof(globus_l_xio_win32_blocking_info_t)); if(!blocking_info) { result = GlobusXIOErrorMemory("blocking_info"); goto error_info; } blocking_info->event = CreateEvent(0, FALSE, FALSE, 0); if(blocking_info->event == 0) { result = GlobusXIOErrorSystemError( "CreateEvent", GetLastError()); goto error_create; } *u_blocking_info = blocking_info; GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_create: globus_free(blocking_info); error_info: *u_blocking_info = 0; GlobusXIOSystemDebugExitWithError(); return result; } static void globus_l_xio_win32_blocking_destroy( globus_l_xio_win32_blocking_info_t * blocking_info) { GlobusXIOName(globus_l_xio_win32_blocking_destroy); GlobusXIOSystemDebugEnter(); WSACloseEvent(blocking_info->event); globus_free(blocking_info); GlobusXIOSystemDebugExit(); } static void globus_l_xio_win32_blocking_cb( globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_l_xio_win32_blocking_info_t * blocking_info; GlobusXIOName(globus_l_xio_win32_blocking_cb); GlobusXIOSystemDebugEnter(); blocking_info = (globus_l_xio_win32_blocking_info_t *) user_arg; if(result != GLOBUS_SUCCESS) { blocking_info->error = globus_error_get(result); } blocking_info->nbytes = nbytes; SetEvent(blocking_info->event); GlobusXIOSystemDebugExit(); } globus_result_t globus_xio_system_socket_read( globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * from, globus_size_t * nbytes) { globus_result_t result; globus_l_xio_win32_blocking_info_t * blocking_info; GlobusXIOName(globus_xio_system_socket_read); GlobusXIOSystemDebugEnterFD(handle->socket); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Waiting for %ld bytes\n", _xio_name, (long) waitforbytes)); win32_mutex_lock(&handle->lock); { result = globus_i_xio_system_socket_try_read( handle->socket, iov, iovc, flags, from, nbytes); } win32_mutex_unlock(&handle->lock); if(result == GLOBUS_SUCCESS && *nbytes < waitforbytes) { result = globus_l_xio_win32_blocking_init(&blocking_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_win32_blocking_init", result); goto error_init; } result = globus_l_xio_system_socket_register_read( 0, handle, iov, iovc, waitforbytes, *nbytes, flags, from, globus_l_xio_win32_blocking_cb, blocking_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_system_socket_register_read", result); goto error_register; } while(WaitForSingleObject( blocking_info->event, INFINITE) != WAIT_OBJECT_0) {} if(blocking_info->error) { result = globus_error_put(blocking_info->error); } *nbytes = blocking_info->nbytes; globus_l_xio_win32_blocking_destroy(blocking_info); } GlobusXIOSystemDebugExitFD(handle->socket); return result; error_register: globus_l_xio_win32_blocking_destroy(blocking_info); error_init: GlobusXIOSystemDebugExitWithErrorFD(handle->socket); return result; } globus_result_t globus_xio_system_socket_write( globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * to, globus_size_t * nbytes) { globus_result_t result; globus_l_xio_win32_blocking_info_t * blocking_info; GlobusXIOName(globus_xio_system_socket_write); GlobusXIOSystemDebugEnterFD(handle->socket); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Waiting for %ld bytes\n", _xio_name, (long) waitforbytes)); win32_mutex_lock(&handle->lock); { result = globus_i_xio_system_socket_try_write( handle->socket, iov, iovc, flags, to, nbytes); } win32_mutex_unlock(&handle->lock); if(result == GLOBUS_SUCCESS && *nbytes < waitforbytes) { result = globus_l_xio_win32_blocking_init(&blocking_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_win32_blocking_init", result); goto error_init; } result = globus_l_xio_system_socket_register_write( 0, handle, iov, iovc, waitforbytes, *nbytes, flags, to, globus_l_xio_win32_blocking_cb, blocking_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_system_socket_register_write", result); goto error_register; } while(WaitForSingleObject( blocking_info->event, INFINITE) != WAIT_OBJECT_0) {} if(blocking_info->error) { result = globus_error_put(blocking_info->error); } *nbytes = blocking_info->nbytes; globus_l_xio_win32_blocking_destroy(blocking_info); } GlobusXIOSystemDebugExitFD(handle->socket); return result; error_register: globus_l_xio_win32_blocking_destroy(blocking_info); error_init: GlobusXIOSystemDebugExitWithErrorFD(handle->socket); return result; } globus_result_t globus_xio_system_socket_create( globus_xio_system_socket_t * sock, int domain, int type, int protocol) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_create); *sock = INVALID_SOCKET; GlobusXIOSystemDebugEnter(); *sock = socket(domain, type, protocol); if(*sock == INVALID_SOCKET) { result = GlobusXIOErrorSystemError("socket", WSAGetLastError()); goto error_socket; } /* all handles created by me are closed on exec */ SetHandleInformation((HANDLE)*sock, HANDLE_FLAG_INHERIT, 0); GlobusXIOSystemDebugExitFD(*sock); return GLOBUS_SUCCESS; error_socket: GlobusXIOSystemDebugExitWithErrorFD(*sock); return result; } globus_result_t globus_xio_system_socket_setsockopt( globus_xio_system_socket_t socket, int level, int optname, const void * optval, socklen_t optlen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_setsockopt); GlobusXIOSystemDebugEnterFD(socket); if(setsockopt(socket, level, optname, optval, optlen) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError("setsockopt", WSAGetLastError()); goto error_setsockopt; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_setsockopt: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_getsockopt( globus_xio_system_socket_t socket, int level, int optname, void * optval, socklen_t * optlen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_getsockopt); GlobusXIOSystemDebugEnterFD(socket); if(getsockopt(socket, level, optname, optval, optlen) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError("getsockopt", WSAGetLastError()); goto error_getsockopt; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_getsockopt: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_getsockname( globus_xio_system_socket_t socket, struct sockaddr * name, socklen_t * namelen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_getsockname); GlobusXIOSystemDebugEnterFD(socket); if(getsockname(socket, name, namelen) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError("getsockname", WSAGetLastError()); goto error_getsockname; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_getsockname: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_getpeername( globus_xio_system_socket_t socket, struct sockaddr * name, socklen_t * namelen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_getpeername); GlobusXIOSystemDebugEnterFD(socket); if(getpeername(socket, name, namelen) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError("getpeername", WSAGetLastError()); goto error_getpeername; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_getpeername: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_bind( globus_xio_system_socket_t socket, struct sockaddr * addr, socklen_t addrlen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_bind); GlobusXIOSystemDebugEnterFD(socket); if(bind(socket, addr, addrlen) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError("bind", WSAGetLastError()); goto error_bind; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_bind: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_listen( globus_xio_system_socket_t socket, int backlog) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_listen); GlobusXIOSystemDebugEnterFD(socket); if(listen(socket, backlog) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError("listen", WSAGetLastError()); goto error_listen; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_listen: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_connect( globus_xio_system_socket_t socket, const struct sockaddr * addr, socklen_t addrlen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_connect); GlobusXIOSystemDebugEnterFD(socket); if(connect(socket, addr, addrlen) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError("connect", WSAGetLastError()); goto error_connect; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_connect: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_close( globus_xio_system_socket_t socket) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_close); GlobusXIOSystemDebugEnterFD(socket); if(closesocket(socket) == SOCKET_ERROR) { result = GlobusXIOErrorSystemError("closesocket", WSAGetLastError()); goto error_close; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_close: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } #endif /*TARGET_ARCH_WIN32 */ globus_xio-3.6/globus_xio_wrapblock.c0000666000076400007640000003276012152342051015056 00000000000000/* * Portions of this file Copyright 1999-2005 University of Chicago * Portions of this file Copyright 1999-2005 The University of Southern California. * * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ #include "globus_i_xio.h" #include "globus_xio_driver.h" #include "globus_xio.h" #include "globus_xio_load.h" #include "globus_common.h" #include "globus_xio_wrapblock.h" #include "version.h" typedef struct xio_l_wrapblock_handle_s { void * driver_handle; struct xio_l_wrapblock_driver_s * wrapblock_driver; } xio_l_wrapblock_handle_t; typedef struct xio_l_wrapblock_wrapper_s { globus_xio_contact_t ci; globus_i_xio_driver_t * driver; struct xio_l_wrapblock_driver_s * wrapblock_driver; xio_l_wrapblock_handle_t * wrapblock_handle; void * attr; void * link; globus_xio_iovec_t * iovec; int iovec_count; globus_xio_operation_t op; } xio_l_wrapblock_wrapper_t; typedef struct xio_l_wrapblock_driver_s { globus_xio_wrapblock_open_func_t open_func; globus_xio_wrapblock_close_func_t close_func; globus_xio_wrapblock_read_func_t read_func; globus_xio_wrapblock_write_func_t write_func; globus_xio_wrapblock_accept_func_t accept_func; } xio_l_wrapblock_driver_t; static void xio_l_wrapblock_wrapper_destroy( xio_l_wrapblock_wrapper_t * wrapper) { globus_xio_contact_destroy(&wrapper->ci); if(wrapper->iovec != NULL) { globus_free(wrapper->iovec); } if(wrapper->attr && wrapper->driver && wrapper->driver->attr_destroy_func) { wrapper->driver->attr_destroy_func(wrapper->attr); } globus_free(wrapper); } /************************************************************************ * iface functions * --------------- * ***********************************************************************/ static void globus_l_xio_wrapblock_accept_kickout( void * user_arg) { void * link; globus_result_t res; xio_l_wrapblock_wrapper_t * wrapper; globus_thread_blocking_will_block(); wrapper = (xio_l_wrapblock_wrapper_t *) user_arg; res = wrapper->wrapblock_driver->accept_func( wrapper->attr, &link); globus_xio_driver_finished_accept( wrapper->op, link, res); xio_l_wrapblock_wrapper_destroy(wrapper); } static globus_result_t globus_l_xio_wrapblock_server_accept( void * driver_server, globus_xio_operation_t op) { xio_l_wrapblock_wrapper_t * wrapper; globus_xio_driver_t driver; globus_i_xio_op_t * xio_op; xio_op = (globus_i_xio_op_t *) op; driver = xio_op->_op_server->entry[op->ndx - 1].driver; wrapper = (xio_l_wrapblock_wrapper_t *) globus_calloc(1, sizeof(xio_l_wrapblock_wrapper_t)); wrapper->wrapblock_driver = driver->wrap_data; wrapper->attr = driver_server; wrapper->op = op; globus_callback_register_oneshot( NULL, NULL, globus_l_xio_wrapblock_accept_kickout, wrapper); return GLOBUS_SUCCESS; } static void globus_l_xio_wrapblock_open_kickout( void * user_arg) { globus_result_t res; xio_l_wrapblock_wrapper_t * wrapper; globus_thread_blocking_will_block(); wrapper = (xio_l_wrapblock_wrapper_t *) user_arg; res = wrapper->wrapblock_handle->wrapblock_driver->open_func( &wrapper->ci, wrapper->link, wrapper->attr, &wrapper->wrapblock_handle->driver_handle); globus_xio_driver_finished_open( wrapper->wrapblock_handle, wrapper->op, res); xio_l_wrapblock_wrapper_destroy(wrapper); } static globus_result_t globus_l_xio_wrapblock_open( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op) { globus_result_t result; xio_l_wrapblock_wrapper_t * wrapper; xio_l_wrapblock_handle_t * wrapblock_handle; globus_xio_driver_t driver; globus_i_xio_op_t * xio_op; xio_op = (globus_i_xio_op_t *) op; driver = xio_op->_op_context->entry[op->ndx - 1].driver; wrapblock_handle = globus_calloc(1, sizeof(xio_l_wrapblock_handle_t)); wrapblock_handle->wrapblock_driver = driver->wrap_data; if(globus_xio_driver_operation_is_blocking(op)) { result = wrapblock_handle->wrapblock_driver->open_func( contact_info, driver_link, driver_attr, &wrapblock_handle->driver_handle); globus_xio_driver_finished_open(wrapblock_handle, op, result); } else { wrapper = (xio_l_wrapblock_wrapper_t *) globus_calloc(1, sizeof(xio_l_wrapblock_wrapper_t)); wrapper->wrapblock_handle = wrapblock_handle; wrapper->link = driver_link; wrapper->op = op; wrapper->driver = driver; if(driver_attr != NULL && driver->attr_copy_func != NULL) { driver->attr_copy_func(&wrapper->attr, driver_attr); } /* gotta copy contact info the hard way */ globus_xio_contact_copy(&wrapper->ci, contact_info); globus_callback_register_oneshot( NULL, NULL, globus_l_xio_wrapblock_open_kickout, wrapper); } return GLOBUS_SUCCESS; } static void globus_l_xio_wrapblock_write_kickout( void * user_arg) { globus_size_t nbytes; globus_result_t result; xio_l_wrapblock_wrapper_t * wrapper; globus_thread_blocking_will_block(); wrapper = (xio_l_wrapblock_wrapper_t *) user_arg; result = wrapper->wrapblock_handle->wrapblock_driver->write_func( wrapper->wrapblock_handle->driver_handle, wrapper->iovec, wrapper->iovec_count, &nbytes); globus_xio_driver_finished_write(wrapper->op, result, nbytes); xio_l_wrapblock_wrapper_destroy(wrapper); } static globus_result_t globus_l_xio_wrapblock_write( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_size_t nbytes; globus_result_t result; int i; xio_l_wrapblock_wrapper_t * wrapper; xio_l_wrapblock_handle_t * wrapblock_handle; wrapblock_handle = (xio_l_wrapblock_handle_t *) driver_specific_handle; if(globus_xio_driver_operation_is_blocking(op)) { result = wrapblock_handle->wrapblock_driver->write_func( wrapblock_handle->driver_handle, iovec, iovec_count, &nbytes); globus_xio_driver_finished_write(op, result, nbytes); } else { wrapper = (xio_l_wrapblock_wrapper_t *) globus_calloc(1, sizeof(xio_l_wrapblock_wrapper_t)); wrapper->iovec = (globus_xio_iovec_t *) globus_calloc(iovec_count, sizeof(globus_xio_iovec_t)); wrapper->iovec_count = iovec_count; wrapper->op = op; wrapper->wrapblock_handle = driver_specific_handle; for(i = 0; i < iovec_count; i++) { wrapper->iovec[i].iov_base = iovec[i].iov_base; wrapper->iovec[i].iov_len = iovec[i].iov_len; } globus_callback_register_oneshot( NULL, NULL, globus_l_xio_wrapblock_write_kickout, wrapper); } return GLOBUS_SUCCESS; } static void globus_l_xio_wrapblock_read_kickout( void * user_arg) { globus_size_t nbytes; globus_result_t result; xio_l_wrapblock_wrapper_t * wrapper; globus_thread_blocking_will_block(); wrapper = (xio_l_wrapblock_wrapper_t *) user_arg; result = wrapper->wrapblock_handle->wrapblock_driver->read_func( wrapper->wrapblock_handle->driver_handle, wrapper->iovec, wrapper->iovec_count, &nbytes); globus_xio_driver_finished_read(wrapper->op, result, nbytes); xio_l_wrapblock_wrapper_destroy(wrapper); } static globus_result_t globus_l_xio_wrapblock_read( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_size_t nbytes; globus_result_t result; int i; xio_l_wrapblock_wrapper_t * wrapper; xio_l_wrapblock_handle_t * wrapblock_handle; wrapblock_handle = (xio_l_wrapblock_handle_t *) driver_specific_handle; if(globus_xio_driver_operation_is_blocking(op)) { result = wrapblock_handle->wrapblock_driver->read_func( wrapblock_handle->driver_handle, iovec, iovec_count, &nbytes); globus_xio_driver_finished_read(op, result, nbytes); } else { wrapper = (xio_l_wrapblock_wrapper_t *) globus_calloc(1, sizeof(xio_l_wrapblock_wrapper_t)); wrapper->iovec = (globus_xio_iovec_t *) globus_calloc(iovec_count, sizeof(globus_xio_iovec_t)); wrapper->iovec_count = iovec_count; wrapper->op = op; wrapper->wrapblock_handle = driver_specific_handle; for(i = 0; i < iovec_count; i++) { wrapper->iovec[i].iov_base = iovec[i].iov_base; wrapper->iovec[i].iov_len = iovec[i].iov_len; } globus_callback_register_oneshot( NULL, NULL, globus_l_xio_wrapblock_read_kickout, wrapper); } return GLOBUS_SUCCESS; } static void globus_l_xio_wrapblock_close_kickout( void * user_arg) { xio_l_wrapblock_handle_t * wrapblock_handle; globus_result_t result; xio_l_wrapblock_wrapper_t * wrapper; globus_thread_blocking_will_block(); wrapper = (xio_l_wrapblock_wrapper_t *) user_arg; wrapblock_handle = wrapper->wrapblock_handle; result = wrapper->wrapblock_handle->wrapblock_driver->close_func( wrapblock_handle->driver_handle, wrapper->attr); globus_xio_driver_finished_close(wrapper->op, result); xio_l_wrapblock_wrapper_destroy(wrapper); globus_free(wrapblock_handle); } static globus_result_t globus_l_xio_wrapblock_close( void * driver_specific_handle, void * attr, globus_xio_operation_t op) { globus_result_t result; xio_l_wrapblock_wrapper_t * wrapper; xio_l_wrapblock_handle_t * wrapblock_handle; wrapblock_handle = (xio_l_wrapblock_handle_t *) driver_specific_handle; if(globus_xio_driver_operation_is_blocking(op)) { result = wrapblock_handle->wrapblock_driver->close_func( wrapblock_handle->driver_handle, attr); globus_xio_driver_finished_close(op, result); globus_free(wrapblock_handle); } else { wrapper = (xio_l_wrapblock_wrapper_t *) globus_calloc(1, sizeof(xio_l_wrapblock_wrapper_t)); wrapper->attr = attr; wrapper->op = op; wrapper->wrapblock_handle = driver_specific_handle; globus_callback_register_oneshot( NULL, NULL, globus_l_xio_wrapblock_close_kickout, wrapper); } return GLOBUS_SUCCESS; } globus_result_t globus_xio_wrapblock_init( globus_xio_driver_t driver, globus_xio_wrapblock_open_func_t open_func, globus_xio_wrapblock_close_func_t close_func, globus_xio_wrapblock_read_func_t read_func, globus_xio_wrapblock_write_func_t write_func, globus_xio_wrapblock_accept_func_t accept_func) { xio_l_wrapblock_driver_t * wrapblock_driver; if(open_func != NULL) { driver->transport_open_func = globus_l_xio_wrapblock_open; } if(close_func != NULL) { driver->close_func = globus_l_xio_wrapblock_close; } if(read_func != NULL) { driver->read_func = globus_l_xio_wrapblock_read; } if(write_func != NULL) { driver->write_func = globus_l_xio_wrapblock_write; } if(accept_func != NULL) { driver->server_accept_func = globus_l_xio_wrapblock_server_accept; } wrapblock_driver = (xio_l_wrapblock_driver_t *) globus_calloc(1, sizeof(xio_l_wrapblock_driver_t)); wrapblock_driver->open_func = open_func; wrapblock_driver->close_func = close_func; wrapblock_driver->read_func = read_func; wrapblock_driver->write_func = write_func; wrapblock_driver->accept_func = accept_func; driver->wrap_data = wrapblock_driver; return GLOBUS_SUCCESS; } globus_xio-3.6/globus_i_xio_win32_mode.c0000666000076400007640000000521011374254655015357 00000000000000/* * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ #include "globus_config.h" #ifdef TARGET_ARCH_WIN32 #include "globus_i_xio_win32.h" /* all taken from DDK */ #ifndef NT_SUCCESS typedef LONG NTSTATUS; #define NT_SUCCESS(status) ((NTSTATUS)(status) >= 0) #endif typedef struct { union { NTSTATUS Status; PVOID Pointer; }; ULONG_PTR Information; } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; typedef enum { FileModeInformation = 16 } FILE_INFORMATION_CLASS; typedef struct { ULONG Mode; } FILE_MODE_INFORMATION; typedef NTSTATUS (__stdcall *globus_i_xio_win32_mode_nqif_t)( HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FileInformation, ULONG Length, FILE_INFORMATION_CLASS FileInformationClass); static HMODULE globus_i_xio_win32_mode_ntdll; static globus_i_xio_win32_mode_nqif_t globus_i_xio_win32_mode_query; int globus_i_xio_win32_mode_activate(void) { if(globus_i_xio_win32_mode_ntdll == NULL) { globus_i_xio_win32_mode_ntdll = LoadLibrary("ntdll.dll"); if(globus_i_xio_win32_mode_ntdll == NULL) { goto error_load; } globus_i_xio_win32_mode_query = (globus_i_xio_win32_mode_nqif_t) GetProcAddress( globus_i_xio_win32_mode_ntdll, "NtQueryInformationFile"); if(globus_i_xio_win32_mode_query == NULL) { goto error_symbol; } } return GLOBUS_SUCCESS; error_symbol: FreeLibrary(globus_i_xio_win32_mode_ntdll); error_load: return GLOBUS_FAILURE; } globus_bool_t globus_i_xio_win32_mode_is_overlapped( HANDLE handle) { IO_STATUS_BLOCK iosb; FILE_MODE_INFORMATION mode; if(NT_SUCCESS(globus_i_xio_win32_mode_query( handle, &iosb, &mode, sizeof(mode), FileModeInformation)) && NT_SUCCESS(iosb.Status) && (mode.Mode & (FILE_SYNCHRONOUS_IO_ALERT|FILE_SYNCHRONOUS_IO_NONALERT)) == 0) { return GLOBUS_TRUE; } else { return GLOBUS_FALSE; } } #endif /* TARGET_ARCH_WIN32 */ globus_xio-3.6/globus_xio_timeout.c0000666000076400007640000002216510363625117014567 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio.h" #define GLOBUS_L_XIO_TIMER_MAX_POLL 60 /* seconds */ typedef struct globus_i_xio_timer_entry_s { void * datum; globus_bool_t * progress_ptr; globus_i_xio_timer_cb_t timer_cb; globus_reltime_t rel_timeout; globus_abstime_t abs_timeout; } globus_i_xio_timer_entry_t; void globus_i_xio_timer_poller_callback( void * user_arg); void globus_i_xio_timer_init( globus_i_xio_timer_t * timer) { GlobusXIOName(globus_i_xio_timer_init); GlobusXIODebugInternalEnter(); globus_mutex_init(&timer->mutex, NULL); globus_cond_init(&timer->cond, NULL); timer->op_list = NULL; timer->running = GLOBUS_FALSE; globus_callback_space_register_periodic( &timer->periodic_handle, &globus_i_reltime_infinity, &globus_i_reltime_infinity, globus_i_xio_timer_poller_callback, (void *)timer, GLOBUS_CALLBACK_GLOBAL_SPACE); GlobusXIODebugInternalExit(); } void globus_l_xio_timer_unregister_cb( void * user_args) { globus_i_xio_timer_t * timer; GlobusXIOName(globus_l_xio_timer_unregister_cb); GlobusXIODebugInternalEnter(); timer = (globus_i_xio_timer_t *) user_args; globus_mutex_lock(&timer->mutex); { timer->running = GLOBUS_FALSE; globus_cond_signal(&timer->cond); } globus_mutex_unlock(&timer->mutex); /* GlobusXIODebugInternalExit(); having this in can cause core dumps */ } void globus_i_xio_timer_destroy( globus_i_xio_timer_t * timer) { globus_result_t res; GlobusXIOName(globus_i_xio_timer_destroy); GlobusXIODebugInternalEnter(); globus_mutex_lock(&timer->mutex); { /* reuse a bool */ timer->running = GLOBUS_TRUE; res = globus_callback_unregister( timer->periodic_handle, globus_l_xio_timer_unregister_cb, (void *)timer, NULL); /* logic of this code should prevent this from ever failing */ globus_assert(res == GLOBUS_SUCCESS); while(timer->running) { globus_cond_wait(&timer->cond, &timer->mutex); } } globus_mutex_unlock(&timer->mutex); /* if the list is not empty i am not gonna complain */ globus_mutex_destroy(&timer->mutex); GlobusXIODebugInternalExit(); } void globus_i_xio_timer_register_timeout( globus_i_xio_timer_t * timer, void * datum, globus_bool_t * progress_ptr, globus_i_xio_timer_cb_t timeout_cb, globus_reltime_t * timeout) { globus_i_xio_timer_entry_t * entry; globus_result_t res; globus_reltime_t poll_time; GlobusXIOName(globus_i_xio_timer_register_timeout); GlobusXIODebugInternalEnter(); entry = globus_malloc(sizeof(globus_i_xio_timer_entry_t)); entry->datum = datum; entry->progress_ptr = progress_ptr; entry->timer_cb = timeout_cb; GlobusTimeReltimeCopy(entry->rel_timeout, *timeout); GlobusTimeReltimeCopy(poll_time, entry->rel_timeout); /* limit poll time */ if(poll_time.tv_sec > GLOBUS_L_XIO_TIMER_MAX_POLL) { GlobusTimeReltimeSet(poll_time, GLOBUS_L_XIO_TIMER_MAX_POLL, 0); } /* expire immediately to force setting of progress flag */ GlobusTimeAbstimeGetCurrent(entry->abs_timeout); globus_mutex_lock(&timer->mutex); { if(!timer->running || globus_reltime_cmp(&poll_time, &timer->minimal_delay) < 0) { GlobusTimeReltimeCopy(timer->minimal_delay, poll_time); res = globus_callback_adjust_period( timer->periodic_handle, &timer->minimal_delay); if(res != GLOBUS_SUCCESS) { globus_panic(GLOBUS_XIO_MODULE, res, _XIOSL("globus_callback_adjust_period should always return success" " in this case\n" "timer @ 0x%x\n" " globus_callback_adjust_period(%d, 0x%x);\n"), timer->periodic_handle, &timer->minimal_delay); } timer->running = GLOBUS_TRUE; } *entry->progress_ptr = GLOBUS_TRUE; globus_list_insert(&timer->op_list, entry); } globus_mutex_unlock(&timer->mutex); GlobusXIODebugInternalExit(); } globus_bool_t globus_i_xio_timer_unregister_timeout( globus_i_xio_timer_t * timer, void * datum) { globus_list_t * list; globus_list_t * tmp_list = NULL; globus_bool_t found = GLOBUS_FALSE; /* intialize to remove warning, but not needed */ globus_i_xio_timer_entry_t * entry = NULL; GlobusXIOName(globus_i_xio_timer_unregister_timeout); GlobusXIODebugInternalEnter(); globus_mutex_lock(&timer->mutex); { for(list = timer->op_list; !found && !globus_list_empty(list); list = globus_list_rest(list)) { entry = (globus_i_xio_timer_entry_t *) globus_list_first(list); if(entry->datum == datum) { found = GLOBUS_TRUE; tmp_list = list; /* if the list is empty pause the callback */ } } if(found) { globus_list_remove(&timer->op_list, tmp_list); globus_free(entry); if(globus_list_empty(timer->op_list)) { globus_callback_adjust_period( timer->periodic_handle, NULL); timer->running = GLOBUS_FALSE; } } } globus_mutex_unlock(&timer->mutex); GlobusXIODebugInternalExit(); return found; } void globus_i_xio_timer_poller_callback( void * user_arg) { globus_i_xio_timer_t * timer; globus_list_t * list; globus_abstime_t now; globus_i_xio_timer_entry_t * entry; globus_list_t * call_list = NULL; globus_list_t * tmp_list = NULL; GlobusXIOName(globus_i_xio_timer_poller_callback); GlobusXIODebugInternalEnter(); timer = (globus_i_xio_timer_t *)user_arg; GlobusTimeAbstimeGetCurrent(now); globus_mutex_lock(&timer->mutex); { tmp_list = globus_list_copy(timer->op_list); for(list = tmp_list; !globus_list_empty(list); list = globus_list_rest(list)) { entry = (globus_i_xio_timer_entry_t *) globus_list_first(list); /* time has expired */ if(globus_abstime_cmp(&now, &entry->abs_timeout) >= 0) { /* if progress was made up the expiration point and flip * the progress flag */ if(*entry->progress_ptr) { *entry->progress_ptr = GLOBUS_FALSE; } /* timeout */ else { globus_list_insert(&call_list, entry); globus_list_remove(&timer->op_list, globus_list_search(timer->op_list, entry)); } GlobusTimeAbstimeCopy(entry->abs_timeout, now); GlobusTimeAbstimeInc( entry->abs_timeout, entry->rel_timeout); } } } globus_mutex_unlock(&timer->mutex); globus_list_free(tmp_list); /* remove from the list all that were canceled */ while(!globus_list_empty(call_list)) { entry = (globus_i_xio_timer_entry_t *)globus_list_remove( &call_list, call_list); /* * call the users function * if they return false then add the operation back into * the pool list. */ if(!entry->timer_cb(entry->datum)) { globus_mutex_lock(&timer->mutex); { globus_list_insert(&timer->op_list, entry); } globus_mutex_unlock(&timer->mutex); } /* if they return true we are done with the entry */ else { globus_free(entry); } } GlobusXIODebugInternalExit(); } globus_xio-3.6/install-sh0000755000076400007640000002202112225614602012466 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: globus_xio-3.6/globus_automake_post0000644000076400007640000000000012225575522014633 00000000000000globus_xio-3.6/globus_xio_system.h0000666000076400007640000002742611522621705014434 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * The goal of this abstraction is to provide a common interface for the * asynchronous and IO operations only. */ #ifndef GLOBUS_XIO_SYSTEM_INCLUDE #define GLOBUS_XIO_SYSTEM_INCLUDE #include "globus_common.h" #include "globus_xio_types.h" EXTERN_C_BEGIN #define GLOBUS_XIO_SYSTEM_MODULE (&globus_i_xio_system_module) extern globus_module_descriptor_t globus_i_xio_system_module; #ifdef WIN32 #include #include #define GLOBUS_XIO_SYSTEM_INVALID_FILE INVALID_HANDLE_VALUE #define GLOBUS_XIO_SYSTEM_INVALID_SOCKET INVALID_SOCKET typedef struct globus_l_xio_win32_file_s * globus_xio_system_file_handle_t; typedef struct globus_l_xio_win32_socket_s * globus_xio_system_socket_handle_t; typedef SOCKET globus_xio_system_socket_t; typedef HANDLE globus_xio_system_file_t; #elif defined(TARGET_ARCH_NETOS) #define GLOBUS_XIO_SYSTEM_INVALID_FILE -1 #define GLOBUS_XIO_SYSTEM_INVALID_SOCKET -1 /* these are handles to this interface */ typedef struct globus_l_xio_system_s * globus_xio_system_file_handle_t; typedef struct globus_l_xio_system_s * globus_xio_system_socket_handle_t; /* these are the native descriptor types */ typedef SOCKET globus_xio_system_socket_t; typedef int globus_xio_system_file_t; #else #define GLOBUS_XIO_SYSTEM_INVALID_FILE -1 #define GLOBUS_XIO_SYSTEM_INVALID_SOCKET -1 /* these are handles to this interface */ typedef struct globus_l_xio_system_s * globus_xio_system_file_handle_t; typedef struct globus_l_xio_system_s * globus_xio_system_socket_handle_t; /* these are the native descriptor types */ typedef int globus_xio_system_socket_t; typedef int globus_xio_system_file_t; /* deprecated, do not use! */ typedef int globus_xio_system_native_handle_t; #endif typedef enum { GLOBUS_XIO_SYSTEM_ERROR_SYSTEM_ERROR = 1024, GLOBUS_XIO_SYSTEM_ERROR_TOO_MANY_FDS, GLOBUS_XIO_SYSTEM_ERROR_ALREADY_REGISTERED, GLOBUS_XIO_SYSTEM_ERROR_OPERATION_CANCELED, GLOBUS_XIO_SYSTEM_ERROR_NOT_REGISTERED } globus_xio_system_error_type_t; typedef enum { GLOBUS_XIO_SYSTEM_FILE = 1, GLOBUS_XIO_SYSTEM_TCP, GLOBUS_XIO_SYSTEM_TCP_LISTENER, GLOBUS_XIO_SYSTEM_UDP } globus_xio_system_type_t; typedef void (*globus_xio_system_callback_t)( globus_result_t result, void * user_arg); typedef void (*globus_xio_system_data_callback_t)( globus_result_t result, globus_size_t nbytes, void * user_arg); /** * This handle is only used to maintain state for the operations below. * As of now, the only modification it makes to the handle is set the * non-blocking attribute. * * Note that initial file pointer is taken here and cached throughout. * do not seek yourself */ globus_result_t globus_xio_system_file_init( globus_xio_system_file_handle_t * handle, globus_xio_system_file_t fd); /* this does *not* close the native handle. * It should remove the non-blocking setting * * do not call this with outstanding operations. you can call it from with * a callback */ void globus_xio_system_file_destroy( globus_xio_system_file_handle_t handle); globus_result_t globus_xio_system_file_register_read( globus_xio_operation_t op, globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, globus_xio_system_data_callback_t callback, void * user_arg); globus_result_t globus_xio_system_file_register_write( globus_xio_operation_t op, globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, globus_xio_system_data_callback_t callback, void * user_arg); /* pass 0 for waitforbytes to not block */ globus_result_t globus_xio_system_file_read( globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, globus_size_t * nbytes); globus_result_t globus_xio_system_file_write( globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, globus_size_t * nbytes); /* syscall abstractions */ globus_off_t globus_xio_system_file_get_position( globus_xio_system_file_t fd); globus_off_t globus_xio_system_file_get_size( globus_xio_system_file_t fd); globus_xio_system_file_t globus_xio_system_convert_stdio( const char * stdio); globus_result_t globus_xio_system_file_truncate( globus_xio_system_file_t fd, globus_off_t size); globus_result_t globus_xio_system_file_open( globus_xio_system_file_t * fd, const char * filename, int flags, unsigned long mode); globus_result_t globus_xio_system_file_close( globus_xio_system_file_t fd); /** * This handle is only used to maintain state for the operations below. * As of now, the only modification it makes to the handle is set the * non-blocking attribute. */ globus_result_t globus_xio_system_socket_init( globus_xio_system_socket_handle_t * handle, globus_xio_system_socket_t socket, globus_xio_system_type_t type); /* this does *not* close the native handle. * It should remove the non-blocking setting * * do not call this with outstanding operations. you can call it from with * a callback */ void globus_xio_system_socket_destroy( globus_xio_system_socket_handle_t handle); globus_result_t globus_xio_system_socket_register_connect( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, globus_sockaddr_t * addr, globus_xio_system_callback_t callback, void * user_arg); globus_result_t globus_xio_system_socket_register_accept( globus_xio_operation_t op, globus_xio_system_socket_handle_t listener_handle, globus_xio_system_socket_t * out_handle, globus_xio_system_callback_t callback, void * user_arg); /* if using from, probably want waitforbytes to be 1 */ /* if waitforbytes == 0 and iov[0].iov_len == 0 * behave like select()... ie notify when data ready */ globus_result_t globus_xio_system_socket_register_read( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * out_from, globus_xio_system_data_callback_t callback, void * user_arg); /* if waitforbytes == 0 and iov[0].iov_len == 0 * behave like select()... ie notify when data ready */ globus_result_t globus_xio_system_socket_register_write( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * to, globus_xio_system_data_callback_t callback, void * user_arg); /* if waitforbytes == 0, do a non-blocking read */ globus_result_t globus_xio_system_socket_read( globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * from, globus_size_t * nbytes); /* if waitforbytes == 0, do a non-blocking write */ globus_result_t globus_xio_system_socket_write( globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * to, globus_size_t * nbytes); /* syscall abstractions */ globus_result_t globus_xio_system_socket_create( globus_xio_system_socket_t * socket, int domain, int type, int protocol); globus_result_t globus_xio_system_socket_setsockopt( globus_xio_system_socket_t socket, int level, int optname, const void * optval, globus_socklen_t optlen); globus_result_t globus_xio_system_socket_getsockopt( globus_xio_system_socket_t socket, int level, int optname, void * optval, globus_socklen_t * optlen); globus_result_t globus_xio_system_socket_getsockname( globus_xio_system_socket_t socket, struct sockaddr * name, globus_socklen_t * namelen); globus_result_t globus_xio_system_socket_getpeername( globus_xio_system_socket_t socket, struct sockaddr * name, globus_socklen_t * namelen); globus_result_t globus_xio_system_socket_bind( globus_xio_system_socket_t socket, struct sockaddr * addr, globus_socklen_t addrlen); globus_result_t globus_xio_system_socket_listen( globus_xio_system_socket_t socket, int backlog); globus_result_t globus_xio_system_socket_connect( globus_xio_system_socket_t socket, const struct sockaddr * addr, globus_socklen_t addrlen); globus_result_t globus_xio_system_socket_close( globus_xio_system_socket_t socket); #ifdef WIN32 /** * XXX * readonly on windows means something different than on unix. don't support * it for now */ #undef S_IRWXU #define S_IRWXU 0 #undef S_IRUSR #define S_IRUSR 0 #undef S_IWUSR #define S_IWUSR 0 #undef S_IXUSR #define S_IXUSR 0 #undef S_IRWXO #define S_IRWXO 0 #undef S_IROTH #define S_IROTH 0 #undef S_IWOTH #define S_IWOTH 0 #undef S_IXOTH #define S_IXOTH 0 #undef S_IRWXG #define S_IRWXG 0 #undef S_IRGRP #define S_IRGRP 0 #undef S_IWGRP #define S_IWGRP 0 #undef S_IXGRP #define S_IXGRP 0 #endif EXTERN_C_END #endif globus_xio-3.6/globus_xio.h0000666000076400007640000010252711522621705013024 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(GLOBUS_XIO_H) #define GLOBUS_XIO_H #include "globus_common.h" #include "globus_xio_types.h" #include "globus_xio_util.h" #include "globus_xio_load.h" EXTERN_C_BEGIN /** * @mainpage Globus XIO * * The Globus eXtensible Input Output library. * * - @ref GLOBUS_XIO_API * - @ref GLOBUS_XIO_API_ASSIST * - @ref globus_xio_driver * - @ref driver_pgm */ /** * @defgroup GLOBUS_XIO_API The globus_xio user API. */ /** * @defgroup GLOBUS_XIO_API_ASSIST User API Assistance. * \n * Help understanding the globus_xio api. * \n */ /** * \addtogroup GLOBUS_XIO_API_ASSIST * * \par Stack Constuction. * The driver stack that is used for a given xio handle is constructed * using a globus_xio_stack_t. Each driver is loaded by name * and pushed onto a stack. * * \code * stack setup example: * * // First load the drivers * globus_xio_driver_load("tcp", &tcp_driver); * globus_xio_driver_load("gsi", &gsi_driver); * * //build the stack * globus_xio_stack_init(&stack); * globus_xio_stack_push_driver(stack, tcp_driver, NULL); * globus_xio_stack_push_driver(stack, gsi_driver, NULL); * \endcode */ /** * \addtogroup GLOBUS_XIO_API_ASSIST * * \par Servers * A server data structure provides functionality for passive opens. * A server is initialized and bound to a protocol stack and set * of attributes with the function globus_xio_server_create(). Once * a server is created many "connections" can be accepted. Each connection * will result in an intialized handle which can later be opened. * * \code * * globus_xio_server_t server; * globus_xio_attr_t attr; * * globus_xio_attr_init(&attr); * globus_xio_server_create(&server_handle, attr, stack); * globus_xio_server_accept(&handle, server); * * \endcode */ /** * \addtogroup GLOBUS_XIO_API_ASSIST * * \par Handle Construction * There are two ways to create a handle. The first is for use as a * client (one that is doing an active open). The function: * globus_xio_handle_create() is used to create such a handle and bind * that handle to a protocol stack. * * \code * globus_xio_handle_create(&handle, stack); * \endcode * * The second means of creating a handle is for use as a server (one * that is doing a passive open). This is created by accepting a * connection on a server_handle with the function globus_xio_server_accept() * or globus_xio_server_register_accept(). * * Mutable attrs can be altered * via a call to globus_xio_handle_cntl() described later. * * \code * globus_xio_server_accept(&xio_handle, server_handle); * \endcode * * once a handle is intialized the user can call globus_xio_open() * to begin the open process. */ /** * @addtogroup GLOBUS_XIO_API_ASSIST * * \par Timeouts * A user can set a timeout value for any io operation. Each IO * operation (open close read write) can have its own timeout value. * If no timeout is set the operation will be allowed to infinitly * block.\n * When time expires the outstanding operation is canceled. If the * timeout callback for the given operation is not NULL it is called first to * notify the user that the operation timed out and give the user a chance to * ignore that timeout. If canceled, the user will get the callback they * registered for the operation as well, but it will come with an error * indicating that it has been canceled.\n * It is possiblie that part of an io operation will complete before * the timeout expires. In this case the opperation can still be * canceled. The user will receive there IO callback with and * error set and the length value appropriately set to indicate how * much of the operation completed. */ /** * @addtogroup GLOBUS_XIO_API_ASSIST * * \par Data Desciptor * The data descriptor ADT gives the user a means of attaching/extracting * meta data to a read or write operation.\n * Things like offset, out of band message, and other driver specific * meta data are contained in the data descriptor.\n * Data descriptors are passed to globus_xio in globus_xio_read() and * globus_xio_write(). Within the globus_xio framework * it is acceptable to pass NULL instead of a valid data_descriptor, * * \code * ex: * globus_xio_data_descriptor_init(&desc); * globus_xio_data_descriptor_cntl(desc, * tcp_driver, * GLOBUS_XIO_TCP_SET_SEND_FLAGS, * GLOBUS_XIO_TCP_SEND_OOB); * \endcode */ /************************************************************************* * define types ************************************************************************/ /** * \addtogroup GLOBUS_XIO_API_ASSIST * * \par User Attributes * Globus XIO uses a single attribute object for all of its functions. * Attributes give an the user an extenable mechanism to alter default * values which control parameters in an operation.\n * In most of the globus xio user api functions a user passes an * attribute as a parameter. In many cases the user may ignore the * attribute parameter and just pass in NULL. However at times the user * will wish to tweak the operation. The attribute structure is used for * this tweaking.\n * There are only three attribute functions. @ref globus_xio_attr_init * @ref globus_xio_attr_cntl and @ref globus_xio_attr_destroy. The * init and destroy functions are very simple and require little explaination. * Before an attribute can be used it must be intialized, and to clean up all * memory associated with it the user must call destroy on it.\n * The function @ref globus_xio_attr_cntl manipulates values in the * attribute. For more info on it see @ref globus_xio_attr_cntl. */ /** * \ingroup GLOBUS_XIO_API * Intialize a globus xio attribute. * * @param attr * upon return from this function this out parameter will be * initialized. Once the user is finished with the attribute * they should make sure they destroy it in order to free * resources associated with it. */ globus_result_t globus_xio_attr_init( globus_xio_attr_t * attr); /** * @ingroup GLOBUS_XIO_API * Manipulate the values associated in the attr. * * This function provides a means to access the attr structure. What * exactly this function does is determined by the value in the parameter * cmd and the value of the patameter driver. When the driver parameter * is NULL it indicates that this function applies to general globus xio * values. If it is not NULL it indicates that the function will effect * driver specific values. Each driver is resonsible for defining its own * enumeration of values for cmd and the var args associated with that * command. * * @param attr * the attribute structure to be manipulated. * * @param driver * This parameter indicates which driver the user would like * to perform the requested operation. If this parameter is * NULL this request will be scoped to general attribure functions. * * @param cmd * an enum that determines what specific operation the user is * requesting. Each driver will determine the value for this * enumeration. */ globus_result_t globus_xio_attr_cntl( globus_xio_attr_t attr, globus_xio_driver_t driver, int cmd, ...); /** * @ingroup GLOBUS_XIO_API * * Copy an attribute structure. */ globus_result_t globus_xio_attr_copy( globus_xio_attr_t * dst, globus_xio_attr_t src); /** * @ingroup GLOBUS_XIO_API * Clean up resources associated with an attribute. * * @param attr * Upon completion of this function all resources associated * with this structure will returned to the system and the attr * will no longer be valid. */ globus_result_t globus_xio_attr_destroy( globus_xio_attr_t attr); /************************************************************************* * Stack functions * --------------- ************************************************************************/ /** * @ingroup GLOBUS_XIO_API * Initialize a stack object */ globus_result_t globus_xio_stack_init( globus_xio_stack_t * stack, globus_xio_attr_t stack_attr); /** * @ingroup GLOBUS_XIO_API * Push a driver onto a stack. * * No attrs are associated with a driver. The stack represents the * ordered lists of transform drivers and 1 transport driver. The * transport driver must be pushed on first. */ globus_result_t globus_xio_stack_push_driver( globus_xio_stack_t stack, globus_xio_driver_t driver); /** * @ingroup GLOBUS_XIO_API * Copy a stack object */ globus_result_t globus_xio_stack_copy( globus_xio_stack_t * dst, globus_xio_stack_t src); /** * @ingroup GLOBUS_XIO_API * Destroy a stack object. */ globus_result_t globus_xio_stack_destroy( globus_xio_stack_t stack); /************************************************************************* * server ************************************************************************/ /** * @ingroup GLOBUS_XIO_API * Callback signature for accept. * * When a registered accept operation completes the users function of * this signature is called. * * @param server * The server object on which the accept was registered. * * @param handle * The newly created handle that was created by the accept * operation. * * @param result * A result code indicating the success of the accept operation. * GLOBUS_SUCCESS indicates a successful accept. * * @param user_arg * A user argument that is threaded from the registration to the * callback. */ typedef void (*globus_xio_accept_callback_t)( globus_xio_server_t server, globus_xio_handle_t handle, globus_result_t result, void * user_arg); /** * @ingroup GLOBUS_XIO_API * Server callback signature. * * This is the generic server callback signature. It is currently only * used for the register close operation. */ typedef void (*globus_xio_server_callback_t)( globus_xio_server_t server, void * user_arg); /** * @ingroup GLOBUS_XIO_API * Create a server object. * * This function allows the user to create a server object which can then * be used to accept connections. * * @param server * An out parameter. Once the function successfully returns this * will point to a valid server object. * * @param server_attr * an attributre structure used to alter the default server * intialization. This will mostly be used in a driver specific manner. * can be NULL. * * @param stack */ globus_result_t globus_xio_server_create( globus_xio_server_t * server, globus_xio_attr_t server_attr, globus_xio_stack_t stack); /** * @ingroup GLOBUS_XIO_API * get contact string * * This function allows the user to get the contact string for a server. * this string could be used as the contact string for the client side. * * @param server * An initialized server handle created with globus_xio_server_create() * * @param contact_string * an out varibale. Will point to a newly allocated string on success. * must be freed by the caller. */ globus_result_t globus_xio_server_get_contact_string( globus_xio_server_t server, char ** contact_string); /** * @ingroup GLOBUS_XIO_API * post a close on a server object * * This function registers a close operation on a server. When the user * function pointed to by parameter cb is called the server object is closed. */ globus_result_t globus_xio_server_register_close( globus_xio_server_t server, globus_xio_server_callback_t cb, void * user_arg); /** * @ingroup GLOBUS_XIO_API * A blocking server close */ globus_result_t globus_xio_server_close( globus_xio_server_t server); /** * @ingroup GLOBUS_XIO_API * Touch driver specific information in a server object. * * This function allows the user to comunicate directly with a driver * in association with a server object. The driver defines what operations * can be preformed. */ globus_result_t globus_xio_server_cntl( globus_xio_server_t server, globus_xio_driver_t driver, int cmd, ...); /** * @ingroup GLOBUS_XIO_API * Accept a connection * * This function will accept a connetion on the given server object * and the parameter out_handle will be valid if the function returns * successfully. */ globus_result_t globus_xio_server_accept( globus_xio_handle_t * out_handle, globus_xio_server_t server); /** * @ingroup GLOBUS_XIO_API * Asynchronous accept. * * This function posts an nonblocking accept. Once the operation has * completed the user function pointed to by the parameter cb is called. */ globus_result_t globus_xio_server_register_accept( globus_xio_server_t server, globus_xio_accept_callback_t cb, void * user_arg); /** * @ingroup GLOBUS_XIO_API * Initialize a handle for client opens * * This funtion will initialize a handle for active opens (client side * connections). * */ globus_result_t globus_xio_handle_create( globus_xio_handle_t * handle, globus_xio_stack_t stack); /****************************************************************** * handle construction *****************************************************************/ /****************************************************************** * setting timeout values *****************************************************************/ /** * @ingroup GLOBUS_XIO_API * The timeout callback function signature. * * @param handle * The handle the handle on which the timeout operation was * requested. * * @param type * The type of opperation that timed out: * GLOBUS_XIO_OPERATION_OPEN * GLOBUS_XIO_OPERATION_CLOSE * GLOBUS_XIO_OPERATION_READ * GLOBUS_XIO_OPERATION_WRITE * * @param arg * A user arg threaded throw to the callback. */ typedef globus_bool_t (*globus_xio_timeout_callback_t)( globus_xio_handle_t handle, globus_xio_operation_type_t type, void * user_arg); typedef globus_bool_t (*globus_xio_timeout_server_callback_t)( globus_xio_server_t server, globus_xio_operation_type_t type); /****************************************************************** * data descriptor *****************************************************************/ /** * Initialize a data descriptor * @ingroup GLOBUS_XIO_API * * @param data_desc * An out parameter. The data descriptor to be intialized. * * @param handle * The handle this data descriptor will be used with. This * parametter is require in order to optimize the code * handling the data descriptors use. */ globus_result_t globus_xio_data_descriptor_init( globus_xio_data_descriptor_t * data_desc, globus_xio_handle_t handle); /** * @ingroup GLOBUS_XIO_API * clean up a data descriptor. */ globus_result_t globus_xio_data_descriptor_destroy( globus_xio_data_descriptor_t data_desc); /** * Touch driver specific data in data descriptors * @ingroup GLOBUS_XIO_API * * This function allows the user to comunicate directly with a driver * in association with a data descriptors. The driver defines what operations * can be preformed. */ globus_result_t globus_xio_data_descriptor_cntl( globus_xio_data_descriptor_t data_desc, globus_xio_driver_t driver, int cmd, ...); /********************************************************************* * callbacks ********************************************************************/ /** * globus_xio_callback_t * @ingroup GLOBUS_XIO_API * * This callback is used for the open and close asynchronous * operations. */ typedef void (*globus_xio_callback_t)( globus_xio_handle_t handle, globus_result_t result, void * user_arg); /** * globus_xio_data_callback_t * @ingroup GLOBUS_XIO_API * * This callback is used for asychronous operations that send or receive * data. * * on eof, result_t will be of type GLOBUS_XIO_ERROR_EOF */ typedef void (*globus_xio_data_callback_t)( globus_xio_handle_t handle, globus_result_t result, globus_byte_t * buffer, globus_size_t len, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg); /** * globus_xio_iovec_callback_t * @ingroup GLOBUS_XIO_API * * This callback is used for asychronous operations that send or receive * data with an ivec structure. * * on eof, result_t will be of type GLOBUS_XIO_ERROR_EOF */ typedef void (*globus_xio_iovec_callback_t)( globus_xio_handle_t handle, globus_result_t result, globus_xio_iovec_t * iovec, int count, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg); /** * @ingroup GLOBUS_XIO_API * Touch driver specific information in a handle object. * * This function allows the user to comunicate directly with a driver * in association with a handle object. The driver defines what operations * can be preformed. * * pass the driver to control a specific driver * pass NULL for driver for XIO specific cntls * pass GLOBUS_XIO_QUERY for driver to try each driver in order until success */ globus_result_t globus_xio_handle_cntl( globus_xio_handle_t handle, globus_xio_driver_t driver, int cmd, ...); /** * Open a handle * @ingroup GLOBUS_XIO_API * * Creates an open handle based on the state contained in the given * stack. * * No operation can be preformed on a handle until it is initialized * and then opened. If * an already open handle used the information contaned in that handle * will be destoyed. * * @param handle * The handle created with @ref globus_xio_handle_create() or * @ref globus_xio_server_register_accept() that is to be opened. * * @param attr * how to open attribute. can be NULL * * @param cb * The function to be called when the open operation completes. * * @param user_arg * A user pointer that will be threaded through to the callback. * * @param contact_string * An url describing the resource. NULL is allowed. * Drivers interpret the various parts * of this url as descibed in their documentation. An alternative * form is also supported: if contact_string does not specify a scheme * (e.g. http://) and it contains a ':', it will be parsed as a host:port * pair. if it does not contain a ':', it will be parsed as the path * * the following are examples of valid formats: *
 *    \
 *    host-name ":" \
 *    "file:" \
 *    \ "://" [ "/" [ \ ]  ]
 *    \ "://" location [ "/" [ \ ] ]
 *      location:
 *          [ auth-part ] host-part
 *      auth-part:
 *          \ [ ":" \ ] "@" 
 *      host-part:
 *          [ "<" \ ">" ] host-name [ ":" \ ]
 *      host-name:
 *          \ | \ | "[" \ "]"
 *    
* * Except for use as the above delimeters, the following special characters * MUST be encoded with the \%HH format where H == hex char. * *
 *    "/" and "@" in location except subject
 *    "<" and ">" in location
 *    ":" everywhere except ipv6 address and subject
 *    "%" everywhere (can be encoded with \%HH or \%%)
 *    
*/ globus_result_t globus_xio_register_open( globus_xio_handle_t handle, const char * contact_string, globus_xio_attr_t attr, globus_xio_callback_t cb, void * user_arg); /** * blocking open * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_open( globus_xio_handle_t handle, const char * contact_string, globus_xio_attr_t attr); /** * Read data from a handle * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_register_read( globus_xio_handle_t handle, globus_byte_t * buffer, globus_size_t buffer_length, globus_size_t waitforbytes, globus_xio_data_descriptor_t data_desc, globus_xio_data_callback_t cb, void * user_arg); /** * Read data from a handle * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_read( globus_xio_handle_t handle, globus_byte_t * buffer, globus_size_t buffer_length, globus_size_t waitforbytes, globus_size_t * nbytes, globus_xio_data_descriptor_t data_desc); /** * Read data from a handle into a globus_xio_iovec_t (struct iovec) * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_register_readv( globus_xio_handle_t handle, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t waitforbytes, globus_xio_data_descriptor_t data_desc, globus_xio_iovec_callback_t cb, void * user_arg); /** * Read data from a handle into a globus_xio_iovec_t (struct iovec) * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_readv( globus_xio_handle_t handle, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t waitforbytes, globus_size_t * nbytes, globus_xio_data_descriptor_t data_desc); /** * Write data to a handle * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_register_write( globus_xio_handle_t handle, globus_byte_t * buffer, globus_size_t buffer_length, globus_size_t waitforbytes, globus_xio_data_descriptor_t data_desc, globus_xio_data_callback_t cb, void * user_arg); /** * Write data to a handle * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_write( globus_xio_handle_t handle, globus_byte_t * buffer, globus_size_t buffer_length, globus_size_t waitforbytes, globus_size_t * nbytes, globus_xio_data_descriptor_t data_desc); /** * Write data to a handle from a globus_xio_iovec_t (struct iovec) * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_register_writev( globus_xio_handle_t handle, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t waitforbytes, globus_xio_data_descriptor_t data_desc, globus_xio_iovec_callback_t cb, void * user_arg); /** * Write data to a handle from a globus_xio_iovec_t (struct iovec) * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_writev( globus_xio_handle_t handle, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t waitforbytes, globus_size_t * nbytes, globus_xio_data_descriptor_t data_desc); /** * Cancel outstanding operations */ globus_result_t globus_xio_handle_cancel_operations( globus_xio_handle_t handle, int mask); globus_result_t globus_xio_server_cancel_accept( globus_xio_server_t server); /** * Close a handle * @ingroup GLOBUS_XIO_API * * This functions servers as a destoy for the handle. As soon as the * operations completes (the callback is called). The handle is * destroyed. * * @param handle * the handle to be closed. * * @param attr * how to close attribute * * @param cb * The function to be called when the close operation completes. * * @param user_arg * A user pointer that will be threaded through to the callback. */ globus_result_t globus_xio_register_close( globus_xio_handle_t handle, globus_xio_attr_t attr, globus_xio_callback_t cb, void * user_arg); /** * Blocking close * @ingroup GLOBUS_XIO_API */ globus_result_t globus_xio_close( globus_xio_handle_t handle, globus_xio_attr_t attr); /* * signal stuff * TODO: * Signals are not implemented in the first release. * ================================================= * * Signals in globus xio give the user a means of requesting * notification when given things in the system change. * * For example: * It may be useful for the user of globus_xio to know when/if the * optimal post buffer size changes. The optimal post buffer size is * a value that tells the user the best posible length of a buffer to * post for an io operation. This value is mutable and can be changed * by events internal to globus_xio of which the user is unaware. * The signal API allows the user to register for notification of when * this value changes. * * GlobusXIO enumerates the signal types for which the user can register. * One of these types is GLOBUS_XIO_DRIVER_SPECIFIC. This type allows * the user to catch driver specific signals. A driver specific signal * example could be when the TCP window size changes. Only a TCP driver * can be aware of this information so only it can send the signal. * Further a user only knows to listen for that signal if it knows that * tcp is in its driver stack. * * Once a signal is delivered to the globus_xio user the handle can be * queried for specific information regarding that signal. * Event Types. * @ingroup GLOBUS_XIO_API * * An enumeration of the signal types of which globus_xio is aware. enum globus_xio_signal_type_t { GLOBUS_XIO_SIGNAL_BUFFER_POST_SIZE, GLOBUS_XIO_SIGNAL_OPTIMAL_BUFFER_SIZE, GLOBUS_XIO_SIGNAL_DRIVER_SPECIFIC, }; * * Signal Callback * @ingroup GLOBUS_XIO_API * * The callback signature for signal events. * * @param handle * The handle associated with the event. * * @param signal_type * The type of signal that occured. * * @param driver * The driver that caused this event. If it is not a driver * specific signal than this will be NULL. typedef void (*globus_xio_signal_callback_t)( globus_xio_handle_t handle, globus_xio_signal_type_t signal_type, globus_xio_driver_t driver); * * Register a signal listener. * @ingroup GLOBUS_XIO_API * * Reqest notification when event change in the system relating * to a given handle. * * @param handle * The handle on which the user would like to receive * notifications. * * @param signal_mask * A mask of the signals to be observed. * * @param driver * The driver to which the signal mask applies. If this is for a * non driver specific event this will be null. This function * must be called once for every driver of interest. * * @param callback * The funciton to be called when the given events occur. * * @param user_arg * A user pointed threaded through to the callback. globus_result_t globus_xio_handle_register_signal_handler( globus_xio_handle_t handle, int signal_mask, globus_xio_driver_t driver, globus_xio_signal_callback_t callback, void * user_arg); * Register a signal listener. * @ingroup GLOBUS_XIO_API * * Reqest notification when event change in the system relating * to a given factory. * * @param factory * The factory on which the user would like to receive * notifications of events. * * @param signal_mask * A mask of the signals to be observed. * * @param driver * The driver to which the signal mask applies. If this is for a * non driver specific event this will be null. This function * must be called once for every driver of interest. * * @param callback * The funciton to be called when the given events occur. * * @param user_arg * A user pointed threaded through to the callback. globus_result_t globus_xio_server_register_signal_handler( globus_xio_server_t factory, int signal_mask, globus_xio_driver_t driver, globus_xio_callback_t callback, void * user_arg); */ globus_xio_driver_list_ent_t * globus_xio_driver_list_find_driver( globus_list_t * driver_list, const char * driver_name); void globus_xio_driver_list_destroy( globus_list_t * driver_list, globus_bool_t unload); globus_result_t globus_xio_driver_list_to_stack_attr( globus_list_t * driver_list, globus_xio_stack_t stack, globus_xio_attr_t attr); globus_result_t globus_xio_driver_list_from_string( char * driver_string, globus_list_t ** driver_list, globus_hashtable_t * safe_table); globus_result_t globus_xio_driver_safe_table_from_string( char * driver_string, globus_hashtable_t * safe_table); globus_result_t globus_xio_driver_list_create_ent( const char * driver_desc, globus_xio_driver_t driver_in, globus_bool_t load, globus_xio_driver_list_ent_t ** ent_out); extern globus_module_descriptor_t globus_i_xio_module; #define GLOBUS_XIO_MODULE &globus_i_xio_module #define _XIOSL(s) globus_common_i18n_get_string( \ GLOBUS_XIO_MODULE, \ s) /** * @ingroup GLOBUS_XIO_API * Initializes a handle based on the scheme given. * * @param out_h * An uninitialized handle that will be initialized in the function * to correspond to the scheme given. This handle should be used * for any I/O operations. * * @param scheme * A string containing the protocol which the handle should be * initialized to. The string can either be a protocol by itself, * for example, "http", or a complete scheme such as * "http://www.example.com". * * @param attr * Attribute to be used for setting parameter string. It is * initialized by the function. Can be NULL if attributes * are not being used. * * @param param_string * A string containing attributes to be set for the drivers * associated with the scheme. This should be in the form * "protocol1:option1=value1;option2=value2,protocol2:option1=value1; * option2=value2" Can be NULL if attributes are not being used. */ globus_result_t globus_xio_handle_create_from_url( globus_xio_handle_t * out_h, const char * scheme, globus_xio_attr_t attr, char * param_string); EXTERN_C_END #endif globus_xio-3.6/config.guess0000755000076400007640000012463412225614603013020 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-07-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: globus_xio-3.6/globus_i_xio_win32_complete.c0000666000076400007640000002367011374254655016255 00000000000000/* * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ #include "globus_config.h" #ifdef TARGET_ARCH_WIN32 #include "globus_i_xio_win32.h" #define GlobusLWin32PollQueueInit() \ { \ globus_l_xio_win32_poll_queue = 0; \ globus_l_xio_win32_poll_queue_tail = &globus_l_xio_win32_poll_queue; \ } #define GlobusLWin32PollQueueEnqueue(entry) \ { \ (entry)->next = 0; \ *globus_l_xio_win32_poll_queue_tail = (entry); \ globus_l_xio_win32_poll_queue_tail = &(entry)->next; \ } #define GlobusLWin32PollQueueDequeue(entry) \ { \ (entry) = globus_l_xio_win32_poll_queue; \ globus_l_xio_win32_poll_queue = (entry)->next; \ if(!globus_l_xio_win32_poll_queue) \ globus_l_xio_win32_poll_queue_tail = &globus_l_xio_win32_poll_queue;\ } #define GlobusLWin32PollQueueEmpty() \ (globus_l_xio_win32_poll_queue == 0) typedef struct globus_l_xio_win32_poll_entry_s { globus_callback_func_t callback; void * user_arg; struct globus_l_xio_win32_poll_entry_s * next; } globus_l_xio_win32_poll_entry_t; static globus_callback_handle_t globus_l_xio_win32_poll_handle; static win32_mutex_t globus_l_xio_win32_poll_lock; static HANDLE globus_l_xio_win32_poll_event; static globus_bool_t globus_l_xio_win32_poll_event_sleeping; static globus_bool_t globus_l_xio_win32_poll_event_pending; static globus_l_xio_win32_poll_entry_t * globus_l_xio_win32_poll_queue; static globus_l_xio_win32_poll_entry_t ** globus_l_xio_win32_poll_queue_tail; static globus_l_xio_win32_poll_entry_t * globus_l_xio_win32_poll_free; static void globus_l_xio_win32_wakeup_handler( void * user_arg) { GlobusXIOName(globus_l_xio_win32_wakeup_handler); GlobusXIOSystemDebugEnter(); if(globus_l_xio_win32_poll_event != 0) { SetEvent(globus_l_xio_win32_poll_event); } GlobusXIOSystemDebugExit(); } static void globus_l_xio_win32_poll( void * user_arg) { GlobusXIOName(globus_l_xio_win32_poll); GlobusXIOSystemDebugEnter(); win32_mutex_lock(&globus_l_xio_win32_poll_lock); { if(GlobusLWin32PollQueueEmpty()) { globus_reltime_t time_left; globus_callback_get_timeout(&time_left); if(globus_reltime_cmp(&time_left, &globus_i_reltime_zero) > 0) { DWORD millis = INFINITE; if(!globus_time_reltime_is_infinity(&time_left)) { GlobusTimeReltimeToMilliSec(millis, time_left); } globus_l_xio_win32_poll_event_sleeping = GLOBUS_TRUE; win32_mutex_unlock(&globus_l_xio_win32_poll_lock); WaitForSingleObject(globus_l_xio_win32_poll_event, millis); win32_mutex_lock(&globus_l_xio_win32_poll_lock); globus_l_xio_win32_poll_event_sleeping = GLOBUS_FALSE; globus_l_xio_win32_poll_event_pending = GLOBUS_FALSE; } } while(!GlobusLWin32PollQueueEmpty()) { globus_l_xio_win32_poll_entry_t * entry; GlobusLWin32PollQueueDequeue(entry); win32_mutex_unlock(&globus_l_xio_win32_poll_lock); entry->callback(entry->user_arg); win32_mutex_lock(&globus_l_xio_win32_poll_lock); entry->next = globus_l_xio_win32_poll_free; globus_l_xio_win32_poll_free = entry; if(globus_callback_has_time_expired()) { break; } } } win32_mutex_unlock(&globus_l_xio_win32_poll_lock); GlobusXIOSystemDebugExit(); } int globus_i_xio_win32_complete_activate(void) { globus_result_t result; globus_reltime_t period; GlobusXIOName(globus_i_xio_win32_complete_activate); GlobusXIOSystemDebugEnter(); if (!globus_i_am_only_thread()) { goto skip_activate; } GlobusLWin32PollQueueInit(); win32_mutex_init(&globus_l_xio_win32_poll_lock, 0); globus_l_xio_win32_poll_event_sleeping = GLOBUS_FALSE; globus_l_xio_win32_poll_event_pending = GLOBUS_FALSE; globus_l_xio_win32_poll_free = 0; globus_l_xio_win32_poll_event = CreateEvent(0, FALSE, FALSE, 0); if(globus_l_xio_win32_poll_event == 0) { goto error_event; } GlobusTimeReltimeSet(period, 0, 0); result = globus_callback_register_periodic( &globus_l_xio_win32_poll_handle, 0, &period, globus_l_xio_win32_poll, 0); if(result != GLOBUS_SUCCESS) { goto error_periodic; } globus_callback_add_wakeup_handler( globus_l_xio_win32_wakeup_handler, 0); skip_activate: GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_periodic: CloseHandle(globus_l_xio_win32_poll_event); globus_l_xio_win32_poll_event = 0; error_event: win32_mutex_destroy(&globus_l_xio_win32_poll_lock); GlobusXIOSystemDebugExitWithError(); return GLOBUS_FAILURE; } typedef struct { globus_cond_t cond; globus_mutex_t mutex; } globus_l_shutdown_info_t; static void globus_l_xio_win32_unregister_poll_cb( void * user_arg) { globus_l_shutdown_info_t * info; GlobusXIOName(globus_l_xio_win32_unregister_poll_cb); GlobusXIOSystemDebugEnter(); info = (globus_l_shutdown_info_t *) user_arg; globus_mutex_lock(&info->mutex); { CloseHandle(globus_l_xio_win32_poll_event); globus_l_xio_win32_poll_event = 0; globus_cond_signal(&info->cond); } globus_mutex_unlock(&info->mutex); GlobusXIOSystemDebugExit(); } int globus_i_xio_win32_complete_deactivate(void) { globus_result_t result; globus_l_shutdown_info_t info; GlobusXIOName(globus_i_xio_win32_complete_deactivate); GlobusXIOSystemDebugEnter(); if (!globus_i_am_only_thread()) { goto skip_deactivate; } globus_mutex_init(&info.mutex, NULL); globus_cond_init(&info.cond, NULL); globus_mutex_lock(&info.mutex); { result = globus_callback_unregister( globus_l_xio_win32_poll_handle, globus_l_xio_win32_unregister_poll_cb, &info, 0); if(result == GLOBUS_SUCCESS) { /* unregister callback destroys this event object */ while(globus_l_xio_win32_poll_event != 0) { globus_cond_wait(&info.cond, &info.mutex); } } else { globus_mutex_unlock(&info.mutex); globus_l_xio_win32_unregister_poll_cb(&info); globus_mutex_lock(&info.mutex); } } globus_mutex_unlock(&info.mutex); globus_cond_destroy(&info.cond); globus_mutex_destroy(&info.mutex); win32_mutex_destroy(&globus_l_xio_win32_poll_lock); while(globus_l_xio_win32_poll_free) { globus_l_xio_win32_poll_entry_t * next = globus_l_xio_win32_poll_free->next; globus_free(globus_l_xio_win32_poll_free); globus_l_xio_win32_poll_free = next; } skip_deactivate: GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_i_xio_win32_complete( globus_callback_func_t callback, void * user_arg) { globus_l_xio_win32_poll_entry_t * entry; globus_result_t result; GlobusXIOName(globus_i_xio_win32_complete); GlobusXIOSystemDebugEnter(); if (! globus_i_am_only_thread()) { return globus_callback_register_oneshot( 0, 0, callback, user_arg); } win32_mutex_lock(&globus_l_xio_win32_poll_lock); { if(globus_l_xio_win32_poll_free) { entry = globus_l_xio_win32_poll_free; globus_l_xio_win32_poll_free = entry->next; } else { entry = (globus_l_xio_win32_poll_entry_t *) globus_malloc(sizeof(globus_l_xio_win32_poll_entry_t)); if(!entry) { result = GlobusXIOErrorMemory("entry"); goto error_malloc; } } entry->callback = callback; entry->user_arg = user_arg; GlobusLWin32PollQueueEnqueue(entry); if(globus_l_xio_win32_poll_event_sleeping && !globus_l_xio_win32_poll_event_pending) { SetEvent(globus_l_xio_win32_poll_event); globus_l_xio_win32_poll_event_pending = GLOBUS_TRUE; } } win32_mutex_unlock(&globus_l_xio_win32_poll_lock); GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_malloc: return result; } #endif /* TARGET_ARCH_WIN32 */ globus_xio-3.6/globus_xio_handle.c0000666000076400007640000034700111374254655014343 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio.h" #include "globus_i_xio.h" /* * read_op_list adn write_op_list * ------------------------------ * list of operations whos callbacks have not yet *returned*. * * cancel walks this list and sets all operations to canceled, * calling the driver callbck if neccessary. This goes for ops * that are finsihed and currently in the users callback. However * this causes no problem because the cancled flag will not be looked * at again, and the no driver will be registered for such csllbacks. */ /******************************************************************** * data structure macros *******************************************************************/ #define GlobusXIOHandleSetup(h, a) \ do \ { \ globus_i_xio_handle_t * _h; \ globus_i_xio_attr_t * _a; \ \ _h = (h); \ _a = (a); \ \ if(_a != NULL) \ { \ _h->open_timeout_cb = _a->open_timeout_cb; \ GlobusTimeReltimeCopy(_h->open_timeout_period, \ _a->open_timeout_period); \ _h->read_timeout_cb = _a->read_timeout_cb; \ GlobusTimeReltimeCopy(_h->read_timeout_period, \ _a->read_timeout_period); \ _h->write_timeout_cb = _a->write_timeout_cb; \ GlobusTimeReltimeCopy(_h->write_timeout_period, \ _a->write_timeout_period); \ _h->close_timeout_cb = _a->close_timeout_cb; \ GlobusTimeReltimeCopy(_h->close_timeout_period, \ _a->close_timeout_period); \ _h->timeout_arg = _a->timeout_arg; \ } \ } while(0) #define GlobusLXIOActiveTest() \ if(!globus_l_xio_active) return GlobusXIOErrorNotActivated() /* * module activation */ #include "version.h" #include "globus_i_xio.h" #include "globus_xio.h" char * globus_i_xio_handle_state_name_table[] = { "GLOBUS_XIO_HANDLE_STATE_NONE", "GLOBUS_XIO_HANDLE_STATE_CLIENT", "GLOBUS_XIO_HANDLE_STATE_ACCEPTED", "GLOBUS_XIO_HANDLE_STATE_OPENING", "GLOBUS_XIO_HANDLE_STATE_OPENING_FAILED", "GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING", "GLOBUS_XIO_HANDLE_STATE_OPEN", "GLOBUS_XIO_HANDLE_STATE_OPEN_FAILED", "GLOBUS_XIO_HANDLE_STATE_CLOSING", "GLOBUS_XIO_HANDLE_STATE_CLOSED", }; char * globus_i_xio_op_state_name_table[] = { "GLOBUS_XIO_OP_STATE_NONE", "GLOBUS_XIO_OP_STATE_OPERATING", "GLOBUS_XIO_OP_STATE_TIMEOUT_PENDING", "GLOBUS_XIO_OP_STATE_FINISH_WAITING", "GLOBUS_XIO_OP_STATE_FINISHED", }; char * globus_i_xio_context_state_name_table[] = { "GLOBUS_XIO_CONTEXT_STATE_NONE", "GLOBUS_XIO_CONTEXT_STATE_OPENING", "GLOBUS_XIO_CONTEXT_STATE_OPEN", "GLOBUS_XIO_CONTEXT_STATE_OPEN_FAILED", "GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED", "GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED", "GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING", "GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING", "GLOBUS_XIO_CONTEXT_STATE_CLOSING", "GLOBUS_XIO_CONTEXT_STATE_OPENING_AND_CLOSING", "GLOBUS_XIO_CONTEXT_STATE_CLOSED", }; /* * globus_l_xio_prt_ent_s, globus_l_xio_parsed_driver_s, xio_l_scheme, * and xio_l_scheme_drl_tbl are used in association with the * globus_xio_handle_create_from_url function. * * globus_l_xio_handle_create_from_url_init and * globus_l_xio_handle_create_from_url_cleanup are used to initialize the * driver hash table and free its resources, respectively. * globus_l_xio_handle_create_from_url_drv_unload is used to perform * the unloads and frees. */ #define XIO_MAX_DRIVER_SIZE 16 typedef struct globus_l_xio_prt_ent_s { char * prt_name; char * driver_list[XIO_MAX_DRIVER_SIZE]; } globus_l_xio_prt_ent_t; typedef struct globus_l_xio_parsed_driver_s { globus_xio_driver_t driver; globus_result_t res; char * driver_name; } globus_l_xio_parsed_driver_t; static globus_l_xio_prt_ent_t xio_l_scheme[] = { {"http", {"tcp", "http"}}, {"https", {"tcp", "http", "gsi"}}, {"tcp", {"tcp"}}, {"tcps", {"tcp", "gsi"}}, {"file", {"file"}}, {NULL} }; static globus_hashtable_t xio_l_scheme_drv_tbl; void globus_l_xio_handle_create_from_url_init(); void globus_l_xio_handle_create_from_url_cleanup(); void globus_l_xio_handle_create_from_url_drv_unload( void * datum); globus_i_xio_timer_t globus_i_xio_timeout_timer; globus_list_t * globus_i_xio_outstanding_handles_list; globus_mutex_t globus_i_xio_mutex; globus_cond_t globus_i_xio_cond; static globus_bool_t globus_l_xio_active = GLOBUS_FALSE; GlobusDebugDefine(GLOBUS_XIO); static globus_result_t globus_l_xio_register_close( globus_i_xio_op_t * op); static globus_result_t globus_l_xio_handle_cancel_operations( globus_i_xio_handle_t * xio_handle, int mask); static globus_bool_t globus_l_xio_timeout_callback( void * user_arg); static void globus_l_xio_open_close_callback( globus_i_xio_op_t * op, globus_result_t result, void * user_arg); void globus_i_xio_monitor_init( globus_i_xio_monitor_t * monitor) { monitor->count = 0; } void globus_i_xio_monitor_destroy( globus_i_xio_monitor_t * monitor) { } static globus_bool_t globus_l_xio_handle_timeout_always( globus_xio_handle_t handle, globus_xio_operation_type_t type, void * user_arg) { return GLOBUS_TRUE; } void globus_l_xio_oneshot_wrapper_cb( void * user_arg) { globus_i_xio_space_info_t * space_info; globus_i_xio_handle_t * handle; globus_result_t res; space_info = (globus_i_xio_space_info_t *) user_arg; handle = space_info->handle; if(space_info->unregister) { /* remove my reference to the handle */ res = globus_callback_unregister(space_info->ch, NULL, NULL, NULL); if(res != GLOBUS_SUCCESS) { globus_panic(GLOBUS_XIO_MODULE,res,_XIOSL("failed to unregister oneshot")); } globus_mutex_lock(&handle->context->cancel_mutex); { globus_list_remove(&handle->cb_list, globus_list_search(handle->cb_list, space_info)); } globus_mutex_unlock(&handle->context->cancel_mutex); } space_info->func(space_info->user_arg); globus_free(space_info); } static void globus_l_xio_cancel_data_ops( globus_i_xio_handle_t * handle) { globus_list_t * list; globus_i_xio_op_t * tmp_op; GlobusXIOName(globus_l_xio_cancel_data_ops); GlobusXIODebugInternalEnter(); for(list = handle->read_op_list; !globus_list_empty(list); list = globus_list_rest(list)) { tmp_op = (globus_i_xio_op_t *) globus_list_first(list); GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : canceling read op @ 0x%x\n"), _xio_name, tmp_op)); globus_i_xio_operation_cancel(tmp_op, -1); } for(list = handle->write_op_list; !globus_list_empty(list); list = globus_list_rest(list)) { tmp_op = (globus_i_xio_op_t *) globus_list_first(list); GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : canceling write op @ 0x%x\n"), _xio_name, tmp_op)); globus_i_xio_operation_cancel(tmp_op, -1); } GlobusXIODebugInternalExit(); } void globus_l_xio_open_close_callback_kickout( void * user_arg); static void globus_l_xio_handle_unopened_close_callback( void * user_arg) { globus_i_xio_op_t * op; globus_i_xio_handle_t * handle; GlobusXIOName(globus_l_xio_handle_unopened_close_callback); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; handle = op->_op_handle; globus_mutex_lock(&handle->context->mutex); GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_CLOSING); globus_mutex_unlock(&handle->context->mutex); globus_l_xio_open_close_callback_kickout(op); GlobusXIODebugInternalExit(); } static globus_result_t globus_l_xio_handle_pre_close( globus_i_xio_handle_t * handle, globus_xio_attr_t attr, globus_xio_callback_t cb, void * user_arg, globus_bool_t blocking) { void * driver_attr; int ctr; globus_bool_t destroy_handle; globus_i_xio_op_t * op; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_handle_pre_close); GlobusXIODebugInternalEnter(); GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { res = GlobusXIOErrorMemory("operation"); goto err_param; } /* * set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_CLOSE; op->state = GLOBUS_XIO_OP_STATE_OPERATING; op->_op_handle = handle; op->ref = 1; op->_op_cb = cb; op->user_arg = user_arg; op->entry[0].prev_ndx = -1;/*for first pass there is no return*/ op->blocking = blocking; if(blocking) { GlobusXIOCurrentBlockedThread(op->blocked_thread); } switch(handle->state) { /* the following 3 states catch the case where a handle is closed * either before opening (accepted or client) or after an open has * failed (open failed). We don't pass the close down in these cases, * so we fake a close. */ case GLOBUS_XIO_HANDLE_STATE_ACCEPTED: for(ctr = 0; ctr < handle->context->stack_size; ctr++) { if(handle->context->entry[ctr].driver_handle && handle->context->entry[ctr].driver->link_destroy_func) { handle->context->entry[ctr].driver->link_destroy_func( handle->context->entry[ctr].driver_handle); } } /* fall through */ case GLOBUS_XIO_HANDLE_STATE_CLIENT: case GLOBUS_XIO_HANDLE_STATE_OPEN_FAILED: attr = NULL; /* pretend we were opening (as this is the pre-opened state) */ GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING); op->state = GLOBUS_XIO_OP_STATE_FINISH_WAITING; handle->ref++; /* for the opperation */ GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_l_xio_handle_pre_close] :: handle ref at %d.\n"), handle->ref)); globus_i_xio_register_oneshot( handle, globus_l_xio_handle_unopened_close_callback, op, op->blocking ? GLOBUS_CALLBACK_GLOBAL_SPACE : handle->space); break; /* if opening, cancel the open */ case GLOBUS_XIO_HANDLE_STATE_OPENING: globus_assert(handle->open_op != NULL); if(attr == NULL || !attr->no_cancel) { globus_mutex_lock(&handle->context->cancel_mutex); { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : canceling open op @ 0x%x\n"), _xio_name, handle->open_op)); /* we delay the pass close until the open callback */ globus_i_xio_operation_cancel(handle->open_op, -1); /* cancel any data ops */ globus_l_xio_cancel_data_ops(handle); } globus_mutex_unlock(&handle->context->cancel_mutex); } GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING); break; case GLOBUS_XIO_HANDLE_STATE_OPENING_FAILED: GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING); break; case GLOBUS_XIO_HANDLE_STATE_OPEN: GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_CLOSING); if(attr == NULL || !attr->no_cancel) { /* cancel any data ops */ globus_mutex_lock(&handle->context->cancel_mutex); { globus_l_xio_cancel_data_ops(handle); } globus_mutex_unlock(&handle->context->cancel_mutex); } break; case GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING: case GLOBUS_XIO_HANDLE_STATE_CLOSED: case GLOBUS_XIO_HANDLE_STATE_CLOSING: res = GlobusXIOErrorInvalidState(handle->state); goto err; break; default: res = GlobusXIOErrorParameter("handle"); goto err; break; } /* set up op */ for(ctr = 0; ctr < handle->context->stack_size; ctr++) { op->entry[ctr].close_attr = NULL; if(attr != NULL) { driver_attr = NULL; GlobusIXIOAttrGetDS(driver_attr, attr, handle->context->entry[ctr].driver); if(driver_attr != NULL) { handle->context->entry[ctr].driver->attr_copy_func( &op->entry[ctr].close_attr, driver_attr); } } } handle->close_op = op; GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; err: handle->ref++; GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_l_xio_handle_pre_close] :: handle ref at %d.\n"), handle->ref)); /* so destroy handle can't be true (will be removed in next call) */ op->ref = 0; globus_i_xio_op_destroy(op, &destroy_handle); err_param: GlobusXIODebugInternalExitWithError(); return res; } void globus_i_xio_close_handles( globus_xio_driver_t driver) { globus_list_t * tmp_list; globus_list_t * c_handles = NULL; globus_xio_handle_t handle; globus_i_xio_context_t * context; globus_xio_server_t server; globus_i_xio_op_t * dd; globus_xio_attr_t attr; globus_bool_t found; int ctr; globus_i_xio_monitor_t monitor; globus_result_t res; GlobusXIOName(globus_i_xio_close_handles); GlobusXIODebugInternalEnter(); GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_close_handles]: closing driver @0x%x, %s\n"), driver, driver ? driver->name : "(null)")); globus_i_xio_monitor_init(&monitor); /* first destroy all of the dds, as they have references on the handle */ globus_mutex_lock(&globus_i_xio_mutex); { tmp_list = globus_list_copy(globus_i_xio_outstanding_dds_list); while(!globus_list_empty(tmp_list)) { dd = (globus_i_xio_op_t *) globus_list_remove(&tmp_list, tmp_list); context = dd->_op_context; globus_mutex_lock(&context->mutex); { found = GLOBUS_FALSE; for(ctr = 0; ctr < context->stack_size && !found; ctr++) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_i_xio_close_handles]: checking dd @0x%x " "driver @0x%x, %s\n"), dd, context->entry[ctr].driver, context->entry[ctr].driver->name)); if(driver == NULL || context->entry[ctr].driver == driver) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_close_handles] : " "will destroy dd @0x%x\n"), dd)); found = GLOBUS_TRUE; globus_list_insert(&c_handles, dd); } } } globus_mutex_unlock(&context->mutex); } } globus_mutex_unlock(&globus_i_xio_mutex); while(!globus_list_empty(c_handles)) { dd = (globus_i_xio_op_t *) globus_list_remove(&c_handles, c_handles); globus_xio_data_descriptor_destroy(dd); } globus_mutex_lock(&globus_i_xio_mutex); { /* close all open handles */ tmp_list = globus_list_copy(globus_i_xio_outstanding_handles_list); while(!globus_list_empty(tmp_list)) { handle = (globus_xio_handle_t) globus_list_remove(&tmp_list, tmp_list); globus_assert(handle->context != NULL); globus_mutex_lock(&handle->context->mutex); { /* if it is still in the list i must have no monitor */ globus_assert(handle->sd_monitor == NULL); found = GLOBUS_FALSE; for(ctr = 0; ctr < handle->context->stack_size && !found; ctr++) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_i_xio_close_handles]: checking handle @0x%x " "driver @0x%x, %s\n"), handle, handle->context->entry[ctr].driver, handle->context->entry[ctr].driver->name)); /* cancel on al handles */ if(driver == NULL || handle->context->entry[ctr].driver == driver) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_close_handles] : " "will wait on handle @0x%x state=%d\n"), handle, handle->state)); found = GLOBUS_TRUE; /* remove from the main list */ globus_list_remove( &globus_i_xio_outstanding_handles_list, globus_list_search( globus_i_xio_outstanding_handles_list, handle)); handle->sd_monitor = &monitor; monitor.count++; if(handle->state != GLOBUS_XIO_HANDLE_STATE_CLOSING && handle->state != GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING && handle->state != GLOBUS_XIO_HANDLE_STATE_CLOSED) { /* i suspect that res will always be true here */ res = globus_l_xio_handle_pre_close( handle, NULL, NULL, NULL, GLOBUS_TRUE); if(res != GLOBUS_SUCCESS) { /* if pree close fails we will not wait on this handle */ monitor.count--; } else if(handle->state != GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING) { globus_list_insert(&c_handles, handle); GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_close_handles] : " "registersing close on handle @0x%x\n"), handle)); } } } } } globus_mutex_unlock(&handle->context->mutex); } /* close all open servers */ tmp_list = globus_list_copy(globus_i_xio_outstanding_servers_list); while(!globus_list_empty(tmp_list)) { server = (globus_xio_server_t) globus_list_remove(&tmp_list, tmp_list); globus_mutex_lock(&server->mutex); { globus_assert(server->sd_monitor == NULL); found = GLOBUS_FALSE; for(ctr = 0; ctr < server->stack_size && !found; ctr++) { if(driver == NULL || server->entry[ctr].driver == driver) { found = GLOBUS_TRUE; GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_close_handles] : " "will wait on server @0x%x state=%d\n"), server, server->state)); globus_list_remove( &globus_i_xio_outstanding_servers_list, globus_list_search( globus_i_xio_outstanding_servers_list, server)); server->sd_monitor = &monitor; monitor.count++; if(server->state != GLOBUS_XIO_SERVER_STATE_CLOSE_PENDING && server->state != GLOBUS_XIO_SERVER_STATE_CLOSING && server->state != GLOBUS_XIO_SERVER_STATE_CLOSED) { res = globus_i_xio_server_close( server, NULL, NULL); if(res != GLOBUS_SUCCESS) { monitor.count--; } } } } } globus_mutex_unlock(&server->mutex); } /* destroy the internals of all attrs */ tmp_list = globus_list_copy(globus_i_xio_outstanding_attrs_list); while(!globus_list_empty(tmp_list)) { attr = (globus_xio_attr_t) globus_list_remove(&tmp_list, tmp_list); for(ctr = 0; ctr < attr->ndx && driver != NULL && attr->entry[ctr].driver != driver; ctr++) { } if(ctr < attr->ndx) { globus_list_remove( &globus_i_xio_outstanding_attrs_list, globus_list_search( globus_i_xio_outstanding_attrs_list, attr)); for(ctr = 0; ctr < attr->ndx; ctr++) { attr->entry[ctr].driver->attr_destroy_func( attr->entry[ctr].driver_data); } attr->unloaded = GLOBUS_TRUE; } } } globus_mutex_unlock(&globus_i_xio_mutex); while(!globus_list_empty(c_handles)) { handle = (globus_xio_handle_t) globus_list_remove(&c_handles, c_handles); res = globus_l_xio_register_close(handle->close_op); if(res != GLOBUS_SUCCESS) { globus_mutex_lock(&globus_i_xio_mutex); { /* since callbak will not be called we dec here */ monitor.count--; } globus_mutex_unlock(&globus_i_xio_mutex); } } globus_mutex_lock(&globus_i_xio_mutex); { while(monitor.count != 0) { globus_cond_wait(&globus_i_xio_cond, &globus_i_xio_mutex); } } globus_mutex_unlock(&globus_i_xio_mutex); globus_i_xio_monitor_destroy(&monitor); GlobusXIODebugInternalExit(); } void globus_i_xio_register_oneshot( globus_i_xio_handle_t * handle, globus_callback_func_t cb, void * user_arg, globus_callback_space_t space) { globus_result_t res; globus_i_xio_space_info_t * space_info; globus_callback_handle_t * ch = NULL; GlobusXIOName(globus_i_xio_register_oneshot); GlobusXIODebugInternalEnter(); if(handle != NULL && space != GLOBUS_CALLBACK_GLOBAL_SPACE) { space_info = (globus_i_xio_space_info_t *) globus_malloc(sizeof(globus_i_xio_space_info_t)); ch = &space_info->ch; space_info->func = cb; space_info->unregister = GLOBUS_TRUE; space_info->handle = handle; cb = globus_l_xio_oneshot_wrapper_cb; space_info->user_arg = user_arg; user_arg = space_info; globus_mutex_lock(&handle->context->cancel_mutex); { globus_list_insert(&handle->cb_list, space_info); } globus_mutex_unlock(&handle->context->cancel_mutex); } GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO, (_XIOSL("registering to space %d, user_arg = 0x%x\n"), space, user_arg)); res = globus_callback_space_register_oneshot( ch, NULL, cb, user_arg, space); if(res != GLOBUS_SUCCESS) { globus_panic(GLOBUS_XIO_MODULE, res, _XIOSL("failed to register oneshot")); } GlobusXIODebugInternalExit(); } static int globus_l_xio_activate(void) { int rc; GlobusXIOName(globus_l_xio_activate); GlobusXIODebugInternalEnter(); rc = globus_module_activate(GLOBUS_COMMON_MODULE); if(rc != 0) { return rc; } globus_mutex_init(&globus_i_xio_mutex, NULL); globus_cond_init(&globus_i_xio_cond, NULL); globus_i_xio_timer_init(&globus_i_xio_timeout_timer); globus_i_xio_outstanding_handles_list = NULL; globus_i_xio_outstanding_servers_list = NULL; globus_i_xio_outstanding_attrs_list = NULL; globus_i_xio_outstanding_dds_list = NULL; globus_l_xio_active = GLOBUS_TRUE; globus_i_xio_load_init(); globus_l_xio_handle_create_from_url_init(); GlobusDebugInit(GLOBUS_XIO, ERROR WARNING TRACE INTERNAL_TRACE INFO STATE INFO_VERBOSE); GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; } static int globus_l_xio_deactivate(void) { int rc; GlobusXIOName(globus_l_xio_deactivate); GlobusXIODebugInternalEnter(); globus_l_xio_handle_create_from_url_cleanup(); globus_mutex_destroy(&globus_i_xio_mutex); globus_cond_destroy(&globus_i_xio_cond); globus_i_xio_timer_destroy(&globus_i_xio_timeout_timer); globus_i_xio_load_destroy(); globus_l_xio_active = GLOBUS_FALSE; rc = globus_module_deactivate(GLOBUS_COMMON_MODULE); GlobusXIODebugInternalExit(); /* GlobusDebugDestroy(GLOBUS_XIO); */ return rc; } globus_module_descriptor_t globus_i_xio_module = { "globus_xio", globus_l_xio_activate, globus_l_xio_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; void globus_l_xio_read_write_callback_kickout( void * user_arg); /******************************************************************** * Internal functions *******************************************************************/ /* * This is called when either an open or a close completes. */ static void globus_l_xio_open_close_callback( globus_i_xio_op_t * op, globus_result_t result, void * user_arg) { globus_i_xio_handle_t * handle; globus_bool_t fire_callback = GLOBUS_TRUE; GlobusXIOName(globus_l_xio_open_close_callback); GlobusXIODebugInternalEnter(); handle = op->_op_handle; globus_mutex_lock(&handle->context->mutex); { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : op@ 0x%x op->type=%d handle->state=%d\n"), _xio_name, op, op->type, handle->state)); /* state can be either opening or closing.*/ switch(handle->state) { case GLOBUS_XIO_HANDLE_STATE_CLOSING: globus_assert(op->type == GLOBUS_XIO_OPERATION_TYPE_CLOSE); handle->close_op = NULL; break; case GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING: globus_assert(op->type == GLOBUS_XIO_OPERATION_TYPE_OPEN); break; case GLOBUS_XIO_HANDLE_STATE_OPENING: globus_assert(op->type == GLOBUS_XIO_OPERATION_TYPE_OPEN); if(result != GLOBUS_SUCCESS) { GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_OPENING_FAILED); } else { GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_OPEN); } break; case GLOBUS_XIO_HANDLE_STATE_OPENING_FAILED: case GLOBUS_XIO_HANDLE_STATE_OPEN: case GLOBUS_XIO_HANDLE_STATE_CLOSED: default: globus_assert(0); } /* set to finished for the sake of the timeout */ if(op->state == GLOBUS_XIO_OP_STATE_TIMEOUT_PENDING) { fire_callback = GLOBUS_FALSE; } else { fire_callback = GLOBUS_TRUE; if(op->_op_handle_timeout_cb != NULL) { /* * unregister the cancel */ /* if the unregister fails we will get the callback */ if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, op)) { /* at this point we know timeout won't happen */ GlobusXIOOpDec(op); /* since we have no yet deced for the callbacl this cannot be zero */ globus_assert(op->ref > 0); } } } /* remove the operation from the list */ GlobusXIOOpStateChange(op, GLOBUS_XIO_OP_STATE_FINISH_WAITING); op->cached_obj = GlobusXIOResultToObj(result); /* * when at the top don't worry about the cancel * just act as though we missed it */ } globus_mutex_unlock(&handle->context->mutex); if(fire_callback) { /* we can always call in this stack since Pass macros enforce registration bariers and callback spaces */ globus_l_xio_open_close_callback_kickout((void *)op); } GlobusXIODebugInternalExit(); } /* * called by the callback code. * registerd by finished op when the final (user) callback * is in a callback space, or if it is under the registraton * call within the same callstack */ void globus_l_xio_open_close_callback_kickout( void * user_arg) { int ctr; globus_result_t res; globus_i_xio_op_t * op; globus_i_xio_op_t * close_op = NULL; globus_i_xio_handle_t * handle; globus_bool_t start_close = GLOBUS_FALSE; globus_bool_t destroy_handle = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_open_close_callback_kickout); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; handle = op->_op_handle; /* call the users callback */ if(op->_op_cb != NULL) { op->_op_cb(handle, GlobusXIOObjToResult(op->cached_obj), op->user_arg); } else if(op->cached_obj != NULL) { globus_object_free(op->cached_obj); } globus_mutex_lock(&handle->context->mutex); { globus_assert(op->state == GLOBUS_XIO_OP_STATE_FINISH_WAITING); /* this is likely useless, but may help in debugging */ GlobusXIOOpStateChange(op, GLOBUS_XIO_OP_STATE_FINISHED); /* clean up the links */ if(op->type == GLOBUS_XIO_OPERATION_TYPE_OPEN) { for(ctr = 0; ctr < op->stack_size; ctr++) { if(op->entry[ctr].link != NULL && handle->context->entry[ctr].driver->link_destroy_func != NULL) { /* ignore result code. user should be more interested in result from callback */ handle->context->entry[ctr].driver->link_destroy_func( op->entry[ctr].link); } } } /* necessary for all states except GLOBUS_XIO_HANDLE_STATE_CLOSED */ handle->open_op = NULL; switch(handle->state) { case GLOBUS_XIO_HANDLE_STATE_OPEN: globus_assert(op->type == GLOBUS_XIO_OPERATION_TYPE_OPEN); break; case GLOBUS_XIO_HANDLE_STATE_OPENING_FAILED: globus_assert(op->type == GLOBUS_XIO_OPERATION_TYPE_OPEN); GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_OPEN_FAILED); break; case GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING: globus_assert(op->type == GLOBUS_XIO_OPERATION_TYPE_OPEN && handle->close_op != NULL); GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_CLOSING); /* start the close */ start_close = GLOBUS_TRUE; close_op = handle->close_op; break; case GLOBUS_XIO_HANDLE_STATE_CLOSING: /* could be an open op if the user calls close in the callback */ if(op->type == GLOBUS_XIO_OPERATION_TYPE_CLOSE) { GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_CLOSED); /* remove handles own reference */ globus_i_xio_handle_dec(handle, &destroy_handle); /* destroy handle cannot possibly be true yet the handle stll has the operation reference */ globus_assert(!destroy_handle); } break; /* can enter the closed state if use calls xio_close() in open callback and the close callback finishes before the open one returns */ case GLOBUS_XIO_HANDLE_STATE_CLOSED: break; case GLOBUS_XIO_HANDLE_STATE_OPENING: default: globus_assert(0); } /* decrement reference for the operation */ GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); /* only gets here if coming from the operning and closing state */ if(start_close) { res = globus_l_xio_register_close(close_op); if(res != GLOBUS_SUCCESS) { globus_l_xio_open_close_callback(close_op, res, NULL); } globus_assert(!destroy_handle); } if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); } /* * operation callback for readv and writev operations * we don't care what the result is, just so it bubbles up to the user */ void globus_i_xio_read_write_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_handle_t * handle; globus_bool_t fire_operation = GLOBUS_TRUE; GlobusXIOName(globus_i_xio_read_write_callback); GlobusXIODebugInternalEnter(); handle = op->_op_handle; globus_mutex_lock(&handle->context->mutex); { globus_assert(handle->state == GLOBUS_XIO_HANDLE_STATE_OPEN || handle->state == GLOBUS_XIO_HANDLE_STATE_CLOSING); /* set to finished for the sake of the timeout */ if(op->state == GLOBUS_XIO_OP_STATE_TIMEOUT_PENDING) { fire_operation = GLOBUS_FALSE; } else { fire_operation = GLOBUS_TRUE; if(op->_op_handle_timeout_cb != NULL) { /* * unregister the cancel */ /* if the unregister fails we will get the callback */ if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, op)) { /* at this point we know timeout won't happen */ GlobusXIOOpDec(op); } } } GlobusXIOOpStateChange(op, GLOBUS_XIO_OP_STATE_FINISH_WAITING); if(op->type == GLOBUS_XIO_OPERATION_TYPE_WRITE) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : removing write op @ 0x%x\n"), _xio_name, op)); globus_list_remove(&handle->write_op_list, globus_list_search(handle->write_op_list, op)); } else if(op->type == GLOBUS_XIO_OPERATION_TYPE_READ) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : removing read op @ 0x%x\n"), _xio_name, op)); globus_list_remove(&handle->read_op_list, globus_list_search(handle->read_op_list, op)); } else { globus_assert(0); } op->cached_obj = GlobusXIOResultToObj(result); op->_op_nbytes = nbytes; } globus_mutex_unlock(&handle->context->mutex); if(fire_operation) { globus_l_xio_read_write_callback_kickout((void *)op); } GlobusXIODebugInternalExit(); } /* * called unlocked either by the callback code or in the finsihed op * state. */ void globus_l_xio_read_write_callback_kickout( void * user_arg) { globus_i_xio_op_t * op; globus_i_xio_handle_t * handle; globus_bool_t destroy_handle = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_read_write_callback_kickout); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; handle = op->_op_handle; if(op->is_user_dd) { op->type = GLOBUS_XIO_OPERATION_TYPE_DD; } /* call the users callback */ if(op->_op_data_cb != NULL) { op->_op_data_cb( handle, GlobusXIOObjToResult(op->cached_obj), op->_op_mem_iovec.iov_base, op->_op_mem_iovec.iov_len, op->_op_nbytes, op, op->user_arg); } else if(op->_op_iovec_cb != NULL) { op->_op_iovec_cb( handle, GlobusXIOObjToResult(op->cached_obj), op->_op_iovec, op->_op_iovec_count, op->_op_nbytes, op, op->user_arg); } else if(op->cached_obj != NULL) { globus_object_free(op->cached_obj); } globus_mutex_lock(&handle->context->mutex); { /* * This is ok in CLOSED state because of will block stuff */ globus_assert(handle->state != GLOBUS_XIO_HANDLE_STATE_OPENING); /* decrement reference for the operation */ GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); } /* * this starts the cancel processes for the given operation. * * the cancel flag is to true. every pass checks this flag and * if cancel is true the pass fails and the above driver should * do what it needs to do to cancel the operation. If a driver * is able to cancel it will call GlobusXIODriverCancelEanble() * if at the time this function is called the operations cancel * flag is set to true we register a oneshot for the cancel. * * If a cencel occurs while a driver is registered to receive * cancel notification then the callback is delivered to it. * * The framework has little else to do with cancel. The operation * will come back up via the normal routes with an error. */ globus_result_t globus_i_xio_operation_cancel( globus_i_xio_op_t * op, int source_ndx) { GlobusXIOName(globus_i_xio_operation_cancel); GlobusXIODebugInternalEnter(); /* internal function should never be passed NULL */ globus_assert(op != NULL); if(op->canceled) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : op @ 0x%x alread canceled\n"), _xio_name, op)); goto exit; } /* the timeout should only be unregistered if this call is coming from the user */ if(source_ndx == -1) { /* * if the user oks the cancel then remove the timeout from * the poller */ if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, op)) { GlobusXIOOpDec(op); } } /* since in callback this will always be true */ /* * set cancel flag * if a driver has a registered callback it will be called * if it doesn't the next pass or finished will pick it up * * we offset by 2 because source_ndx for user == -1 and top driver == 0 * and we want op->canceled to be non-zero when a cancel is pending. */ op->canceled = source_ndx + 2; /* only cancel it if its not in source's possession * * (op->ndx == source_ndx + 1) */ if(op->ndx > source_ndx + 1) { if(op->cancel_cb != NULL) { globus_i_xio_op_entry_t * my_op; my_op = &op->entry[op->ndx - 1]; GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : op @ 0x%x calling cancel\n"), _xio_name, op)); my_op->in_register = GLOBUS_TRUE; op->cancel_cb(op, op->cancel_arg, GLOBUS_XIO_ERROR_CANCELED); my_op->in_register = GLOBUS_FALSE; } } else { /* we set canceled above first to make up for the fact that the * op->ndx we are reading is not stable. what may happen is that above * ndx may change to source_ndx + 1 immediately after we read it. this * would cause us to errorneously 'cancel' this op. This is ok, since * we are guaranteed to hit the locked section in GlobusIXIOClearCancel * which will set canceled back to 0 for us */ op->canceled = 0; } exit: GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; } static globus_bool_t globus_l_xio_timeout_callback( void * user_arg) { globus_i_xio_op_t * op; globus_i_xio_handle_t * handle; /* rc is definitly set elsewhere but this gets rid of compiler warning and lets me know that i knew what i was doing */ globus_bool_t rc = GLOBUS_FALSE; globus_bool_t fire_callback; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_bool_t cancel; globus_bool_t timeout = GLOBUS_FALSE; /* delayed_cb is in same situation as rc */ globus_callback_func_t delayed_cb = NULL; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_l_xio_timeout_callback); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; handle = op->_op_handle; globus_mutex_lock(&handle->context->mutex); { switch(op->state) { /* * this case happens when a open operation first pass fails and * are unable to unregister the timeout and when the operation * completes but we are unable to unregister the callback. */ case GLOBUS_XIO_OP_STATE_FINISHED: case GLOBUS_XIO_OP_STATE_FINISH_WAITING: /* decerement the reference for the timeout callback */ GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } /* remove it from the timeout list */ rc = GLOBUS_TRUE; break; /* this case happens when we actually want to cancel the operation The timeout code should insure that prograess is false if this gets called in this state */ case GLOBUS_XIO_OP_STATE_OPERATING: /* it is up to the timeout callback to set this to true */ rc = GLOBUS_FALSE; /* cancel the sucker */ globus_assert(op->_op_handle_timeout_cb != NULL); /* if the driver has blocked the timeout don't call it */ if(!op->block_timeout) { timeout = GLOBUS_TRUE; /* put in canceling state to delay the accept callback */ GlobusXIOOpStateChange(op, GLOBUS_XIO_OP_STATE_TIMEOUT_PENDING); } break; /* fail on any ohter case */ default: globus_assert(0); } } globus_mutex_unlock(&handle->context->mutex); /* if in cancel state, verfiy with user that they want to cancel */ if(timeout) { cancel = op->_op_handle_timeout_cb( handle, op->type, handle->timeout_arg); } /* all non time out casses can just return */ else { /* wait until outside of lock to free the handle */ if(destroy_handle) { globus_i_xio_handle_destroy(handle); } goto exit; } /* if canceling set the res and we will remove this timer event */ if(cancel) { rc = GLOBUS_TRUE; globus_mutex_lock(&handle->context->cancel_mutex); { /* Assume all timeouts originate from user */ op->canceled = 1; if(op->cancel_cb) { globus_i_xio_op_entry_t * my_op; my_op = &op->entry[op->ndx - 1]; my_op->in_register = GLOBUS_TRUE; op->cancel_cb(op, op->cancel_arg, GLOBUS_XIO_ERROR_TIMEOUT); my_op->in_register = GLOBUS_FALSE; } } globus_mutex_unlock(&handle->context->cancel_mutex); } globus_mutex_lock(&handle->context->mutex); { /* if callback has already arriverd set flag to later call accept callback and set rc to remove timed event */ if(op->state == GLOBUS_XIO_OP_STATE_FINISH_WAITING) { fire_callback = GLOBUS_TRUE; rc = GLOBUS_TRUE; } /* if no accept is waiting, set state back to operating */ else { fire_callback = GLOBUS_FALSE; GlobusXIOOpStateChange(op, GLOBUS_XIO_OP_STATE_OPERATING); } /* if we are remvoing the timed event */ if(rc) { /* decremenet the op reference count and insist that it is not zero yet */ op->_op_handle_timeout_cb = NULL; GlobusXIOOpDec(op); globus_assert(op->ref > 0); } /* if the accpet was pending we must call it */ if(fire_callback) { switch(op->type) { case GLOBUS_XIO_OPERATION_TYPE_OPEN: case GLOBUS_XIO_OPERATION_TYPE_CLOSE: delayed_cb = globus_l_xio_open_close_callback_kickout; break; case GLOBUS_XIO_OPERATION_TYPE_READ: case GLOBUS_XIO_OPERATION_TYPE_WRITE: delayed_cb = globus_l_xio_read_write_callback_kickout; break; default: globus_assert(0); break; } } } globus_mutex_unlock(&handle->context->mutex); if(fire_callback) { if(!op->blocking) { space = handle->space; } if(space != GLOBUS_CALLBACK_GLOBAL_SPACE) { /* register a oneshot callback */ globus_i_xio_register_oneshot( handle, delayed_cb, (void *)op, space); } /* in all other cases we can just call callback */ else { delayed_cb((void *)op); } } exit: GlobusXIODebugInternalExit(); return rc; } /* * */ globus_result_t globus_l_xio_register_writev( globus_i_xio_op_t * op, int ref) { globus_result_t res; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_i_xio_handle_t * handle; GlobusXIOName(globus_l_xio_register_writev); GlobusXIODebugInternalEnter(); handle = op->_op_handle; globus_mutex_lock(&handle->context->mutex); { handle->ref += ref; if(handle->state != GLOBUS_XIO_HANDLE_STATE_OPEN) { res = GlobusXIOErrorInvalidState(handle->state); goto bad_state_err; } /* register timeout */ if(op->_op_handle->write_timeout_cb != NULL) { /* op the operatin reference count for this */ GlobusXIOOpInc(op); op->_op_handle_timeout_cb = handle->write_timeout_cb; globus_i_xio_timer_register_timeout( &globus_i_xio_timeout_timer, op, &op->progress, globus_l_xio_timeout_callback, &handle->write_timeout_period); } GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : inserting write op @ 0x%x\n"), _xio_name, op)); globus_list_insert(&handle->write_op_list, op); } globus_mutex_unlock(&handle->context->mutex); /* add reference count for the pass. does not need to be done locked since no one has op until it is passed */ GlobusXIOOpInc(op); res = globus_xio_driver_pass_write(op, op->_op_iovec, op->_op_iovec_count, op->_op_wait_for, globus_i_xio_read_write_callback, (void *)NULL); if(res != GLOBUS_SUCCESS) { goto pass_err; } globus_mutex_lock(&handle->context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; pass_err: globus_mutex_lock(&handle->context->mutex); { globus_list_remove(&handle->write_op_list, globus_list_search(handle->write_op_list, op)); GlobusXIOOpDec(op); /* dec for the register */ globus_assert(op->ref > 0); /* in case timeout unregister fails */ op->type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; /* if we had a timeout, we need to unregister it */ if(handle->write_timeout_cb != NULL) { /* if unregister works remove its reference count */ if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, op)) { GlobusXIOOpDec(op); globus_assert(op->ref > 0); } } bad_state_err: /* clean up the operation */ GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); /* handle should always have a reference left at this point */ globus_assert(!destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); GlobusXIODebugInternalExitWithError(); return res; } /* * */ globus_result_t globus_l_xio_register_readv( globus_i_xio_op_t * op, int ref) { globus_result_t res; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_i_xio_handle_t * handle; GlobusXIOName(globus_l_xio_register_readv); GlobusXIODebugInternalEnter(); handle = op->_op_handle; globus_mutex_lock(&handle->context->mutex); { handle->ref += ref; if(handle->state != GLOBUS_XIO_HANDLE_STATE_OPEN) { res = GlobusXIOErrorInvalidState(handle->state); goto bad_state_err; } /* this is a bit ugly handle doesn't maitain this state and Pass asserts for efficieny. so wee need to check it here to be nice to the user */ if(handle->context->entry[0].state != GLOBUS_XIO_CONTEXT_STATE_OPEN && handle->context->entry[0].state != GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED && handle->context->entry[0].state != GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED) { res = GlobusXIOErrorInvalidState(handle->context->entry[0].state); goto bad_state_err; } /* register timeout */ if(handle->read_timeout_cb != NULL) { /* op the operatin reference count for this */ GlobusXIOOpInc(op); op->_op_handle_timeout_cb = handle->read_timeout_cb; globus_i_xio_timer_register_timeout( &globus_i_xio_timeout_timer, op, &op->progress, globus_l_xio_timeout_callback, &handle->read_timeout_period); } GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : inserting read op @ 0x%x\n"), _xio_name, op)); globus_list_insert(&handle->read_op_list, op); } globus_mutex_unlock(&handle->context->mutex); /* add reference count for the pass. does not need to be done locked since no one has op until it is passed */ GlobusXIOOpInc(op); res = globus_xio_driver_pass_read(op, op->_op_iovec, op->_op_iovec_count, op->_op_wait_for, globus_i_xio_read_write_callback, (void *)NULL); if(res != GLOBUS_SUCCESS) { goto register_err; } globus_mutex_lock(&handle->context->mutex); { GlobusXIOOpDec(op); /* remove the pass reference */ if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; register_err: globus_mutex_lock(&handle->context->mutex); { globus_list_remove(&handle->read_op_list, globus_list_search(handle->read_op_list, op)); GlobusXIOOpDec(op); /* unregister the pass */ globus_assert(op->ref > 0); /* in case timeout unregister fails */ op->type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; /* if we had a timeout, we need to unregister it */ if(handle->read_timeout_cb != NULL) { /* if unregister works remove its reference count */ if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, op)) { GlobusXIOOpDec(op); globus_assert(op->ref > 0); } } bad_state_err: /* clean up the operation */ GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); /* handle should always have a reference left at this point */ globus_assert(!destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); GlobusXIODebugInternalExitWithError(); return res; } globus_result_t globus_l_xio_register_open( globus_i_xio_op_t * op, const char * contact_string) { globus_bool_t destroy_handle = GLOBUS_FALSE; globus_i_xio_handle_t * handle; globus_xio_contact_t contact_info; globus_result_t res; int ctr; GlobusXIOName(globus_l_xio_register_open); GlobusXIODebugInternalEnter(); res = globus_xio_contact_parse(&contact_info, contact_string); if(res != GLOBUS_SUCCESS) { goto err_contact; } handle = op->_op_handle; /* accepted handles have the link structures stored in the driver_handle * slot. move them into the op now. */ if(handle->state == GLOBUS_XIO_HANDLE_STATE_ACCEPTED) { /* stick the link in the new handle's context */ for(ctr = 0; ctr < op->stack_size; ctr++) { op->entry[ctr].link = handle->context->entry[ctr].driver_handle; handle->context->entry[ctr].driver_handle = NULL; } } handle->state = GLOBUS_XIO_HANDLE_STATE_OPENING; /* register timeout */ if(handle->open_timeout_cb != NULL) { /* op the operatin reference count for this */ GlobusXIOOpInc(op); op->_op_handle_timeout_cb = handle->open_timeout_cb; globus_i_xio_timer_register_timeout( &globus_i_xio_timeout_timer, op, &op->progress, globus_l_xio_timeout_callback, &handle->open_timeout_period); } /* add reference count for the pass. does not need to be done locked since no one has op until it is passed */ GlobusXIOOpInc(op); res = globus_xio_driver_pass_open( op, &contact_info, globus_l_xio_open_close_callback, NULL); globus_xio_contact_destroy(&contact_info); if(res != GLOBUS_SUCCESS) { goto err; } globus_mutex_lock(&handle->context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; /* * error handling */ err: globus_mutex_lock(&handle->context->mutex); { handle->state = GLOBUS_XIO_HANDLE_STATE_OPEN_FAILED; GlobusXIOOpDec(op); /* dec for the register */ globus_assert(op->ref > 0); if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, op)) { GlobusXIOOpDec(op); globus_assert(op->ref > 0); } GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); /* handle should always have a reference left at this point */ globus_assert(!destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } err_contact: GlobusXIODebugInternalExitWithError(); return res; } static globus_result_t globus_l_xio_register_close( globus_i_xio_op_t * op) { globus_bool_t destroy_handle = GLOBUS_FALSE; globus_i_xio_handle_t * handle; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_register_close); GlobusXIODebugInternalEnter(); handle = op->_op_handle; globus_mutex_lock(&handle->context->mutex); { /* register timeout */ if(handle->close_timeout_cb != NULL) { /* op the operatin reference count for this */ GlobusXIOOpInc(op); op->_op_handle_timeout_cb = handle->close_timeout_cb; globus_i_xio_timer_register_timeout( &globus_i_xio_timeout_timer, op, &op->progress, globus_l_xio_timeout_callback, &handle->close_timeout_period); } handle->ref++; /* for the opperation */ GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_l_xio_register_close] :: handle ref at %d.\n"), handle->ref)); } globus_mutex_unlock(&handle->context->mutex); /* add reference count for the pass. does not need to be done locked since no one has op until it is passed */ GlobusXIOOpInc(op); res = globus_xio_driver_pass_close( op, globus_l_xio_open_close_callback, NULL); if(res != GLOBUS_SUCCESS) { goto err; } globus_mutex_lock(&handle->context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; err: globus_mutex_lock(&handle->context->mutex); { /* the handle is closed since we will return a failure */ handle->state = GLOBUS_XIO_HANDLE_STATE_CLOSED; GlobusXIOOpDec(op); /* dec for the register */ globus_assert(op->ref > 0); if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, op)) { GlobusXIOOpDec(op); } GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); /* handle should always have a reference left at this point */ globus_assert(!destroy_handle); } globus_i_xio_handle_dec(handle, &destroy_handle); } globus_mutex_unlock(&handle->context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExitWithError(); return res; } /* * cancel the operations */ static globus_result_t globus_l_xio_handle_cancel_operations( globus_i_xio_handle_t * xio_handle, int mask) { globus_list_t * list; globus_i_xio_op_t * tmp_op; GlobusXIOName(globus_l_xio_handle_cancel_operations); GlobusXIODebugInternalEnter(); globus_mutex_lock(&xio_handle->context->cancel_mutex); { if(mask & GLOBUS_XIO_CANCEL_OPEN && xio_handle->open_op != NULL) { globus_i_xio_operation_cancel(xio_handle->open_op, -1); } if(mask & GLOBUS_XIO_CANCEL_CLOSE && xio_handle->close_op != NULL) { globus_i_xio_operation_cancel(xio_handle->close_op, -1); } if(mask & GLOBUS_XIO_CANCEL_READ) { /* remove all outstanding read ops */ for(list = xio_handle->read_op_list; !globus_list_empty(list); list = globus_list_rest(list)) { tmp_op = (globus_i_xio_op_t *) globus_list_first(list); globus_i_xio_operation_cancel(tmp_op, -1); } } if(mask & GLOBUS_XIO_CANCEL_WRITE) { for(list = xio_handle->write_op_list; !globus_list_empty(list); list = globus_list_rest(list)) { tmp_op = (globus_i_xio_op_t *) globus_list_first(list); globus_i_xio_operation_cancel(tmp_op, -1); } } } globus_mutex_unlock(&xio_handle->context->cancel_mutex); GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; } /******************************************************************** * API functions * ------------- *******************************************************************/ globus_result_t globus_xio_handle_create( globus_xio_handle_t * handle, globus_xio_stack_t stack) { globus_i_xio_handle_t * ihandle; globus_i_xio_context_t * context; int stack_size; int ndx; globus_list_t * list; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_handle_create); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto error_param; } *handle = NULL; /* initialze to be nice to user */ if(stack == NULL) { res = GlobusXIOErrorParameter("stack"); goto error_param; } stack_size = globus_list_size(stack->driver_stack); if(stack_size == 0) { res = GlobusXIOErrorParameter("stack_size"); goto error_param; } /* allocate and initialize context */ context = globus_i_xio_context_create(stack_size); if(context == NULL) { res = GlobusXIOErrorMemory("context"); goto error_context; } /* allocate and intialize the handle structure */ ihandle = (globus_i_xio_handle_t *) globus_calloc(1, sizeof(globus_i_xio_handle_t)); if(ihandle == NULL) { res = GlobusXIOErrorMemory("ihandle"); goto error_handle; } /* initialize the handle */ ihandle->ref = 1; /* itself */ ihandle->context = context; ihandle->state = GLOBUS_XIO_HANDLE_STATE_CLIENT; ihandle->space = GLOBUS_CALLBACK_GLOBAL_SPACE; for(ndx = 0, list = stack->driver_stack; !globus_list_empty(list); ndx++, list = globus_list_rest(list)) { context->entry[ndx].driver = (globus_xio_driver_t) globus_list_first(list); } globus_assert(ndx == stack_size); globus_mutex_lock(&globus_i_xio_mutex); { globus_list_insert(&globus_i_xio_outstanding_handles_list, ihandle); } globus_mutex_unlock(&globus_i_xio_mutex); *handle = ihandle; GlobusXIODebugExit(); return GLOBUS_SUCCESS; error_handle: globus_i_xio_context_destroy(context); error_context: error_param: GlobusXIODebugExitWithError(); return res; } /* * User Open * --------- * Check the parameters and state then pass to internal open function. */ globus_result_t globus_xio_register_open( globus_xio_handle_t handle, const char * contact_string, globus_xio_attr_t attr, globus_xio_callback_t cb, void * user_arg) { void * driver_attr; globus_i_xio_op_t * op = NULL; globus_i_xio_context_t * context; globus_result_t res; int ctr; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_xio_register_open); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto err; } if(handle->state != GLOBUS_XIO_HANDLE_STATE_CLIENT && handle->state != GLOBUS_XIO_HANDLE_STATE_ACCEPTED) { res = GlobusXIOErrorInvalidState(handle->state); goto err; } context = handle->context; GlobusXIOOperationCreate(op, context); if(op == NULL) { res = GlobusXIOErrorMemory("operation"); goto err; } GlobusXIOHandleSetup(handle, attr); /* all memory has been allocated, now set up the different structures */ /* * set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_OPEN; op->state = GLOBUS_XIO_OP_STATE_OPERATING; op->_op_handle = handle; op->ref = 1; op->ndx = 0; op->_op_cb = cb; op->user_arg = user_arg; op->entry[0].prev_ndx = -1; /* for first pass there is no return */ handle->ref++; /* for operation */ GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_xio_register_open] :: handle ref at %d.\n"), handle->ref)); handle->open_op = op; if(attr != NULL) { op->user_open_cred = attr->user_open_cred; op->user_open_sbj = globus_libc_strdup(attr->user_open_sbj); op->user_open_username = globus_libc_strdup(attr->user_open_username); op->user_open_pw = globus_libc_strdup(attr->user_open_pw); space = attr->space; /* set entries in structures */ for(ctr = 0; ctr < context->stack_size; ctr++) { op->entry[ctr].open_attr = NULL; GlobusIXIOAttrGetDS( driver_attr, attr, context->entry[ctr].driver); if(driver_attr != NULL) { context->entry[ctr].driver->attr_copy_func( &op->entry[ctr].open_attr, driver_attr); } } } handle->space = space; globus_callback_space_reference(space); res = globus_l_xio_register_open(op, contact_string); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; /* * error handling */ err: GlobusXIODebugExitWithError(); return res; } /* * User Read * --------- * Check the parameters and state * If everything is ok create and setup the operation structure * fake the iovec structure with the dummy iovec in the operation struct * Then pass to the internal readv function */ globus_result_t globus_xio_register_read( globus_xio_handle_t handle, globus_byte_t * buffer, globus_size_t buffer_length, globus_size_t waitforbytes, globus_xio_data_descriptor_t data_desc, globus_xio_data_callback_t cb, void * user_arg) { globus_i_xio_op_t * op; globus_result_t res; int ref = 0; GlobusXIOName(globus_xio_register_read); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); /* error echecking */ if(handle == NULL) { return GlobusXIOErrorParameter("handle"); } if(buffer == NULL) { return GlobusXIOErrorParameter("buffer"); } if(buffer_length < 0) { return GlobusXIOErrorParameter("buffer_length"); } op = data_desc; if(op == NULL) { GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { res = GlobusXIOErrorMemory("operation"); goto exit; } ref = 1; op->ref = 0; } /* set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_READ; op->state = GLOBUS_XIO_OP_STATE_OPERATING; op->_op_handle = handle; GlobusXIOOpInc(op); op->_op_context = handle->context; op->_op_data_cb = cb; op->_op_iovec_cb = NULL; op->_op_mem_iovec.iov_base = buffer; op->_op_mem_iovec.iov_len = buffer_length; op->_op_iovec_count = 1; op->_op_iovec = &op->_op_mem_iovec; op->_op_wait_for = waitforbytes; op->user_arg = user_arg; op->entry[0].prev_ndx = -1; res = globus_l_xio_register_readv(op, ref); if(res != GLOBUS_SUCCESS) { goto exit; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; exit: GlobusXIODebugExitWithError(); return res; } /* * User Readv * ---------- * Check the parameters and state * If everything is ok create and setup the operation structure * Then pass to the internal readv function */ globus_result_t globus_xio_register_readv( globus_xio_handle_t handle, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t waitforbytes, globus_xio_data_descriptor_t data_desc, globus_xio_iovec_callback_t cb, void * user_arg) { globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_op_t * op; int ref = 0; GlobusXIOName(globus_xio_register_readv); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); /* error echecking */ if(handle == NULL) { return GlobusXIOErrorParameter("handle"); } if(iovec == NULL) { return GlobusXIOErrorParameter("iovec"); } if(iovec_count <= 0) { return GlobusXIOErrorParameter("iovec_count"); } op = data_desc; if(op == NULL) { GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { res = GlobusXIOErrorMemory("operation"); goto exit; } ref = 1; op->ref = 0; } /* set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_READ; op->state = GLOBUS_XIO_OP_STATE_OPERATING; op->_op_handle = handle; op->_op_context = handle->context; GlobusXIOOpInc(op); op->_op_data_cb = NULL; op->_op_iovec_cb = cb; op->_op_iovec = iovec; op->_op_iovec_count = iovec_count; op->_op_wait_for = waitforbytes; op->user_arg = user_arg; op->entry[0].prev_ndx = -1; res = globus_l_xio_register_readv(op, ref); if(res != GLOBUS_SUCCESS) { goto exit; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; exit: GlobusXIODebugExitWithError(); return res; } /* * User Write * ---------- * Check the parameters and state * If everything is ok create and setup the operation structure * fake the iocev structure with the dummy iovec in the operation struct * Then pass to the internal writev function */ globus_result_t globus_xio_register_write( globus_xio_handle_t user_handle, globus_byte_t * buffer, globus_size_t buffer_length, globus_size_t waitforbytes, globus_xio_data_descriptor_t data_desc, globus_xio_data_callback_t cb, void * user_arg) { globus_i_xio_op_t * op; globus_result_t res; globus_i_xio_handle_t * handle; int ref = 0; GlobusXIOName(globus_xio_register_write); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); handle = user_handle; /* error echecking */ if(handle == NULL) { return GlobusXIOErrorParameter("handle"); } if(buffer == NULL) { return GlobusXIOErrorParameter("buffer"); } if(buffer_length < 0) { return GlobusXIOErrorParameter("buffer_length"); } op = data_desc; if(op == NULL) { GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { res = GlobusXIOErrorMemory("operation"); goto exit; } ref = 1; op->ref = 0; } /* set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_WRITE; op->state = GLOBUS_XIO_OP_STATE_OPERATING; GlobusXIOOpInc(op); op->entry[0].prev_ndx = -1; op->_op_handle = handle; op->_op_context = handle->context; op->_op_data_cb = cb; op->_op_iovec_cb = NULL; op->_op_mem_iovec.iov_base = buffer; op->_op_mem_iovec.iov_len = buffer_length; op->_op_iovec_count = 1; op->_op_iovec = &op->_op_mem_iovec; op->_op_wait_for = waitforbytes; op->user_arg = user_arg; res = globus_l_xio_register_writev(op, ref); if(res != GLOBUS_SUCCESS) { goto exit; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; exit: GlobusXIODebugExitWithError(); return res; } /* * User Writev * ----------- * Check the parameters and state * If everything is ok create and setup the operation structure * Then pass to the internal writev function */ globus_result_t globus_xio_register_writev( globus_xio_handle_t user_handle, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t waitforbytes, globus_xio_data_descriptor_t data_desc, globus_xio_iovec_callback_t cb, void * user_arg) { globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_op_t * op; globus_i_xio_handle_t * handle; int ref = 0; GlobusXIOName(globus_xio_register_writev); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); handle = (globus_i_xio_handle_t *) user_handle; /* error echecking */ if(handle == NULL) { return GlobusXIOErrorParameter("handle"); } if(iovec == NULL) { return GlobusXIOErrorParameter("iovec"); } if(iovec_count <= 0) { return GlobusXIOErrorParameter("iovec_count"); } op = data_desc; if(op == NULL) { GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { res = GlobusXIOErrorMemory("operation"); goto exit; } ref = 1; op->ref = 0; } /* set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_WRITE; op->state = GLOBUS_XIO_OP_STATE_OPERATING; op->entry[0].prev_ndx = -1; GlobusXIOOpInc(op); op->_op_handle = handle; op->_op_context = handle->context; op->_op_data_cb = NULL; op->_op_iovec_cb = cb; op->_op_iovec = iovec; op->_op_iovec_count = iovec_count; op->_op_wait_for = waitforbytes; op->user_arg = user_arg; res = globus_l_xio_register_writev(op, ref); if(res != GLOBUS_SUCCESS) { goto exit; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; exit: GlobusXIODebugExitWithError(); return res; } /* * User Close * ---------- * Check the parameters and state then pass to internal function. */ globus_result_t globus_xio_register_close( globus_xio_handle_t handle, globus_xio_attr_t attr, globus_xio_callback_t cb, void * user_arg) { globus_result_t res; /* initialize to remove warn, but not needed */ globus_i_xio_op_t * op = NULL; globus_bool_t pass = GLOBUS_TRUE; GlobusXIOName(globus_xio_register_close); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); /* error echecking */ if(handle == NULL) { return GlobusXIOErrorParameter("handle"); } globus_mutex_lock(&handle->context->mutex); { if(handle->sd_monitor != NULL) { res = GlobusXIOErrorUnloaded(); } else { res = globus_l_xio_handle_pre_close( handle, attr, cb, user_arg, GLOBUS_FALSE); op = handle->close_op; if(handle->state == GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING) { pass = GLOBUS_FALSE; } } } globus_mutex_unlock(&handle->context->mutex); if(res != GLOBUS_SUCCESS) { goto err; } if(pass) { res = globus_l_xio_register_close(op); if(res != GLOBUS_SUCCESS) { goto err; } } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } /* * cancel outstanding operations. * * In the furture the attr will control what operations get canceled. * For now all are canceled. */ globus_result_t globus_xio_handle_cancel_operations( globus_xio_handle_t handle, int mask) { globus_i_xio_handle_t * xio_handle; globus_result_t res; GlobusXIOName(globus_xio_handle_cancel_operations); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); /* error echecking */ if(handle == NULL) { return GlobusXIOErrorParameter("handle"); } xio_handle = handle; globus_mutex_lock(&xio_handle->context->mutex); { /* if closed there is nothing to cancel */ if(xio_handle->state == GLOBUS_XIO_HANDLE_STATE_CLOSED) { res = GlobusXIOErrorInvalidState(xio_handle->state); } else { res = globus_l_xio_handle_cancel_operations( xio_handle, mask); } } globus_mutex_unlock(&xio_handle->context->mutex); GlobusXIODebugExit(); return res; } globus_result_t globus_xio_handle_cntl( globus_xio_handle_t handle, globus_xio_driver_t driver, int cmd, ...) { globus_result_t res = GLOBUS_SUCCESS; va_list ap; globus_i_xio_context_t * context; globus_xio_timeout_callback_t timeout_cb; globus_reltime_t * delay_time; GlobusXIOName(globus_xio_handle_cntl); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); if(handle == NULL) { return GlobusXIOErrorParameter("handle"); } context = handle->context; if(context == NULL) { return GlobusXIOErrorParameter("handle"); } # ifdef HAVE_STDARG_H { va_start(ap, cmd); } # else { va_start(ap); } # endif if(driver != NULL) { res = globus_i_xio_driver_handle_cntl(context, 0, driver, cmd, ap); } else { globus_mutex_lock(&context->mutex); { /* do general settings */ switch(cmd) { case GLOBUS_XIO_ATTR_SET_TIMEOUT_ALL: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); handle->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_handle_timeout_always; } handle->open_timeout_cb = timeout_cb; handle->close_timeout_cb = timeout_cb; handle->read_timeout_cb = timeout_cb; handle->write_timeout_cb = timeout_cb; GlobusTimeReltimeCopy( handle->open_timeout_period, *delay_time); GlobusTimeReltimeCopy( handle->close_timeout_period, *delay_time); GlobusTimeReltimeCopy( handle->read_timeout_period, *delay_time); GlobusTimeReltimeCopy( handle->write_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_OPEN: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); handle->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_handle_timeout_always; } handle->open_timeout_cb = timeout_cb; GlobusTimeReltimeCopy( handle->open_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_CLOSE: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); handle->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_handle_timeout_always; } handle->close_timeout_cb = timeout_cb; GlobusTimeReltimeCopy( handle->close_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_READ: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); handle->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_handle_timeout_always; } handle->read_timeout_cb = timeout_cb; GlobusTimeReltimeCopy( handle->read_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_WRITE: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); handle->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_handle_timeout_always; } handle->write_timeout_cb = timeout_cb; GlobusTimeReltimeCopy( handle->write_timeout_period, *delay_time); break; default: break; } } globus_mutex_unlock(&context->mutex); } va_end(ap); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } /************************************************************************ * blocking calls * -------------- ***********************************************************************/ globus_i_xio_blocking_t * globus_i_xio_blocking_alloc() { globus_i_xio_blocking_t * info; info = (globus_i_xio_blocking_t *) globus_malloc(sizeof(globus_i_xio_blocking_t)); if(info == NULL) { return info; } globus_mutex_init(&info->mutex, NULL); globus_cond_init(&info->cond, NULL); info->done = GLOBUS_FALSE; return info; } void globus_i_xio_blocking_destroy( globus_i_xio_blocking_t * info) { globus_mutex_destroy(&info->mutex); globus_cond_destroy(&info->cond); globus_free(info); } void globus_l_xio_blocking_cb( globus_xio_handle_t handle, globus_result_t result, void * user_arg) { globus_i_xio_blocking_t * info; info = (globus_i_xio_blocking_t *) user_arg; globus_mutex_lock(&info->mutex); { info->error_obj = GlobusXIOResultToObj(result); info->done = GLOBUS_TRUE; globus_cond_signal(&info->cond); } globus_mutex_unlock(&info->mutex); } void globus_l_xio_blocking_data_cb( globus_xio_handle_t handle, globus_result_t result, globus_byte_t * buffer, globus_size_t len, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg) { globus_i_xio_blocking_t * info; info = (globus_i_xio_blocking_t *) user_arg; globus_mutex_lock(&info->mutex); { info->error_obj = GlobusXIOResultToObj(result); info->data_desc = data_desc; info->nbytes = nbytes; info->done = GLOBUS_TRUE; globus_cond_signal(&info->cond); } globus_mutex_unlock(&info->mutex); } void globus_l_xio_blocking_iov_cb( globus_xio_handle_t handle, globus_result_t result, globus_xio_iovec_t * iovec, int count, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg) { globus_i_xio_blocking_t * info; info = (globus_i_xio_blocking_t *) user_arg; globus_mutex_lock(&info->mutex); { info->error_obj = GlobusXIOResultToObj(result); info->data_desc = data_desc; info->nbytes = nbytes; info->done = GLOBUS_TRUE; globus_cond_signal(&info->cond); } globus_mutex_unlock(&info->mutex); } globus_result_t globus_xio_open( globus_xio_handle_t handle, const char * contact_string, globus_xio_attr_t attr) { void * driver_attr = NULL; globus_i_xio_op_t * op; globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_context_t * context; int ctr; globus_i_xio_blocking_t * info; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_xio_open); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto param_err; } if(handle->state != GLOBUS_XIO_HANDLE_STATE_CLIENT && handle->state != GLOBUS_XIO_HANDLE_STATE_ACCEPTED) { res = GlobusXIOErrorInvalidState(handle->state); goto param_err; } info = globus_i_xio_blocking_alloc(); if(info == NULL) { res = GlobusXIOErrorMemory("internal structure"); goto param_err; } context = handle->context; GlobusXIOOperationCreate(op, context); if(op == NULL) { res = GlobusXIOErrorMemory("operation"); goto op_alloc_error; } info->op = op; GlobusXIOHandleSetup(handle, attr); /* all memory has been allocated, now set up the different structures */ /* * set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_OPEN; op->state = GLOBUS_XIO_OP_STATE_OPERATING; op->_op_handle = handle; op->ndx = 0; op->ref = 1; op->_op_cb = globus_l_xio_blocking_cb; op->user_arg = info; op->entry[0].prev_ndx = -1; /* for first pass there is no return */ op->blocking = GLOBUS_TRUE; GlobusXIOCurrentBlockedThread(op->blocked_thread); /* initialize the handle */ handle->ref++; /* for operation */ GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_xio_open] :: handle ref at %d.\n"), handle->ref)); /* this is set for the cancel */ handle->open_op = op; if(attr != NULL) { op->user_open_cred = attr->user_open_cred; space = attr->space; /* set entries in structures */ for(ctr = 0; ctr < context->stack_size; ctr++) { op->entry[ctr].open_attr = NULL; GlobusIXIOAttrGetDS( driver_attr, attr, context->entry[ctr].driver); if(driver_attr != NULL) { context->entry[ctr].driver->attr_copy_func( &op->entry[ctr].open_attr, driver_attr); } } } /* initialize the context */ handle->space = space; globus_callback_space_reference(space); res = globus_l_xio_register_open(op, contact_string); if(res != GLOBUS_SUCCESS) { goto register_err; } globus_mutex_lock(&info->mutex); { while(!info->done) { globus_cond_wait(&info->cond, &info->mutex); } } globus_mutex_unlock(&info->mutex); res = GlobusXIOObjToResult(info->error_obj); globus_i_xio_blocking_destroy(info); if(res != GLOBUS_SUCCESS) { goto register_err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; /* * error handling */ op_alloc_error: globus_i_xio_blocking_destroy(info); register_err: param_err: GlobusXIODebugExitWithError(); return res; } /* * read */ globus_result_t globus_xio_read( globus_xio_handle_t user_handle, globus_byte_t * buffer, globus_size_t buffer_length, globus_size_t waitforbytes, globus_size_t * nbytes, globus_xio_data_descriptor_t data_desc) { globus_i_xio_op_t * op; globus_result_t res; globus_i_xio_handle_t * handle; int ref = 0; globus_i_xio_blocking_t * info; globus_bool_t destroy_op = GLOBUS_FALSE; globus_bool_t destroy_handle = GLOBUS_FALSE; GlobusXIOName(globus_xio_read); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); handle = user_handle; /* error echecking */ if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto param_error; } if(buffer == NULL) { res = GlobusXIOErrorParameter("buffer"); goto param_error; } if(buffer_length < 0) { res = GlobusXIOErrorParameter("buffer_length"); goto param_error; } if(nbytes != NULL) { *nbytes = 0; } op = data_desc; if(op == NULL) { GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { destroy_op = GLOBUS_TRUE; res = GlobusXIOErrorMemory("operation"); goto param_error; } ref = 1; op->ref = 0; } info = globus_i_xio_blocking_alloc(); if(info == NULL) { res = GlobusXIOErrorMemory("internal structure"); goto alloc_error; } /* set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_READ; op->state = GLOBUS_XIO_OP_STATE_OPERATING; GlobusXIOOpInc(op); op->entry[0].prev_ndx = -1; op->_op_handle = handle; op->_op_context = handle->context; op->_op_data_cb = globus_l_xio_blocking_data_cb; op->_op_iovec_cb = NULL; op->_op_mem_iovec.iov_base = buffer; op->_op_mem_iovec.iov_len = buffer_length; op->_op_iovec_count = 1; op->_op_iovec = &op->_op_mem_iovec; op->_op_wait_for = waitforbytes; op->user_arg = info; op->blocking = GLOBUS_TRUE; GlobusXIOCurrentBlockedThread(op->blocked_thread); info->op = op; res = globus_l_xio_register_readv(op, ref); if(res != GLOBUS_SUCCESS) { goto register_error; } globus_mutex_lock(&info->mutex); { while(!info->done) { globus_cond_wait(&info->cond, &info->mutex); } } globus_mutex_unlock(&info->mutex); if(nbytes != NULL) { *nbytes = info->nbytes; } res = GlobusXIOObjToResult(info->error_obj); globus_i_xio_blocking_destroy(info); if(res != GLOBUS_SUCCESS) { goto alloc_error; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; register_error: globus_i_xio_blocking_destroy(info); alloc_error: /* desroy op */ if(destroy_op) { globus_i_xio_op_destroy(op, &destroy_handle); } param_error: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_readv( globus_xio_handle_t user_handle, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t waitforbytes, globus_size_t * nbytes, globus_xio_data_descriptor_t data_desc) { globus_i_xio_op_t * op; globus_result_t res; globus_i_xio_handle_t * handle; int ref = 0; globus_i_xio_blocking_t * info; globus_bool_t destroy_op = GLOBUS_FALSE; globus_bool_t destroy_handle = GLOBUS_FALSE; GlobusXIOName(globus_xio_readv); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); handle = user_handle; /* error echecking */ if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto param_error; } if(iovec == NULL) { res = GlobusXIOErrorParameter("iovec"); goto param_error; } if(iovec_count <= 0) { res = GlobusXIOErrorParameter("iovec_count"); goto param_error; } if(nbytes != NULL) { *nbytes = 0; } op = data_desc; if(op == NULL) { GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { destroy_op = GLOBUS_TRUE; res = GlobusXIOErrorMemory("operation"); goto param_error; } ref = 1; op->ref = 0; } info = globus_i_xio_blocking_alloc(); if(info == NULL) { res = GlobusXIOErrorMemory("internal structure"); goto alloc_error; } /* set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_READ; op->state = GLOBUS_XIO_OP_STATE_OPERATING; GlobusXIOOpInc(op); op->entry[0].prev_ndx = -1; op->_op_handle = handle; op->_op_context = handle->context; op->_op_data_cb = NULL; op->_op_iovec_cb = globus_l_xio_blocking_iov_cb; op->_op_iovec = iovec; op->_op_iovec_count = iovec_count; op->_op_wait_for = waitforbytes; op->user_arg = info; op->blocking = GLOBUS_TRUE; GlobusXIOCurrentBlockedThread(op->blocked_thread); info->op = op; res = globus_l_xio_register_readv(op, ref); if(res != GLOBUS_SUCCESS) { goto register_error; } globus_mutex_lock(&info->mutex); { while(!info->done) { globus_cond_wait(&info->cond, &info->mutex); } } globus_mutex_unlock(&info->mutex); if(nbytes != NULL) { *nbytes = info->nbytes; } res = GlobusXIOObjToResult(info->error_obj); globus_i_xio_blocking_destroy(info); if(res != GLOBUS_SUCCESS) { goto alloc_error; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; register_error: globus_i_xio_blocking_destroy(info); alloc_error: /* desroy op */ if(destroy_op) { globus_i_xio_op_destroy(op, &destroy_handle); } param_error: GlobusXIODebugExitWithError(); return res; } /* * writes */ globus_result_t globus_xio_write( globus_xio_handle_t user_handle, globus_byte_t * buffer, globus_size_t buffer_length, globus_size_t waitforbytes, globus_size_t * nbytes, globus_xio_data_descriptor_t data_desc) { globus_i_xio_op_t * op; globus_result_t res; globus_i_xio_handle_t * handle; int ref = 0; globus_i_xio_blocking_t * info; globus_bool_t destroy_op = GLOBUS_FALSE; globus_bool_t destroy_handle = GLOBUS_FALSE; GlobusXIOName(globus_xio_write); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); handle = user_handle; /* error echecking */ if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto param_error; } if(buffer == NULL) { res = GlobusXIOErrorParameter("buffer"); goto param_error; } if(buffer_length < 0) { res = GlobusXIOErrorParameter("buffer_length"); goto param_error; } if(nbytes != NULL) { *nbytes = 0; } op = data_desc; if(op == NULL) { GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { destroy_op = GLOBUS_TRUE; res = GlobusXIOErrorMemory("operation"); goto param_error; } ref = 1; op->ref = 0; } info = globus_i_xio_blocking_alloc(); if(info == NULL) { res = GlobusXIOErrorMemory("internal structure"); goto alloc_error; } /* set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_WRITE; op->state = GLOBUS_XIO_OP_STATE_OPERATING; GlobusXIOOpInc(op); op->entry[0].prev_ndx = -1; op->_op_handle = handle; op->_op_context = handle->context; op->_op_data_cb = globus_l_xio_blocking_data_cb; op->_op_iovec_cb = NULL; op->_op_mem_iovec.iov_base = buffer; op->_op_mem_iovec.iov_len = buffer_length; op->_op_iovec_count = 1; op->_op_iovec = &op->_op_mem_iovec; op->_op_wait_for = waitforbytes; op->user_arg = info; op->blocking = GLOBUS_TRUE; GlobusXIOCurrentBlockedThread(op->blocked_thread); info->op = op; res = globus_l_xio_register_writev(op, ref); if(res != GLOBUS_SUCCESS) { goto register_error; } globus_mutex_lock(&info->mutex); { while(!info->done) { globus_cond_wait(&info->cond, &info->mutex); } } globus_mutex_unlock(&info->mutex); if(nbytes != NULL) { *nbytes = info->nbytes; } res = GlobusXIOObjToResult(info->error_obj); globus_i_xio_blocking_destroy(info); if(res != GLOBUS_SUCCESS) { goto alloc_error; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; register_error: globus_i_xio_blocking_destroy(info); alloc_error: /* desroy op */ if(destroy_op) { globus_i_xio_op_destroy(op, &destroy_handle); } param_error: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_writev( globus_xio_handle_t user_handle, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t waitforbytes, globus_size_t * nbytes, globus_xio_data_descriptor_t data_desc) { globus_bool_t destroy_op = GLOBUS_FALSE; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_i_xio_op_t * op; globus_result_t res; globus_i_xio_handle_t * handle; int ref = 0; globus_i_xio_blocking_t * info; GlobusXIOName(globus_xio_writev); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); handle = user_handle; /* error echecking */ if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto param_error; } if(iovec == NULL) { res = GlobusXIOErrorParameter("iovec"); goto param_error; } if(iovec_count <= 0) { res = GlobusXIOErrorParameter("iovec_count"); goto param_error; } if(nbytes != NULL) { *nbytes = 0; } op = data_desc; if(op == NULL) { GlobusXIOOperationCreate(op, handle->context); if(op == NULL) { destroy_op = GLOBUS_TRUE; res = GlobusXIOErrorMemory("operation"); goto param_error; } ref = 1; op->ref = 0; } info = globus_i_xio_blocking_alloc(); if(info == NULL) { res = GlobusXIOErrorMemory("internal structure"); goto alloc_error; } /* set up the operation */ op->type = GLOBUS_XIO_OPERATION_TYPE_WRITE; op->state = GLOBUS_XIO_OP_STATE_OPERATING; GlobusXIOOpInc(op); op->entry[0].prev_ndx = -1; op->_op_handle = handle; op->_op_context = handle->context; op->_op_data_cb = NULL; op->_op_iovec_cb = globus_l_xio_blocking_iov_cb; op->_op_iovec = iovec; op->_op_iovec_count = iovec_count; op->_op_wait_for = waitforbytes; op->user_arg = info; op->blocking = GLOBUS_TRUE; GlobusXIOCurrentBlockedThread(op->blocked_thread); info->op = op; res = globus_l_xio_register_writev(op, ref); if(res != GLOBUS_SUCCESS) { goto register_error; } globus_mutex_lock(&info->mutex); { while(!info->done) { globus_cond_wait(&info->cond, &info->mutex); } } globus_mutex_unlock(&info->mutex); if(nbytes != NULL) { *nbytes = info->nbytes; } res = GlobusXIOObjToResult(info->error_obj); globus_i_xio_blocking_destroy(info); if(res != GLOBUS_SUCCESS) { goto alloc_error; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; register_error: globus_i_xio_blocking_destroy(info); alloc_error: /* desroy op */ if(destroy_op) { globus_i_xio_op_destroy(op, &destroy_handle); } param_error: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_close( globus_xio_handle_t handle, globus_xio_attr_t attr) { globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_blocking_t * info; globus_bool_t pass = GLOBUS_TRUE; globus_bool_t destroy_handle = GLOBUS_FALSE; int ctr; GlobusXIOName(globus_xio_close); GlobusXIODebugEnter(); GlobusLXIOActiveTest(); /* error echecking */ if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto param_error; } info = globus_i_xio_blocking_alloc(); if(info == NULL) { res = GlobusXIOErrorMemory("internal structure"); goto alloc_error; } globus_mutex_lock(&handle->context->mutex); { if(handle->sd_monitor != NULL) { res = GlobusXIOErrorUnloaded(); } else if(handle->state == GLOBUS_XIO_HANDLE_STATE_CLIENT || handle->state == GLOBUS_XIO_HANDLE_STATE_ACCEPTED || handle->state == GLOBUS_XIO_HANDLE_STATE_OPENING_FAILED || handle->state == GLOBUS_XIO_HANDLE_STATE_OPEN_FAILED) { /* we avoid the oneshot and blocking call by handling these cases * now. Since the stack was never successfully opened, we don't * need to pass close */ if(handle->state == GLOBUS_XIO_HANDLE_STATE_ACCEPTED) { /* do need to destroy the accepted links, though */ for(ctr = 0; ctr < handle->context->stack_size; ctr++) { if(handle->context->entry[ctr].driver_handle && handle->context->entry[ctr].driver->link_destroy_func) { handle->context->entry[ctr].driver->link_destroy_func( handle->context->entry[ctr].driver_handle); } } } GlobusXIOHandleStateChange(handle, GLOBUS_XIO_HANDLE_STATE_CLOSED); destroy_handle = GLOBUS_TRUE; pass = GLOBUS_FALSE; } else { res = globus_l_xio_handle_pre_close( handle, attr, globus_l_xio_blocking_cb, info, GLOBUS_TRUE); if(handle->state == GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING) { pass = GLOBUS_FALSE; } } } globus_mutex_unlock(&handle->context->mutex); if(res != GLOBUS_SUCCESS) { goto register_error; } if(pass) { res = globus_l_xio_register_close(handle->close_op); if(res != GLOBUS_SUCCESS) { goto register_error; } } if(destroy_handle) { globus_i_xio_handle_dec(handle, &destroy_handle); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } } else { globus_mutex_lock(&info->mutex); { while(!info->done) { globus_cond_wait(&info->cond, &info->mutex); } } globus_mutex_unlock(&info->mutex); res = GlobusXIOObjToResult(info->error_obj); } globus_i_xio_blocking_destroy(info); if(res != GLOBUS_SUCCESS) { goto alloc_error; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; register_error: globus_i_xio_blocking_destroy(info); /* desroy op */ alloc_error: param_error: GlobusXIODebugExitWithError(); return res; } void globus_l_xio_handle_create_from_url_init() { globus_hashtable_init( &xio_l_scheme_drv_tbl, 256, globus_hashtable_string_hash, globus_hashtable_string_keyeq); } void globus_l_xio_handle_create_from_url_cleanup() { globus_hashtable_destroy_all( &xio_l_scheme_drv_tbl, globus_l_xio_handle_create_from_url_drv_unload); } void globus_l_xio_handle_create_from_url_drv_unload( void * datum) { globus_l_xio_parsed_driver_t * ent; ent = (globus_l_xio_parsed_driver_t *) datum; globus_xio_driver_unload(ent->driver); free(ent); } globus_result_t globus_xio_handle_create_from_url( globus_xio_handle_t * out_h, const char * in_scheme, globus_xio_attr_t attr, char * param_string) { globus_url_t url; globus_result_t res; globus_xio_stack_t stack; int i; int j; char * scheme; globus_l_xio_parsed_driver_t * ent; globus_list_t * proto_list = NULL; int list_size; char * list_string; char * driver_opts; int driver_match; res = globus_url_parse( in_scheme, &url); if(res != GLOBUS_SUCCESS) { scheme = strdup(in_scheme); } else { scheme = strdup(url.scheme); globus_url_destroy(&url); } res = globus_xio_stack_init( &stack, NULL); if(res != GLOBUS_SUCCESS) { goto error_stack; } for(i = 0; xio_l_scheme[i].prt_name != NULL; i++) { if(strcmp(xio_l_scheme[i].prt_name, scheme) == 0) { for(j = 0; xio_l_scheme[i].driver_list[j] != NULL; j++) { ent = (globus_l_xio_parsed_driver_t * )globus_hashtable_lookup( &xio_l_scheme_drv_tbl, (void *)xio_l_scheme[i].driver_list[j]); if(ent == NULL) { ent = (globus_l_xio_parsed_driver_t *) globus_malloc(sizeof(globus_l_xio_parsed_driver_t)); ent->driver_name = strdup(xio_l_scheme[i].driver_list[j]); ent->res = globus_xio_driver_load( xio_l_scheme[i].driver_list[j], &ent->driver); globus_hashtable_insert( &xio_l_scheme_drv_tbl, (void *)xio_l_scheme[i].driver_list[j], (void *)ent); } globus_assert(ent != NULL); if(ent->res != GLOBUS_SUCCESS) { goto error_lookup; } if(param_string != NULL) { proto_list = globus_list_from_string( param_string, ',', NULL); list_size = globus_list_size(proto_list); while(list_size > 0) { list_string = (char *)globus_list_remove( &proto_list, proto_list); driver_opts = strstr(list_string, ":") + 1; /* check if the driver name matches the param string */ driver_match = strncmp( list_string, ent->driver_name, strlen(ent->driver_name)); if(attr != NULL && driver_opts != NULL && driver_match == 0) { res = globus_xio_attr_cntl( attr, ent->driver, GLOBUS_XIO_SET_STRING_OPTIONS, driver_opts); } free((void *)list_string); if(res != GLOBUS_SUCCESS) { goto error_attr_cntl; } list_size--; } } res = globus_xio_stack_push_driver( stack, ent->driver); if(res != GLOBUS_SUCCESS) { goto error_push; } } } } res = globus_xio_handle_create(out_h, stack); if(res != GLOBUS_SUCCESS) { goto error_destroy_handle; } globus_xio_stack_destroy(stack); free(scheme); return GLOBUS_SUCCESS; error_destroy_handle: error_push: error_attr_cntl: if(proto_list != NULL) { while(globus_list_size(proto_list) > 0) { free(globus_list_remove(&proto_list, proto_list)); } } error_lookup: globus_xio_stack_destroy(stack); error_stack: free(scheme); return res; } globus_xio-3.6/globus_xio_load.h0000666000076400007640000001027610405464614014025 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_XIO_LOAD_INCLUDE #define GLOBUS_XIO_LOAD_INCLUDE #include "globus_xio_types.h" #include "globus_common.h" EXTERN_C_BEGIN extern globus_extension_registry_t globus_i_xio_driver_registry; #define GLOBUS_XIO_DRIVER_REGISTRY &globus_i_xio_driver_registry typedef globus_result_t (*globus_xio_driver_init_t)( globus_xio_driver_t * out_driver); typedef void (*globus_xio_driver_destroy_t)( globus_xio_driver_t driver); typedef struct { const char * name; globus_xio_driver_init_t init; globus_xio_driver_destroy_t destroy; } globus_xio_driver_hook_t; globus_result_t globus_xio_driver_load( const char * driver_name, globus_xio_driver_t * out_driver); globus_result_t globus_xio_driver_unload( globus_xio_driver_t driver); /** * GlobusXIODefineDriver( * label driver_name, * globus_xio_driver_init_t init_func, * globus_xio_driver_destroy_t destroy_func) * * NOTE: driver_name is not a string. Just put the unquoted name there. * This needs to precede use of GlobusXIO{Un}RegisterDriver() */ #define GlobusXIODefineDriver(driver_name, init_func, destroy_func) \ globus_xio_driver_hook_t globus_i_xio_##driver_name##_hook = \ { \ #driver_name, \ init_func, \ destroy_func, \ } #define GlobusXIODeclareDriver(driver_name) \ extern globus_xio_driver_hook_t globus_i_xio_##driver_name##_hook #define GlobusXIOMyDriver(driver_name) \ &globus_i_xio_##driver_name##_hook /** * The following are just utility macros for extensions that contain only one * driver. If your extension contains multiple drivers, you'll need to * define your own extension module and register all the drivers in that * module's activate function manually */ #define GlobusXIORegisterDriver(driver_name) \ globus_extension_registry_add( \ GLOBUS_XIO_DRIVER_REGISTRY, \ (void *)#driver_name, \ GlobusXIOMyModule(driver_name), \ GlobusXIOMyDriver(driver_name)) #define GlobusXIOUnRegisterDriver(driver_name) \ globus_extension_registry_remove( \ GLOBUS_XIO_DRIVER_REGISTRY, \ (void*)#driver_name) #define GlobusXIODefineModule(driver_name) \ GlobusExtensionDefineModule(globus_xio_##driver_name##_driver) #define GlobusXIODeclareModule(driver_name) \ GlobusExtensionDeclareModule(globus_xio_##driver_name##_driver) #define GlobusXIOMyModule(driver_name) \ GlobusExtensionMyModule(globus_xio_##driver_name##_driver) #define GlobusXIOExtensionName(driver_name) \ "globus_xio_" #driver_name "_driver" #define GLOBUS_XIO_EXTENSION_FORMAT "globus_xio_%s_driver" /* internal activate funcs */ int globus_i_xio_load_init(void); int globus_i_xio_load_destroy(void); EXTERN_C_END #endif globus_xio-3.6/globus_i_xio_win32_file.c0000666000076400007640000010657211374254655015367 00000000000000/* * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ #include "globus_config.h" #ifdef TARGET_ARCH_WIN32 #include "globus_i_xio_win32.h" /** * Design notes: * * problem: from xio's perspective, all threads have unknown lifetime. io * requests can not be bound to the lifetime of the requesting thread. * if i start async io on one and the thread terminates before that io * completes, it will be canceled by win32. * * solutions: in order of ease. * * 1) * always block the request thread and do the operation there-- usually fast, * sometimes network files will stall app for up to 30 seconds. * * 2) * dispatch all io to separate worker thread- io can never be unexpectedly * canceled, so it's most reliable, but always pay double context switch * perf hit -- especially painful for small buffer (less than 512) writes * (which should only happen in test suites or conversations, in which the * round trip time will trump context switch time) * * 3) * add a thread-hold to globus' win32 thread lib to prevent thread from * terminating while io is pending on it, but this only protects against * globus threads terminating (which means all of our apps will be fine) If * win32 developers use globus libs and create their own win32 threads * directly and terminate them before io completes, it will be canceled. * this may be ok, since most people that would create own thread will keep * them around until io is complete anyway. this has almost as good perf as * blocking would in its best case and will never stall the app. * * * This implementation is based on #2 * NOTE: cancelation of file i/o will not be supported at this time because * CancelIo does not discriminate between read or write operations. * * Blocking io of overlapped handles is implemented by queuing asynchronous * operations on the request thread. * This means that user APCs may also be run. */ /* assume 10ms slices, try for up to 5s since the system may be thrashing */ #define LOCKED_PAGES_RETRY_COUNT 500 #define GlobusOffToOverlapped(overlapped, off) \ { \ LARGE_INTEGER x; \ x.QuadPart = off; \ overlapped.Offset = x.LowPart; \ overlapped.OffsetHigh = x.HighPart; \ } typedef struct { OVERLAPPED overlapped; /* must be first */ globus_bool_t pending; /* io apc pending (does not track user apc) */ globus_bool_t apc_pending; globus_xio_operation_t op; globus_off_t offset; globus_size_t waitforbytes; globus_xio_iovec_t * iov; int iovc; struct iovec * start_iov; int start_iovc; globus_object_t * error; globus_size_t nbytes; globus_xio_system_data_callback_t callback; void * user_arg; /* reference to containing handle, here to avoid goofy pointer math */ struct globus_l_xio_win32_file_s * handle; } globus_l_xio_win32_file_op_t; typedef struct globus_l_xio_win32_file_s { win32_mutex_t lock; HANDLE fd; globus_bool_t is_overlapped; globus_l_xio_win32_file_op_t read_op; globus_l_xio_win32_file_op_t write_op; } globus_l_xio_win32_file_t; static HANDLE globus_l_xio_win32_file_thread_handle; static globus_bool_t globus_l_xio_win32_activated; static LARGE_INTEGER globus_l_xio_win32_file_zero_offset; static unsigned __stdcall globus_l_xio_win32_file_thread( void * arg); static void CALLBACK globus_l_xio_win32_file_deactivate_apc( ULONG_PTR arg); int globus_i_xio_win32_file_activate(void) { GlobusXIOName(globus_i_xio_win32_file_activate); GlobusXIOSystemDebugEnter(); globus_l_xio_win32_file_thread_handle = (HANDLE) _beginthreadex( 0, 0, globus_l_xio_win32_file_thread, 0, 0, 0); if(globus_l_xio_win32_file_thread_handle == 0) { goto error_thread; } globus_l_xio_win32_activated = GLOBUS_TRUE; GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_thread: GlobusXIOSystemDebugExitWithError(); return GLOBUS_FAILURE; } int globus_i_xio_win32_file_deactivate(void) { GlobusXIOName(globus_i_xio_win32_file_deactivate); GlobusXIOSystemDebugEnter(); globus_l_xio_win32_activated = GLOBUS_FALSE; QueueUserAPC( globus_l_xio_win32_file_deactivate_apc, globus_l_xio_win32_file_thread_handle, 0); while(WaitForSingleObject( globus_l_xio_win32_file_thread_handle, INFINITE) != WAIT_OBJECT_0) { /* XXX error */ } CloseHandle(globus_l_xio_win32_file_thread_handle); GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; } static unsigned __stdcall globus_l_xio_win32_file_thread( void * arg) { GlobusXIOName(globus_l_xio_win32_file_thread); GlobusXIOSystemDebugEnter(); while(globus_l_xio_win32_activated) { SleepEx(INFINITE, GLOBUS_TRUE); /* the APCs below execute here */ } GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; } static void globus_l_xio_win32_file_kickout( void * user_arg) { globus_l_xio_win32_file_op_t * op; HANDLE fd; struct iovec * start_iov; int start_iovc; globus_object_t * error; globus_size_t nbytes; globus_xio_system_data_callback_t callback; GlobusXIOName(globus_l_xio_win32_file_kickout); op = (globus_l_xio_win32_file_op_t *) user_arg; fd = op->handle->fd; GlobusXIOSystemDebugEnterFD(fd); start_iov = op->start_iov; start_iovc = op->start_iovc; error = op->error; nbytes = op->nbytes; callback = op->callback; user_arg = op->user_arg; win32_mutex_lock(&op->handle->lock); { op->pending = GLOBUS_FALSE; } win32_mutex_unlock(&op->handle->lock); callback( error ? globus_error_put(error) : GLOBUS_SUCCESS, nbytes, user_arg); GlobusIXIOSystemFreeIovec(start_iovc, start_iov); GlobusXIOSystemDebugExitFD(fd); } static void CALLBACK globus_l_xio_win32_file_deactivate_apc( ULONG_PTR arg) { GlobusXIOName(globus_l_xio_win32_file_deactivate_apc); GlobusXIOSystemDebugEnter(); /* do nothing, this just forces SleepEx to awaken */ GlobusXIOSystemDebugExit(); } static void CALLBACK globus_l_xio_win32_file_start_read_apc( ULONG_PTR arg); static void CALLBACK globus_l_xio_win32_file_start_write_apc( ULONG_PTR arg); static void CALLBACK globus_l_xio_win32_file_read_apc( DWORD error, DWORD nbytes, LPOVERLAPPED overlapped) { globus_l_xio_win32_file_op_t * op; HANDLE fd; globus_result_t result; GlobusXIOName(globus_l_xio_win32_file_read_apc); op = (globus_l_xio_win32_file_op_t *) overlapped; fd = op->handle->fd; GlobusXIOSystemDebugEnterFD(fd); if(op->op != 0) { globus_xio_operation_refresh_timeout(op->op); } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Read %ld bytes\n", _xio_name, (long)nbytes)); GlobusXIOSystemDebugRawBuffer(nbytes, op->iov->iov_base); op->nbytes += nbytes; op->offset += nbytes; GlobusIXIOUtilAdjustIovec(op->iov, op->iovc, nbytes); op->apc_pending = GLOBUS_FALSE; if(error == ERROR_SUCCESS && op->nbytes < op->waitforbytes) { if(op->iovc > 0) { /* start next read. * this could result in this function being reentered on error * not a problem, though. */ globus_l_xio_win32_file_start_read_apc((ULONG_PTR)op); goto reading_more; } else { op->error = GlobusXIOErrorObjParameter("waitforbytes"); } } else if(error == ERROR_HANDLE_EOF) { op->error = GlobusXIOErrorObjEOF(); } else if(error != ERROR_SUCCESS) { op->error = GlobusXIOErrorObjSystemError("ReadFileEx", error); } if(op->op != 0) { result = globus_i_xio_win32_complete( globus_l_xio_win32_file_kickout, op); /* really cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } } reading_more: GlobusXIOSystemDebugExitFD(fd); } static void CALLBACK globus_l_xio_win32_file_write_apc( DWORD error, DWORD nbytes, LPOVERLAPPED overlapped) { globus_l_xio_win32_file_op_t * op; HANDLE fd; globus_result_t result; GlobusXIOName(globus_l_xio_win32_file_write_apc); op = (globus_l_xio_win32_file_op_t *) overlapped; fd = op->handle->fd; GlobusXIOSystemDebugEnterFD(fd); if(op->op != 0) { globus_xio_operation_refresh_timeout(op->op); } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Wrote %ld bytes\n", _xio_name, (long)nbytes)); GlobusXIOSystemDebugRawBuffer(nbytes, op->iov->iov_base); op->nbytes += nbytes; op->offset += nbytes; GlobusIXIOUtilAdjustIovec(op->iov, op->iovc, nbytes); op->apc_pending = GLOBUS_FALSE; if(error == ERROR_SUCCESS && op->nbytes < op->waitforbytes) { if(op->iovc > 0) { /* start next write. * this could result in this function being reentered on error * not a problem, though. */ globus_l_xio_win32_file_start_write_apc((ULONG_PTR)op); goto writing_more; } else { op->error = GlobusXIOErrorObjParameter("waitforbytes"); } } else if(error != ERROR_SUCCESS) { op->error = GlobusXIOErrorObjSystemError("WriteFileEx", error); } if(op->op != 0) { result = globus_i_xio_win32_complete( globus_l_xio_win32_file_kickout, op); /* really cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } } writing_more: GlobusXIOSystemDebugExitFD(fd); } static void CALLBACK globus_l_xio_win32_file_start_read_apc( ULONG_PTR arg) { globus_l_xio_win32_file_op_t * op; HANDLE fd; int retry = LOCKED_PAGES_RETRY_COUNT; int error; GlobusXIOName(globus_l_xio_win32_file_start_read_apc); op = (globus_l_xio_win32_file_op_t *) arg; fd = op->handle->fd; GlobusXIOSystemDebugEnterFD(fd); op->apc_pending = GLOBUS_TRUE; do { error = ERROR_SUCCESS; memset(&op->overlapped, 0, sizeof(OVERLAPPED)); GlobusOffToOverlapped(op->overlapped, op->offset); if(!ReadFileEx(fd, op->iov->iov_base, op->iov->iov_len, &op->overlapped, globus_l_xio_win32_file_read_apc)) { error = GetLastError(); } /* if the following is true, we sleep for the rest of this timeslice * and try again. This happens when there are too many outstanding * asynchronous operations and the os cant lock down any more pages */ } while((error == ERROR_INVALID_USER_BUFFER || error == ERROR_NOT_ENOUGH_MEMORY) && retry-- > 0 && (Sleep(0), 1)); if(retry < LOCKED_PAGES_RETRY_COUNT) { GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] fd=%lu, Retried read %d times\n", _xio_name, (unsigned long)fd, LOCKED_PAGES_RETRY_COUNT - (retry > 0 ? retry : 0))); } if(error != ERROR_SUCCESS) { globus_l_xio_win32_file_read_apc(error, 0, &op->overlapped); } GlobusXIOSystemDebugExitFD(fd); } static void CALLBACK globus_l_xio_win32_file_start_write_apc( ULONG_PTR arg) { globus_l_xio_win32_file_op_t * op; HANDLE fd; int retry = LOCKED_PAGES_RETRY_COUNT; int error; GlobusXIOName(globus_l_xio_win32_file_start_write_apc); op = (globus_l_xio_win32_file_op_t *) arg; fd = op->handle->fd; GlobusXIOSystemDebugEnterFD(fd); op->apc_pending = GLOBUS_TRUE; do { error = ERROR_SUCCESS; memset(&op->overlapped, 0, sizeof(OVERLAPPED)); GlobusOffToOverlapped(op->overlapped, op->offset); if(!WriteFileEx(fd, op->iov->iov_base, op->iov->iov_len, &op->overlapped, globus_l_xio_win32_file_write_apc)) { error = GetLastError(); } /* if the following is true, we sleep for the rest of this timeslice * and try again. This happens when there are too many outstanding * asynchronous operations and the os cant lock down any more pages */ } while((error == ERROR_INVALID_USER_BUFFER || error == ERROR_NOT_ENOUGH_MEMORY) && retry-- > 0 && (Sleep(0), 1)); if(retry < LOCKED_PAGES_RETRY_COUNT) { GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] fd=%lu, Retried write %d times\n", _xio_name, (unsigned long)fd, LOCKED_PAGES_RETRY_COUNT - (retry > 0 ? retry : 0))); } if(error != ERROR_SUCCESS) { globus_l_xio_win32_file_write_apc(error, 0, &op->overlapped); } GlobusXIOSystemDebugExitFD(fd); } globus_result_t globus_xio_system_file_init( globus_xio_system_file_handle_t * uhandle, globus_xio_system_file_t fd) { globus_result_t result; globus_l_xio_win32_file_t * handle; GlobusXIOName(globus_xio_system_file_init); GlobusXIOSystemDebugEnterFD(fd); handle = (globus_l_xio_win32_file_t *) globus_calloc(1, sizeof(globus_l_xio_win32_file_t)); if(!handle) { result = GlobusXIOErrorMemory("handle"); goto error_alloc; } win32_mutex_init(&handle->lock, 0); handle->fd = fd; handle->read_op.handle = handle; handle->write_op.handle = handle; handle->is_overlapped = globus_i_xio_win32_mode_is_overlapped(fd); if(!handle->is_overlapped) { GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] fd=%lu, Handle is NOT overlapped\n", _xio_name, (unsigned long)fd)); } *uhandle = handle; GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_alloc: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } void globus_xio_system_file_destroy( globus_xio_system_file_handle_t handle) { GlobusXIOName(globus_xio_system_file_destroy); GlobusXIOSystemDebugEnterFD(handle->fd); win32_mutex_destroy(&handle->lock); GlobusXIOSystemDebugExitFD(handle->fd); globus_free(handle); } /* called only on non-overlapped handles */ static void globus_l_xio_win32_file_blocking_read( globus_l_xio_win32_file_op_t * op) { DWORD nbytes; HANDLE fd = op->handle->fd; int error; int rc; GlobusXIOName(globus_l_xio_win32_file_blocking_read); GlobusXIOSystemDebugEnterFD(fd); do { if(op->nbytes < op->waitforbytes && op->iovc <= 0) { op->error = GlobusXIOErrorObjParameter("waitforbytes"); goto error_param; } memset(&op->overlapped, 0, sizeof(OVERLAPPED)); GlobusOffToOverlapped(op->overlapped, op->offset); rc = ReadFile(fd, op->iov->iov_base, op->iov->iov_len, &nbytes, &op->overlapped); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Read %ld bytes\n", _xio_name, (long)nbytes)); GlobusXIOSystemDebugRawBuffer(nbytes, op->iov->iov_base); op->nbytes += nbytes; op->offset += nbytes; GlobusIXIOUtilAdjustIovec(op->iov, op->iovc, nbytes); if(!rc || nbytes == 0) { error = GetLastError(); if(rc && nbytes == 0 || error == ERROR_HANDLE_EOF) { op->error = GlobusXIOErrorObjEOF(); } else { op->error = GlobusXIOErrorObjSystemError("ReadFile", error); } goto error_read; } } while(op->nbytes < op->waitforbytes); GlobusXIOSystemDebugExitFD(fd); return; error_read: error_param: GlobusXIOSystemDebugExitWithErrorFD(fd); } /* called only on non-overlapped handles */ static void globus_l_xio_win32_file_blocking_write( globus_l_xio_win32_file_op_t * op) { DWORD nbytes; HANDLE fd = op->handle->fd; int rc; GlobusXIOName(globus_l_xio_win32_file_blocking_write); GlobusXIOSystemDebugEnterFD(fd); do { if(op->nbytes < op->waitforbytes && op->iovc <= 0) { op->error = GlobusXIOErrorObjParameter("waitforbytes"); goto error_param; } memset(&op->overlapped, 0, sizeof(OVERLAPPED)); GlobusOffToOverlapped(op->overlapped, op->offset); rc = WriteFile(fd, op->iov->iov_base, op->iov->iov_len, &nbytes, &op->overlapped); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Wrote %ld bytes\n", _xio_name, (long)nbytes)); GlobusXIOSystemDebugRawBuffer(nbytes, op->iov->iov_base); op->nbytes += nbytes; op->offset += nbytes; GlobusIXIOUtilAdjustIovec(op->iov, op->iovc, nbytes); if(!rc) { op->error = GlobusXIOErrorObjSystemError( "WriteFile", GetLastError()); goto error_write; } } while(op->nbytes < op->waitforbytes); GlobusXIOSystemDebugExitFD(fd); return; error_write: error_param: GlobusXIOSystemDebugExitWithErrorFD(fd); } /* if op == null, just set up the operation... internal use only */ globus_result_t globus_xio_system_file_register_read( globus_xio_operation_t op, globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, globus_xio_system_data_callback_t callback, void * user_arg) { globus_result_t result; HANDLE fd = handle->fd; globus_xio_iovec_t * iov; GlobusXIOName(globus_xio_system_file_register_read); GlobusXIOSystemDebugEnterFD(fd); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Waiting for %ld bytes\n", _xio_name, (long) waitforbytes)); win32_mutex_lock(&handle->lock); { if(handle->read_op.pending) { result = GlobusXIOErrorAlreadyRegistered(); goto error_already_registered; } handle->read_op.pending = GLOBUS_TRUE; } win32_mutex_unlock(&handle->lock); GlobusIXIOSystemAllocIovec(u_iovc, iov); if(!iov) { result = GlobusXIOErrorMemory("iov"); goto error_iovec; } GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc); handle->read_op.start_iov = iov; handle->read_op.start_iovc = u_iovc; handle->read_op.iov = iov; handle->read_op.iovc = u_iovc; handle->read_op.op = op; handle->read_op.offset = offset; handle->read_op.waitforbytes = waitforbytes; handle->read_op.callback = callback; handle->read_op.user_arg = user_arg; handle->read_op.error = 0; handle->read_op.nbytes = 0; if(op != 0) { if(!handle->is_overlapped || waitforbytes == 0) { if(waitforbytes > 0) { globus_l_xio_win32_file_blocking_read(&handle->read_op); } /* else complete immediately, simulated select() */ result = globus_callback_register_oneshot( 0, 0, globus_l_xio_win32_file_kickout, &handle->read_op); /* may have read data above, cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } } else { if(!QueueUserAPC( globus_l_xio_win32_file_start_read_apc, globus_l_xio_win32_file_thread_handle, (ULONG_PTR)&handle->read_op)) { result = GlobusXIOErrorSystemError( "QueueUserAPC", ERROR_NOT_ENOUGH_MEMORY); goto error_register; } } } /* handle could be destroyed by time we get here - no touch! */ GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeIovec(u_iovc, iov); error_iovec: win32_mutex_lock(&handle->lock); handle->read_op.pending = GLOBUS_FALSE; error_already_registered: win32_mutex_unlock(&handle->lock); GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } /* if op == null, just set up the operation... internal use only */ globus_result_t globus_xio_system_file_register_write( globus_xio_operation_t op, globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, globus_xio_system_data_callback_t callback, void * user_arg) { globus_result_t result; HANDLE fd = handle->fd; globus_xio_iovec_t * iov; GlobusXIOName(globus_xio_system_file_register_write); GlobusXIOSystemDebugEnterFD(fd); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Waiting for %ld bytes\n", _xio_name, (long) waitforbytes)); win32_mutex_lock(&handle->lock); { if(handle->write_op.pending) { result = GlobusXIOErrorAlreadyRegistered(); goto error_already_registered; } handle->write_op.pending = GLOBUS_TRUE; } win32_mutex_unlock(&handle->lock); GlobusIXIOSystemAllocIovec(u_iovc, iov); if(!iov) { result = GlobusXIOErrorMemory("iov"); goto error_iovec; } GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc); handle->write_op.start_iov = iov; handle->write_op.start_iovc = u_iovc; handle->write_op.iov = iov; handle->write_op.iovc = u_iovc; handle->write_op.op = op; handle->write_op.offset = offset; handle->write_op.waitforbytes = waitforbytes; handle->write_op.callback = callback; handle->write_op.user_arg = user_arg; handle->write_op.error = 0; handle->write_op.nbytes = 0; if(op != 0) { if(!handle->is_overlapped || waitforbytes == 0) { if(waitforbytes > 0) { globus_l_xio_win32_file_blocking_write(&handle->write_op); } /* else complete immediately, simulated select() */ result = globus_callback_register_oneshot( 0, 0, globus_l_xio_win32_file_kickout, &handle->write_op); /* may have read data above, cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } } else { if(!QueueUserAPC( globus_l_xio_win32_file_start_write_apc, globus_l_xio_win32_file_thread_handle, (ULONG_PTR)&handle->write_op)) { result = GlobusXIOErrorSystemError( "QueueUserAPC", ERROR_NOT_ENOUGH_MEMORY); goto error_register; } } } /* handle could be destroyed by time we get here - no touch! */ GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeIovec(u_iovc, iov); error_iovec: win32_mutex_lock(&handle->lock); handle->write_op.pending = GLOBUS_FALSE; error_already_registered: win32_mutex_unlock(&handle->lock); GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } /* always blocks (even on waitforbytes == 0) */ globus_result_t globus_xio_system_file_read( globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, globus_size_t * nbytes) { globus_result_t result; GlobusXIOName(globus_xio_system_file_read); GlobusXIOSystemDebugEnterFD(handle->fd); /* set up read_op */ result = globus_xio_system_file_register_read( 0, handle, offset, iov, iovc, waitforbytes, 0, 0); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_file_register_read", result); goto error_setup; } if(handle->is_overlapped) { globus_l_xio_win32_file_start_read_apc((ULONG_PTR)&handle->read_op); while(handle->read_op.apc_pending) { SleepEx(INFINITE, GLOBUS_TRUE); /* drive APCs */ } } else { globus_l_xio_win32_file_blocking_read(&handle->read_op); } if(handle->read_op.error) { result = globus_error_put(handle->read_op.error); } GlobusIXIOSystemFreeIovec( handle->read_op.start_iovc, handle->read_op.start_iov); *nbytes = handle->read_op.nbytes; win32_mutex_lock(&handle->lock); { handle->read_op.pending = GLOBUS_FALSE; } win32_mutex_unlock(&handle->lock); GlobusXIOSystemDebugExitFD(handle->fd); return result; error_setup: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(handle->fd); return result; } /* always blocks (even on waitforbytes == 0) */ globus_result_t globus_xio_system_file_write( globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, globus_size_t * nbytes) { globus_result_t result; GlobusXIOName(globus_xio_system_file_write); GlobusXIOSystemDebugEnterFD(handle->fd); /* set up write_op */ result = globus_xio_system_file_register_write( 0, handle, offset, iov, iovc, waitforbytes, 0, 0); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_file_register_write", result); goto error_setup; } if(handle->is_overlapped) { globus_l_xio_win32_file_start_write_apc((ULONG_PTR)&handle->write_op); while(handle->write_op.apc_pending) { SleepEx(INFINITE, GLOBUS_TRUE); /* drive APCs */ } } else { globus_l_xio_win32_file_blocking_write(&handle->write_op); } if(handle->write_op.error) { result = globus_error_put(handle->write_op.error); } GlobusIXIOSystemFreeIovec( handle->write_op.start_iovc, handle->write_op.start_iov); *nbytes = handle->write_op.nbytes; win32_mutex_lock(&handle->lock); { handle->write_op.pending = GLOBUS_FALSE; } win32_mutex_unlock(&handle->lock); GlobusXIOSystemDebugExitFD(handle->fd); return result; error_setup: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(handle->fd); return result; } globus_off_t globus_xio_system_file_get_position( globus_xio_system_file_t fd) { LARGE_INTEGER offset; GlobusXIOName(globus_xio_system_file_get_position); GlobusXIOSystemDebugEnterFD(fd); /* ignore errors, may be a pipe or other unseekable */ if(!SetFilePointerEx( fd, globus_l_xio_win32_file_zero_offset, &offset, FILE_CURRENT)) { offset = globus_l_xio_win32_file_zero_offset; } GlobusXIOSystemDebugExitFD(fd); return offset.QuadPart; } globus_off_t globus_xio_system_file_get_size( globus_xio_system_file_t fd) { LARGE_INTEGER size; GlobusXIOName(globus_xio_system_file_get_size); GlobusXIOSystemDebugEnterFD(fd); if(!GetFileSizeEx(fd, &size)) { size.QuadPart = -1; } GlobusXIOSystemDebugExitFD(fd); return size.QuadPart; } globus_xio_system_file_t globus_xio_system_convert_stdio( const char * stdio) { HANDLE fd = 0; if(strcmp(stdio, "stdin") == 0) { fd = GetStdHandle(STD_INPUT_HANDLE); } else if(strcmp(stdio, "stdout") == 0) { fd = GetStdHandle(STD_OUTPUT_HANDLE); } else if(strcmp(stdio, "stderr") == 0) { fd = GetStdHandle(STD_ERROR_HANDLE); } if(fd == 0) /* GetStdHandle() can also return 0 */ { fd = GLOBUS_XIO_SYSTEM_INVALID_FILE; } return fd; } globus_result_t globus_xio_system_file_truncate( globus_xio_system_file_t fd, globus_off_t osize) { globus_result_t result; LARGE_INTEGER offset; LARGE_INTEGER size; GlobusXIOName(globus_xio_system_file_truncate); GlobusXIOSystemDebugEnterFD(fd); size.QuadPart = osize; /* save file position and move to new size */ if(!SetFilePointerEx( fd, globus_l_xio_win32_file_zero_offset, &offset, FILE_CURRENT) || !SetFilePointerEx(fd, size, 0, FILE_BEGIN)) { result = GlobusXIOErrorSystemError("SetFilePointerEx", GetLastError()); goto error_seek; } if(!SetEndOfFile(fd)) { result = GlobusXIOErrorSystemError("SetEndOfFile", GetLastError()); goto error_truncate; } /* restore file pointer */ SetFilePointerEx(fd, offset, 0, FILE_BEGIN); GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_truncate: SetFilePointerEx(fd, offset, 0, FILE_BEGIN); error_seek: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_xio_system_file_open( globus_xio_system_file_t * fd, const char * filename, int flags, unsigned long mode) { globus_result_t result; SECURITY_ATTRIBUTES sec_attr; DWORD access; DWORD create_mode; DWORD file_attr; GlobusXIOName(globus_xio_system_file_open); *fd = INVALID_HANDLE_VALUE; GlobusXIOSystemDebugEnter(); access = flags & (O_RDONLY|O_WRONLY|O_RDWR); if(access == O_WRONLY) { access = flags & O_APPEND ? FILE_APPEND_DATA|SYNCHRONIZE : FILE_GENERIC_WRITE; } else if(access == O_RDWR) { access = flags & O_APPEND ? FILE_APPEND_DATA|FILE_GENERIC_READ : FILE_GENERIC_READ|FILE_GENERIC_WRITE; } else { access = flags & O_APPEND ? FILE_APPEND_DATA|FILE_GENERIC_READ : FILE_GENERIC_READ; } switch(flags & (O_CREAT|O_EXCL|O_TRUNC)) { case O_CREAT: create_mode = OPEN_ALWAYS; break; case O_CREAT|O_EXCL: case O_CREAT|O_EXCL|O_TRUNC: create_mode = CREATE_NEW; break; case O_TRUNC: case O_TRUNC|O_EXCL: /* ignore O_EXCL on missing O_CREAT */ create_mode = TRUNCATE_EXISTING; break; case O_CREAT|O_TRUNC: create_mode = CREATE_ALWAYS; break; default: create_mode = OPEN_EXISTING; break; } /* not supporting readonly at the moment */ file_attr = FILE_ATTRIBUTE_NORMAL; file_attr |= FILE_FLAG_OVERLAPPED; /* handles created by me are not inherited on exec */ sec_attr.nLength = sizeof(sec_attr); sec_attr.lpSecurityDescriptor = 0; sec_attr.bInheritHandle = FALSE; *fd = CreateFile( filename, access, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, &sec_attr, create_mode, file_attr, 0); if(*fd == INVALID_HANDLE_VALUE) { result = GlobusXIOErrorSystemError("CreateFile", GetLastError()); goto error_open; } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] Opened file, %s fd=%d\n", _xio_name, filename, *fd)); GlobusXIOSystemDebugExitFD(*fd); return GLOBUS_SUCCESS; error_open: GlobusXIOSystemDebugExitWithErrorFD(*fd); return result; } globus_result_t globus_xio_system_file_close( globus_xio_system_file_t fd) { globus_result_t result; GlobusXIOName(globus_xio_system_file_close); GlobusXIOSystemDebugEnterFD(fd); if(!CloseHandle(fd)) { result = GlobusXIOErrorSystemError("CloseHandle", GetLastError()); goto error_close; } GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_close: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } #endif /* TARGET_ARCH_WIN32 */ globus_xio-3.6/version.h.in0000666000076400007640000000135610363625117012745 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ static globus_version_t local_version = { @GPT_MAJOR_VERSION@, @GPT_MINOR_VERSION@, @DIRT_TIMESTAMP@, @DIRT_BRANCH_ID@ }; globus_xio-3.6/globus_xio_system_select.c0000666000076400007640000022523711374254655016001 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "config.h" #include "globus_common.h" #ifndef TARGET_ARCH_WIN32 #include "globus_xio_system.h" #include "globus_i_xio_system_common.h" #include "globus_xio_driver.h" #include #include #ifdef HAVE_SYSCONF #define GLOBUS_L_OPEN_MAX sysconf(_SC_OPEN_MAX) #else #define GLOBUS_L_OPEN_MAX 256 #endif typedef struct globus_l_xio_system_s { globus_xio_system_type_t type; int fd; globus_mutex_t lock; /* only used to protect below */ globus_off_t file_position; } globus_l_xio_system_t; static int globus_l_xio_system_activate(void); static int globus_l_xio_system_deactivate(void); #include "version.h" globus_module_descriptor_t globus_i_xio_system_module = { "globus_xio_system_select", globus_l_xio_system_activate, globus_l_xio_system_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; static globus_cond_t globus_l_xio_system_cond; static globus_mutex_t globus_l_xio_system_fdset_mutex; static globus_mutex_t globus_l_xio_system_cancel_mutex; static globus_bool_t globus_l_xio_system_select_active; static globus_bool_t globus_l_xio_system_wakeup_pending; static globus_bool_t globus_l_xio_system_shutdown_called; static int globus_l_xio_system_highest_fd; static int globus_l_xio_system_max_fds; static int globus_l_xio_system_fd_allocsize; static fd_set * globus_l_xio_system_read_fds; static fd_set * globus_l_xio_system_write_fds; static fd_set * globus_l_xio_system_ready_reads; static fd_set * globus_l_xio_system_ready_writes; static globus_list_t * globus_l_xio_system_canceled_reads; static globus_list_t * globus_l_xio_system_canceled_writes; static globus_i_xio_system_op_info_t ** globus_l_xio_system_read_operations; static globus_i_xio_system_op_info_t ** globus_l_xio_system_write_operations; #ifndef TARGET_ARCH_NETOS /* Net+OS does not support pipes. It might better to wrap code related to this * with a HAVE_PIPE define... */ static int globus_l_xio_system_wakeup_pipe[2]; #endif static globus_callback_handle_t globus_l_xio_system_poll_handle; /* In the pre-activation of the thread module, we * are setting up some code to block the SIGPIPE * signal. This is necessary because some of * the TCP protocols we are using do not have * a mode in which we can safely detect a remotely- * closing socket. */ static void globus_l_xio_system_poll( void * user_args); static void globus_l_xio_system_kickout( void * user_arg); static void globus_l_xio_system_select_wakeup(void); static void globus_l_xio_system_unregister_read( int fd); static void globus_l_xio_system_unregister_write( int fd); static int globus_l_xio_system_add_nonblocking( globus_l_xio_system_t * handle); static int globus_l_xio_system_remove_nonblocking( globus_l_xio_system_t * handle); static globus_result_t globus_l_xio_system_try_read( globus_l_xio_system_t * handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, int flags, globus_sockaddr_t * from, globus_size_t * nbytes); static globus_result_t globus_l_xio_system_try_write( globus_l_xio_system_t * handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, int flags, globus_sockaddr_t * to, globus_size_t * nbytes); static globus_result_t globus_l_xio_system_close( int fd); static void globus_l_xio_system_wakeup_handler( void * user_arg) { int rc; char byte; GlobusXIOName(globus_l_xio_system_wakeup_handler); GlobusXIOSystemDebugEnter(); #ifndef TARGET_ARCH_NETOS if(!globus_l_xio_system_shutdown_called) { byte = 0; do { rc = write( globus_l_xio_system_wakeup_pipe[1], &byte, sizeof(byte)); } while(rc < 0 && errno == EINTR); } #endif GlobusXIOSystemDebugExit(); } static int globus_l_xio_system_activate(void) { int i; char * block; globus_result_t result; globus_reltime_t period; GlobusXIOName(globus_l_xio_system_activate); if(globus_i_xio_system_common_activate() != GLOBUS_SUCCESS) { goto error_activate; } GlobusXIOSystemDebugEnter(); globus_cond_init(&globus_l_xio_system_cond, GLOBUS_NULL); globus_mutex_init(&globus_l_xio_system_fdset_mutex, GLOBUS_NULL); globus_mutex_init(&globus_l_xio_system_cancel_mutex, GLOBUS_NULL); globus_l_xio_system_select_active = GLOBUS_FALSE; globus_l_xio_system_wakeup_pending = GLOBUS_FALSE; globus_l_xio_system_shutdown_called = GLOBUS_FALSE; /* * On some machines (SGI Irix at least), the fd_set structure isn't * necessarily large enough to hold the maximum number of open file * descriptors. This ensures that it will be. */ globus_l_xio_system_max_fds = GLOBUS_L_OPEN_MAX; globus_l_xio_system_fd_allocsize = sizeof(fd_set); if(globus_l_xio_system_fd_allocsize * 8 < globus_l_xio_system_max_fds) { /* Conservatively round up to 64 bits */ globus_l_xio_system_fd_allocsize = ((globus_l_xio_system_max_fds + 63) & ~63) / 8; } i = globus_l_xio_system_fd_allocsize; block = (char *) globus_calloc(4, i); if(!block) { goto error_fdsets; } globus_l_xio_system_read_fds = (fd_set *) block; globus_l_xio_system_write_fds = (fd_set *) (block + i * 1); globus_l_xio_system_ready_reads = (fd_set *) (block + i * 2); globus_l_xio_system_ready_writes = (fd_set *) (block + i * 3); globus_l_xio_system_canceled_reads = GLOBUS_NULL; globus_l_xio_system_canceled_writes = GLOBUS_NULL; globus_l_xio_system_read_operations = (globus_i_xio_system_op_info_t **) globus_calloc( globus_l_xio_system_max_fds * 2, sizeof(globus_i_xio_system_op_info_t *)); if(!globus_l_xio_system_read_operations) { goto error_operations; } globus_l_xio_system_write_operations = globus_l_xio_system_read_operations + globus_l_xio_system_max_fds; #ifndef TARGET_ARCH_NETOS /* * Create a pipe to myself, so that I can wake up the thread that is * blocked on a select(). */ if(pipe(globus_l_xio_system_wakeup_pipe) != 0) { goto error_pipe; } fcntl(globus_l_xio_system_wakeup_pipe[0], F_SETFD, FD_CLOEXEC); fcntl(globus_l_xio_system_wakeup_pipe[1], F_SETFD, FD_CLOEXEC); globus_l_xio_system_highest_fd = globus_l_xio_system_wakeup_pipe[0]; FD_SET(globus_l_xio_system_wakeup_pipe[0], globus_l_xio_system_read_fds); #endif GlobusTimeReltimeSet(period, 0, 0); result = globus_callback_register_periodic( &globus_l_xio_system_poll_handle, GLOBUS_NULL, &period, globus_l_xio_system_poll, GLOBUS_NULL); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_callback_register_periodic", result); goto error_register; } globus_callback_add_wakeup_handler( globus_l_xio_system_wakeup_handler, GLOBUS_NULL); GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_register: #ifndef TARGET_ARCH_NETOS globus_l_xio_system_close(globus_l_xio_system_wakeup_pipe[0]); globus_l_xio_system_close(globus_l_xio_system_wakeup_pipe[1]); #endif error_pipe: globus_free(globus_l_xio_system_read_operations); error_operations: globus_free(globus_l_xio_system_read_fds); error_fdsets: globus_mutex_destroy(&globus_l_xio_system_cancel_mutex); globus_mutex_destroy(&globus_l_xio_system_fdset_mutex); globus_cond_destroy(&globus_l_xio_system_cond); GlobusXIOSystemDebugExitWithError(); globus_i_xio_system_common_deactivate(); error_activate: return GLOBUS_FAILURE; } static void globus_l_xio_system_unregister_periodic_cb( void * user_args) { globus_bool_t * signaled; GlobusXIOName(globus_l_xio_system_unregister_periodic_cb); GlobusXIOSystemDebugEnter(); signaled = (globus_bool_t *) user_args; globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { *signaled = GLOBUS_TRUE; globus_cond_signal(&globus_l_xio_system_cond); } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); GlobusXIOSystemDebugExit(); } static int globus_l_xio_system_deactivate(void) { GlobusXIOName(globus_l_xio_system_deactivate); GlobusXIOSystemDebugEnter(); globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { globus_bool_t signaled; globus_l_xio_system_shutdown_called = GLOBUS_TRUE; signaled = GLOBUS_FALSE; globus_callback_unregister( globus_l_xio_system_poll_handle, globus_l_xio_system_unregister_periodic_cb, &signaled, GLOBUS_NULL); globus_l_xio_system_wakeup_pending = GLOBUS_TRUE; globus_l_xio_system_select_wakeup(); while(!signaled) { globus_cond_wait( &globus_l_xio_system_cond, &globus_l_xio_system_fdset_mutex); } } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); #ifndef TARGET_ARCH_NETOS globus_l_xio_system_close(globus_l_xio_system_wakeup_pipe[0]); globus_l_xio_system_close(globus_l_xio_system_wakeup_pipe[1]); #endif globus_list_free(globus_l_xio_system_canceled_reads); globus_list_free(globus_l_xio_system_canceled_writes); globus_free(globus_l_xio_system_read_operations); globus_free(globus_l_xio_system_read_fds); globus_mutex_destroy(&globus_l_xio_system_cancel_mutex); globus_mutex_destroy(&globus_l_xio_system_fdset_mutex); globus_cond_destroy(&globus_l_xio_system_cond); GlobusXIOSystemDebugExit(); globus_i_xio_system_common_deactivate(); return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_system_handle_init( globus_l_xio_system_t ** u_handle, int fd, globus_xio_system_type_t type) { globus_l_xio_system_t * handle; int rc; globus_result_t result; GlobusXIOName(globus_l_xio_system_handle_init); GlobusXIOSystemDebugEnterFD(fd); handle = (globus_l_xio_system_t *) globus_malloc(sizeof(globus_l_xio_system_t)); if(!handle) { result = GlobusXIOErrorMemory("handle"); goto error_alloc; } handle->type = type; handle->fd = fd; handle->file_position = globus_xio_system_file_get_position(fd); rc = globus_l_xio_system_add_nonblocking(handle); if(rc < 0) { result = GlobusXIOErrorSystemError("fcntl", errno); goto error_fcntl; } globus_mutex_init(&handle->lock, NULL); *u_handle = handle; GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_fcntl: globus_free(handle); error_alloc: *u_handle = GLOBUS_NULL; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_xio_system_file_init( globus_xio_system_file_handle_t * u_handle, globus_xio_system_file_t fd) { return globus_l_xio_system_handle_init( u_handle, fd, GLOBUS_XIO_SYSTEM_FILE); } globus_result_t globus_xio_system_socket_init( globus_xio_system_socket_handle_t * u_handle, globus_xio_system_socket_t fd, globus_xio_system_type_t type) { return globus_l_xio_system_handle_init(u_handle, fd, type); } static void globus_l_xio_system_handle_destroy( globus_l_xio_system_t * handle) { int fd = handle->fd; GlobusXIOName(globus_l_xio_system_handle_destroy); GlobusXIOSystemDebugEnterFD(fd); globus_l_xio_system_remove_nonblocking(handle); globus_free(handle); GlobusXIOSystemDebugExitFD(fd); } void globus_xio_system_file_destroy( globus_xio_system_file_handle_t handle) { globus_l_xio_system_handle_destroy(handle); } void globus_xio_system_socket_destroy( globus_xio_system_socket_handle_t handle) { globus_l_xio_system_handle_destroy(handle); } static void globus_l_xio_system_cancel_cb( globus_xio_operation_t op, void * user_arg, globus_xio_error_type_t reason) { globus_i_xio_system_op_info_t * op_info; GlobusXIOName(globus_l_xio_system_cancel_cb); GlobusXIOSystemDebugEnter(); op_info = (globus_i_xio_system_op_info_t *) user_arg; globus_mutex_lock(&globus_l_xio_system_cancel_mutex); { if(op_info->state != GLOBUS_I_XIO_SYSTEM_OP_COMPLETE && op_info->state != GLOBUS_I_XIO_SYSTEM_OP_CANCELED) { op_info->error = reason == GLOBUS_XIO_ERROR_TIMEOUT ? GlobusXIOErrorObjTimeout() : GlobusXIOErrorObjCanceled(); globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { globus_bool_t pend; if(op_info->state == GLOBUS_I_XIO_SYSTEM_OP_NEW) { op_info->state = GLOBUS_I_XIO_SYSTEM_OP_CANCELED; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] fd=%d, Canceling NEW\n"), _xio_name, op_info->handle->fd)); } else { if(globus_l_xio_system_select_active) { op_info->state = GLOBUS_I_XIO_SYSTEM_OP_CANCELED; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] fd=%d, Canceling Active\n"), _xio_name, op_info->handle->fd)); /* pend the cancel for after select wakes up */ if(!globus_l_xio_system_wakeup_pending) { globus_l_xio_system_wakeup_pending = GLOBUS_TRUE; globus_l_xio_system_select_wakeup(); } pend = GLOBUS_TRUE; } else { globus_result_t result; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] fd=%d, Canceling Pending\n"), _xio_name, op_info->handle->fd)); /* unregister and kickout now */ result = globus_callback_register_oneshot( GLOBUS_NULL, GLOBUS_NULL, globus_l_xio_system_kickout, op_info); /* really cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } pend = GLOBUS_FALSE; } /* I can access op_info even though I oneshoted above * because the CancelDisallow() call in the kickout will * block until I leave this function */ if(op_info->type == GLOBUS_I_XIO_SYSTEM_OP_READ || op_info->type == GLOBUS_I_XIO_SYSTEM_OP_ACCEPT) { if(pend) { globus_list_insert( &globus_l_xio_system_canceled_reads, (void *) op_info->handle->fd); } else { globus_l_xio_system_unregister_read( op_info->handle->fd); } } else { if(pend) { globus_list_insert( &globus_l_xio_system_canceled_writes, (void *) op_info->handle->fd); } else { globus_l_xio_system_unregister_write( op_info->handle->fd); } } } } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); } } globus_mutex_unlock(&globus_l_xio_system_cancel_mutex); GlobusXIOSystemDebugExit(); } static globus_result_t globus_l_xio_system_register_read_fd( int fd, globus_i_xio_system_op_info_t * read_info) { globus_result_t result; globus_bool_t do_wakeup = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_system_register_read_fd); GlobusXIOSystemDebugEnterFD(fd); /* I have to do this outside the lock because of lock inversion issues */ if(globus_xio_operation_enable_cancel( read_info->op, globus_l_xio_system_cancel_cb, read_info)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { /* this really shouldnt be possible, but to be thorough ... */ if(read_info->state == GLOBUS_I_XIO_SYSTEM_OP_CANCELED) { result = globus_error_put(read_info->error); goto error_canceled; } if(globus_l_xio_system_shutdown_called) { result = GlobusXIOErrorNotActivated(); goto error_deactivated; } if(fd >= globus_l_xio_system_max_fds) { result = GlobusXIOErrorSystemResource(_XIOSL("too many fds")); goto error_too_many_fds; } if(FD_ISSET(fd, globus_l_xio_system_read_fds)) { result = GlobusXIOErrorAlreadyRegistered(); goto error_already_registered; } if(fd > globus_l_xio_system_highest_fd) { globus_l_xio_system_highest_fd = fd; } FD_SET(fd, globus_l_xio_system_read_fds); globus_l_xio_system_read_operations[fd] = read_info; if(globus_l_xio_system_select_active && !globus_l_xio_system_wakeup_pending) { globus_l_xio_system_wakeup_pending = GLOBUS_TRUE; do_wakeup = GLOBUS_TRUE; } read_info->state = GLOBUS_I_XIO_SYSTEM_OP_PENDING; } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); if(do_wakeup) { /* I do this outside the lock because the select thread is likely * to wakeup immediately which would mean immediate contention for * that lock */ globus_l_xio_system_select_wakeup(); } GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_already_registered: error_too_many_fds: error_deactivated: error_canceled: read_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); globus_xio_operation_disable_cancel(read_info->op); error_cancel_enable: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } static globus_result_t globus_l_xio_system_register_write_fd( int fd, globus_i_xio_system_op_info_t * write_info) { globus_result_t result; globus_bool_t do_wakeup = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_system_register_write_fd); GlobusXIOSystemDebugEnterFD(fd); /* I have to do this outside the lock because of lock inversion issues */ if(globus_xio_operation_enable_cancel( write_info->op, globus_l_xio_system_cancel_cb, write_info)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { /* this really shouldnt be possible, but to be thorough ... */ if(write_info->state == GLOBUS_I_XIO_SYSTEM_OP_CANCELED) { result = globus_error_put(write_info->error); goto error_canceled; } if(globus_l_xio_system_shutdown_called) { result = GlobusXIOErrorNotActivated(); goto error_deactivated; } if(fd >= globus_l_xio_system_max_fds) { result = GlobusXIOErrorSystemResource(_XIOSL("too many fds")); goto error_too_many_fds; } if(FD_ISSET(fd, globus_l_xio_system_write_fds)) { result = GlobusXIOErrorAlreadyRegistered(); goto error_already_registered; } if(fd > globus_l_xio_system_highest_fd) { globus_l_xio_system_highest_fd = fd; } FD_SET(fd, globus_l_xio_system_write_fds); globus_l_xio_system_write_operations[fd] = write_info; if(globus_l_xio_system_select_active && !globus_l_xio_system_wakeup_pending) { globus_l_xio_system_wakeup_pending = GLOBUS_TRUE; do_wakeup = GLOBUS_TRUE; } write_info->state = GLOBUS_I_XIO_SYSTEM_OP_PENDING; } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); if(do_wakeup) { /* I do this outside the lock because the select thread is likely * to wakeup immediately which would mean immediate contention for * that lock */ globus_l_xio_system_select_wakeup(); } GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_already_registered: error_too_many_fds: error_deactivated: error_canceled: write_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); globus_xio_operation_disable_cancel(write_info->op); error_cancel_enable: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } /* called locked */ static void globus_l_xio_system_unregister_read( int fd) { GlobusXIOName(globus_l_xio_system_unregister_read); GlobusXIOSystemDebugEnterFD(fd); globus_assert(FD_ISSET(fd, globus_l_xio_system_read_fds)); FD_CLR(fd, globus_l_xio_system_read_fds); globus_l_xio_system_read_operations[fd] = GLOBUS_NULL; GlobusXIOSystemDebugExitFD(fd); } /* called locked */ static void globus_l_xio_system_unregister_write( int fd) { GlobusXIOName(globus_l_xio_system_unregister_write); GlobusXIOSystemDebugEnterFD(fd); globus_assert(FD_ISSET(fd, globus_l_xio_system_write_fds)); FD_CLR(fd, globus_l_xio_system_write_fds); globus_l_xio_system_write_operations[fd] = GLOBUS_NULL; GlobusXIOSystemDebugExitFD(fd); } static int globus_l_xio_system_add_nonblocking( globus_l_xio_system_t * handle) { int flags; int rc; #ifdef TARGET_ARCH_NETOS if (handle->type != GLOBUS_XIO_SYSTEM_FILE) { int trueval = 1; rc = setsockopt( handle->fd, SOL_SOCKET, SO_NONBLOCK, (void *) trueval, sizeof(trueval)); } else #endif { flags = fcntl(handle->fd, F_GETFL); if(flags < 0) { rc = flags; } else { flags |= O_NONBLOCK; rc = fcntl(handle->fd, F_SETFL, flags); } } GlobusXIOSystemUpdateErrno(); return rc; } static int globus_l_xio_system_remove_nonblocking( globus_l_xio_system_t * handle) { int flags; int rc; #ifdef TARGET_ARCH_NETOS if (handle->type != GLOBUS_XIO_SYSTEM_FILE) { int falseval = 0; rc = setsockopt( handle->fd, SOL_SOCKET, SO_NONBLOCK, (void *) falseval, sizeof(falseval)); } else #endif { flags = fcntl(handle->fd, F_GETFL); if(flags < 0) { rc = flags; } else { flags &= ~O_NONBLOCK; rc = fcntl(handle->fd, F_SETFL, flags); } } GlobusXIOSystemUpdateErrno(); return rc; } static void globus_l_xio_system_kickout( void * user_arg) { globus_i_xio_system_op_info_t * op_info; int fd; GlobusXIOName(globus_l_xio_system_kickout); op_info = (globus_i_xio_system_op_info_t *) user_arg; fd = op_info->handle->fd; GlobusXIOSystemDebugEnterFD(fd); globus_xio_operation_disable_cancel(op_info->op); switch(op_info->type) { case GLOBUS_I_XIO_SYSTEM_OP_CONNECT: case GLOBUS_I_XIO_SYSTEM_OP_ACCEPT: op_info->sop.non_data.callback( op_info->error ? globus_error_put(op_info->error) : GLOBUS_SUCCESS, op_info->user_arg); break; default: op_info->sop.data.callback( op_info->error ? globus_error_put(op_info->error) : GLOBUS_SUCCESS, op_info->nbytes, op_info->user_arg); GlobusIXIOSystemFreeIovec( op_info->sop.data.start_iovc, op_info->sop.data.start_iov); break; } GlobusXIOSystemDebugExitFD(fd); GlobusIXIOSystemFreeOperation(op_info); } static void globus_l_xio_system_select_wakeup(void) { globus_ssize_t rc; char byte; GlobusXIOName(globus_l_xio_system_select_wakeup); GlobusXIOSystemDebugEnter(); byte = 0; #ifndef TARGET_ARCH_NETOS do { rc = write(globus_l_xio_system_wakeup_pipe[1], &byte, sizeof(byte)); } while(rc < 0 && errno == EINTR); if(rc <= 0) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, GlobusXIOErrorSystemError("write", errno), _XIOSL("[%s:%d] Couldn't wakeup select"), _xio_name, __LINE__); } #endif GlobusXIOSystemDebugExit(); } static void globus_l_xio_system_handle_wakeup(void) { char buf[64]; globus_ssize_t done; GlobusXIOName(globus_l_xio_system_handle_wakeup); GlobusXIOSystemDebugEnter(); #ifndef TARGET_ARCH_NETOS do { done = read(globus_l_xio_system_wakeup_pipe[0], buf, sizeof(buf)); } while(done < 0 && errno == EINTR); #endif GlobusXIOSystemDebugExit(); } static globus_bool_t globus_l_xio_system_handle_read( int fd) { globus_bool_t handled_it; globus_i_xio_system_op_info_t * read_info; globus_size_t nbytes; globus_result_t result; GlobusXIOName(globus_l_xio_system_handle_read); GlobusXIOSystemDebugEnterFD(fd); handled_it = GLOBUS_FALSE; read_info = globus_l_xio_system_read_operations[fd]; result = GLOBUS_SUCCESS; globus_xio_operation_refresh_timeout(read_info->op); if(read_info->state == GLOBUS_I_XIO_SYSTEM_OP_CANCELED) { /* error already set on info */ goto error_canceled; } switch(read_info->type) { case GLOBUS_I_XIO_SYSTEM_OP_ACCEPT: { int new_fd; do { new_fd = accept(fd, GLOBUS_NULL, GLOBUS_NULL); GlobusXIOSystemUpdateErrno(); } while(new_fd < 0 && errno == EINTR); if(new_fd < 0) { if(errno != ECONNABORTED && errno != EAGAIN && errno != EWOULDBLOCK) { result = GlobusXIOErrorSystemError("accept", errno); } } else { int rc; globus_l_xio_system_t tmp_handle; *read_info->sop.non_data.out_fd = new_fd; tmp_handle.fd = new_fd; tmp_handle.type = GLOBUS_XIO_SYSTEM_TCP; rc = globus_l_xio_system_remove_nonblocking(&tmp_handle); read_info->nbytes++; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] Accepted new connection, fd=%d\n"), _xio_name, new_fd)); } } break; case GLOBUS_I_XIO_SYSTEM_OP_READ: result = globus_l_xio_system_try_read( read_info->handle, read_info->offset, read_info->sop.data.iov, read_info->sop.data.iovc, read_info->sop.data.flags, read_info->sop.data.addr, &nbytes); if(result == GLOBUS_SUCCESS) { read_info->nbytes += nbytes; read_info->offset += nbytes; GlobusIXIOUtilAdjustIovec( read_info->sop.data.iov, read_info->sop.data.iovc, nbytes); } break; default: globus_assert(0 && "Unexpected type for read operation"); return GLOBUS_FALSE; break; } if(result != GLOBUS_SUCCESS) { read_info->error = globus_error_get(result); } /* always true for accept operations */ if(read_info->nbytes >= read_info->waitforbytes || result != GLOBUS_SUCCESS) { error_canceled: handled_it = GLOBUS_TRUE; read_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { globus_l_xio_system_unregister_read(fd); } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); result = globus_callback_register_oneshot( GLOBUS_NULL, GLOBUS_NULL, globus_l_xio_system_kickout, read_info); /* really cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } } GlobusXIOSystemDebugExitFD(fd); return handled_it; } static globus_bool_t globus_l_xio_system_handle_write( int fd) { globus_bool_t handled_it; globus_i_xio_system_op_info_t * write_info; globus_size_t nbytes; globus_result_t result; GlobusXIOName(globus_l_xio_system_handle_write); GlobusXIOSystemDebugEnterFD(fd); handled_it = GLOBUS_FALSE; result = GLOBUS_SUCCESS; write_info = globus_l_xio_system_write_operations[fd]; globus_xio_operation_refresh_timeout(write_info->op); if(write_info->state == GLOBUS_I_XIO_SYSTEM_OP_CANCELED) { /* error already set on info */ goto error_canceled; } switch(write_info->type) { case GLOBUS_I_XIO_SYSTEM_OP_CONNECT: { int err; globus_socklen_t errlen; errlen = sizeof(err); if(getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &errlen) < 0) { GlobusXIOSystemUpdateErrno(); err = errno; } if(err) { result = GlobusXIOErrorSystemError("connect", err); } } break; case GLOBUS_I_XIO_SYSTEM_OP_WRITE: result = globus_l_xio_system_try_write( write_info->handle, write_info->offset, write_info->sop.data.iov, write_info->sop.data.iovc, write_info->sop.data.flags, write_info->sop.data.addr, &nbytes); if(result == GLOBUS_SUCCESS) { write_info->nbytes += nbytes; write_info->offset += nbytes; GlobusIXIOUtilAdjustIovec( write_info->sop.data.iov, write_info->sop.data.iovc, nbytes); } break; default: globus_assert(0 && "Unexpected type for write operation"); return GLOBUS_FALSE; break; } if(result != GLOBUS_SUCCESS) { write_info->error = globus_error_get(result); } /* always true for connect operations */ if(write_info->nbytes >= write_info->waitforbytes || result != GLOBUS_SUCCESS) { error_canceled: handled_it = GLOBUS_TRUE; write_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE; globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { globus_l_xio_system_unregister_write(fd); } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); result = globus_callback_register_oneshot( GLOBUS_NULL, GLOBUS_NULL, globus_l_xio_system_kickout, write_info); /* really cant do anything else */ if(result != GLOBUS_SUCCESS) { globus_panic( GLOBUS_XIO_SYSTEM_MODULE, result, _XIOSL("[%s:%d] Couldn't register callback"), _xio_name, __LINE__); } } GlobusXIOSystemDebugExitFD(fd); return handled_it; } /** * one of these fds is bad, lock down the fdset and check them all * --- assumed to be called with cancel lock held after a select */ static void globus_l_xio_system_bad_apple(void) { globus_i_xio_system_op_info_t * op_info; int fd; int rc; struct stat stat_buf; GlobusXIOName(globus_l_xio_system_bad_apple); GlobusXIOSystemDebugEnter(); globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { for(fd = 0; fd <= globus_l_xio_system_highest_fd; fd++) { if(FD_ISSET(fd, globus_l_xio_system_read_fds)) { rc = fstat(fd, &stat_buf); GlobusXIOSystemUpdateErrno(); if(rc < 0 && errno == EBADF) { GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] fd=%d, Canceling read bad apple\n"), _xio_name, fd)); op_info = globus_l_xio_system_read_operations[fd]; if(op_info->state == GLOBUS_I_XIO_SYSTEM_OP_PENDING) { op_info->state = GLOBUS_I_XIO_SYSTEM_OP_CANCELED; op_info->error = GlobusXIOErrorObjParameter("handle"); globus_list_insert( &globus_l_xio_system_canceled_reads, (void *) fd); } } } if(FD_ISSET(fd, globus_l_xio_system_write_fds)) { rc = fstat(fd, &stat_buf); GlobusXIOSystemUpdateErrno(); if(rc < 0 && errno == EBADF) { GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] fd=%d, Canceling write bad apple\n"), _xio_name, fd)); op_info = globus_l_xio_system_write_operations[fd]; if(op_info->state == GLOBUS_I_XIO_SYSTEM_OP_PENDING) { op_info->state = GLOBUS_I_XIO_SYSTEM_OP_CANCELED; op_info->error = GlobusXIOErrorObjParameter("handle"); globus_list_insert( &globus_l_xio_system_canceled_writes, (void *) fd); } } } } } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); GlobusXIOSystemDebugExit(); } static void globus_l_xio_system_poll( void * user_args) { globus_bool_t time_left_is_zero; globus_bool_t handled_something; GlobusXIOName(globus_l_xio_system_poll); GlobusXIOSystemDebugEnter(); handled_something = GLOBUS_FALSE; do { globus_reltime_t time_left; globus_bool_t time_left_is_infinity; int num; int nready; int fd; int save_errno; time_left_is_zero = GLOBUS_FALSE; time_left_is_infinity = GLOBUS_FALSE; globus_callback_get_timeout(&time_left); if(globus_reltime_cmp(&time_left, &globus_i_reltime_zero) == 0) { time_left_is_zero = GLOBUS_TRUE; } else if(globus_time_reltime_is_infinity(&time_left)) { time_left_is_infinity = GLOBUS_TRUE; } globus_mutex_lock(&globus_l_xio_system_fdset_mutex); { memcpy( globus_l_xio_system_ready_reads, globus_l_xio_system_read_fds, globus_l_xio_system_fd_allocsize); memcpy( globus_l_xio_system_ready_writes, globus_l_xio_system_write_fds, globus_l_xio_system_fd_allocsize); num = globus_l_xio_system_highest_fd + 1; globus_l_xio_system_select_active = GLOBUS_TRUE; } globus_mutex_unlock(&globus_l_xio_system_fdset_mutex); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] Before select\n"), _xio_name)); nready = select( num, globus_l_xio_system_ready_reads, globus_l_xio_system_ready_writes, GLOBUS_NULL, (time_left_is_infinity ? GLOBUS_NULL : &time_left)); GlobusXIOSystemUpdateErrno(); save_errno = errno; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] After select\n"), _xio_name)); globus_mutex_lock(&globus_l_xio_system_cancel_mutex); { globus_l_xio_system_select_active = GLOBUS_FALSE; if(nready > 0) { #ifndef TARGET_ARCH_NETOS fd = globus_l_xio_system_wakeup_pipe[0]; if(FD_ISSET(fd, globus_l_xio_system_ready_reads)) { globus_l_xio_system_handle_wakeup(); globus_l_xio_system_wakeup_pending = GLOBUS_FALSE; FD_CLR(fd, globus_l_xio_system_ready_reads); nready--; } #endif } else if(nready == 0) { time_left_is_zero = GLOBUS_TRUE; } else { if(save_errno == EBADF) { globus_l_xio_system_bad_apple(); } /** * can't really do anything about other errors * so, set ready fds to known state in case there are things * to be canceled */ nready = 0; memset( globus_l_xio_system_ready_reads, 0, globus_l_xio_system_fd_allocsize); memset( globus_l_xio_system_ready_writes, 0, globus_l_xio_system_fd_allocsize); } while(!globus_list_empty(globus_l_xio_system_canceled_reads)) { fd = (int) globus_list_remove( &globus_l_xio_system_canceled_reads, globus_l_xio_system_canceled_reads); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] fd=%d, Setting canceled read\n"), _xio_name, fd)); if(!FD_ISSET(fd, globus_l_xio_system_ready_reads)) { FD_SET(fd, globus_l_xio_system_ready_reads); nready++; } } while(!globus_list_empty(globus_l_xio_system_canceled_writes)) { fd = (int) globus_list_remove( &globus_l_xio_system_canceled_writes, globus_l_xio_system_canceled_writes); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, (_XIOSL("[%s] fd=%d, Setting canceled read\n"), _xio_name, fd)); if(!FD_ISSET(fd, globus_l_xio_system_ready_writes)) { FD_SET(fd, globus_l_xio_system_ready_writes); nready++; } } for(fd = 0; nready; fd++) { if(FD_ISSET(fd, globus_l_xio_system_ready_reads)) { nready--; if(globus_l_xio_system_handle_read(fd)) { handled_something = GLOBUS_TRUE; } } if(FD_ISSET(fd, globus_l_xio_system_ready_writes)) { nready--; if(globus_l_xio_system_handle_write(fd)) { handled_something = GLOBUS_TRUE; } } } } globus_mutex_unlock(&globus_l_xio_system_cancel_mutex); } while(!handled_something && !time_left_is_zero && !globus_l_xio_system_shutdown_called); GlobusXIOSystemDebugExit(); } globus_result_t globus_xio_system_socket_register_connect( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, globus_sockaddr_t * addr, globus_xio_system_callback_t callback, void * user_arg) { globus_bool_t done; globus_result_t result; globus_i_xio_system_op_info_t * op_info; int fd = handle->fd; GlobusXIOName(globus_xio_system_socket_register_connect); GlobusXIOSystemDebugEnterFD(fd); done = GLOBUS_FALSE; while(!done && connect( fd, (const struct sockaddr *) addr, GlobusLibcSockaddrLen(addr)) < 0) { GlobusXIOSystemUpdateErrno(); switch(errno) { case EINPROGRESS: done = GLOBUS_TRUE; break; case EINTR: /* retry */ break; case ETIMEDOUT: /* this was in globus io.. not sure why */ globus_thread_yield(); break; default: result = GlobusXIOErrorSystemError("connect", errno); goto error_connect; } } GlobusIXIOSystemAllocOperation(op_info); if(!op_info) { result = GlobusXIOErrorMemory("op_info"); goto error_op_info; } op_info->type = GLOBUS_I_XIO_SYSTEM_OP_CONNECT; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW; op_info->op = op; op_info->handle = handle; op_info->user_arg = user_arg; op_info->sop.non_data.callback = callback; result = globus_l_xio_system_register_write_fd(fd, op_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( _XIOSL("globus_l_xio_system_register_write_fd"), result); goto error_register; } /* handle could be destroyed by time we get here - no touch! */ GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeOperation(op_info); error_op_info: error_connect: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_xio_system_socket_register_accept( globus_xio_operation_t op, globus_xio_system_socket_handle_t listener_handle, globus_xio_system_socket_t * out_fd, globus_xio_system_callback_t callback, void * user_arg) { globus_result_t result; globus_i_xio_system_op_info_t * op_info; int fd = listener_handle->fd; GlobusXIOName(globus_xio_system_socket_register_accept); GlobusXIOSystemDebugEnterFD(fd); GlobusIXIOSystemAllocOperation(op_info); if(!op_info) { result = GlobusXIOErrorMemory("op_info"); goto error_op_info; } op_info->type = GLOBUS_I_XIO_SYSTEM_OP_ACCEPT; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW; op_info->op = op; op_info->handle = listener_handle; op_info->user_arg = user_arg; op_info->sop.non_data.callback = callback; op_info->sop.non_data.out_fd = out_fd; op_info->waitforbytes = 1; result = globus_l_xio_system_register_read_fd(fd, op_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( _XIOSL("globus_l_xio_system_register_read_fd"), result); goto error_register; } /* handle could be destroyed by time we get here - no touch! */ GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeOperation(op_info); error_op_info: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } static globus_result_t globus_l_xio_system_register_read( globus_xio_operation_t op, globus_l_xio_system_t * handle, globus_off_t offset, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * from, globus_xio_system_data_callback_t callback, void * user_arg) { globus_result_t result; globus_i_xio_system_op_info_t * op_info; struct iovec * iov; int fd = handle->fd; GlobusXIOName(globus_l_xio_system_register_read); GlobusXIOSystemDebugEnterFD(fd); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, (_XIOSL("[%s] Waiting for %u bytes\n"), _xio_name, (unsigned) waitforbytes)); GlobusIXIOSystemAllocOperation(op_info); if(!op_info) { result = GlobusXIOErrorMemory("op_info"); goto error_op_info; } GlobusIXIOSystemAllocIovec(u_iovc, iov); if(!iov) { result = GlobusXIOErrorMemory("iov"); goto error_iovec; } GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc); op_info->type = GLOBUS_I_XIO_SYSTEM_OP_READ; op_info->sop.data.start_iov = iov; op_info->sop.data.start_iovc = u_iovc; op_info->sop.data.iov = iov; op_info->sop.data.iovc = u_iovc; op_info->sop.data.addr = from; op_info->sop.data.flags = flags; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW; op_info->op = op; op_info->handle = handle; op_info->user_arg = user_arg; op_info->sop.data.callback = callback; op_info->waitforbytes = waitforbytes; op_info->offset = offset; result = globus_l_xio_system_register_read_fd(fd, op_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_system_register_read_fd", result); goto error_register; } /* handle could be destroyed by time we get here - no touch! */ GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeIovec(u_iovc, iov); error_iovec: GlobusIXIOSystemFreeOperation(op_info); error_op_info: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_xio_system_file_register_read( globus_xio_operation_t op, globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, globus_xio_system_data_callback_t callback, void * user_arg) { return globus_l_xio_system_register_read( op, handle, offset, u_iov, u_iovc, waitforbytes, 0, GLOBUS_NULL, callback, user_arg); } globus_result_t globus_xio_system_socket_register_read( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * from, globus_xio_system_data_callback_t callback, void * user_arg) { return globus_l_xio_system_register_read( op, handle, -1, u_iov, u_iovc, waitforbytes, flags, from, callback, user_arg); } static globus_result_t globus_l_xio_system_register_write( globus_xio_operation_t op, globus_l_xio_system_t * handle, globus_off_t offset, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * to, globus_xio_system_data_callback_t callback, void * user_arg) { globus_result_t result; globus_i_xio_system_op_info_t * op_info; struct iovec * iov; int fd = handle->fd; GlobusXIOName(globus_l_xio_system_register_write); GlobusXIOSystemDebugEnterFD(fd); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, (_XIOSL("[%s] Waiting for %u bytes\n"), _xio_name, (unsigned) waitforbytes)); GlobusIXIOSystemAllocOperation(op_info); if(!op_info) { result = GlobusXIOErrorMemory("op_info"); goto error_op_info; } GlobusIXIOSystemAllocIovec(u_iovc, iov); if(!iov) { result = GlobusXIOErrorMemory("iov"); goto error_iovec; } GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc); op_info->type = GLOBUS_I_XIO_SYSTEM_OP_WRITE; op_info->sop.data.start_iov = iov; op_info->sop.data.start_iovc = u_iovc; op_info->sop.data.iov = iov; op_info->sop.data.iovc = u_iovc; op_info->sop.data.addr = to; op_info->sop.data.flags = flags; op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW; op_info->op = op; op_info->handle = handle; op_info->user_arg = user_arg; op_info->sop.data.callback = callback; op_info->waitforbytes = waitforbytes; op_info->offset = offset; result = globus_l_xio_system_register_write_fd(fd, op_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_system_register_write_fd", result); goto error_register; } /* handle could be destroyed by time we get here - no touch! */ GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_register: GlobusIXIOSystemFreeIovec(u_iovc, iov); error_iovec: GlobusIXIOSystemFreeOperation(op_info); error_op_info: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_xio_system_file_register_write( globus_xio_operation_t op, globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, globus_xio_system_data_callback_t callback, void * user_arg) { return globus_l_xio_system_register_write( op, handle, offset, u_iov, u_iovc, waitforbytes, 0, GLOBUS_NULL, callback, user_arg); } globus_result_t globus_xio_system_socket_register_write( globus_xio_operation_t op, globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * to, globus_xio_system_data_callback_t callback, void * user_arg) { return globus_l_xio_system_register_write( op, handle, -1, u_iov, u_iovc, waitforbytes, flags, to, callback, user_arg); } static globus_result_t globus_l_xio_system_try_read( globus_l_xio_system_t * handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, int flags, globus_sockaddr_t * from, globus_size_t * nbytes) { if(handle->type == GLOBUS_XIO_SYSTEM_FILE) { globus_result_t result; globus_mutex_lock(&handle->lock); { if(handle->file_position != offset && (iovc > 1 || iov->iov_len > 0)) /* else select() mode */ { GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[globus_l_xio_system_try_read] fd=%d, " "Changing file position to %" GLOBUS_OFF_T_FORMAT "\n", handle->fd, offset)); /* assume success as possible failures are ignorable */ lseek(handle->fd, offset, SEEK_SET); handle->file_position = offset; } result = globus_i_xio_system_file_try_read( handle->fd, iov, iovc, nbytes); handle->file_position += *nbytes; } globus_mutex_unlock(&handle->lock); return result; } else { return globus_i_xio_system_socket_try_read( handle->fd, iov, iovc, flags, from, nbytes); } } static globus_result_t globus_l_xio_system_read( globus_l_xio_system_t * handle, globus_off_t offset, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * from, globus_size_t * u_nbytes) { globus_result_t result; int rc; GlobusXIOName(globus_l_xio_system_read); GlobusXIOSystemDebugEnter(); result = globus_l_xio_system_try_read( handle, offset, u_iov, u_iovc, flags, from, u_nbytes); if(result == GLOBUS_SUCCESS && *u_nbytes < waitforbytes) { struct iovec * iov; int iovc; globus_size_t nbytes = *u_nbytes; globus_size_t total = nbytes; /** * XXX this is not thread safe... both reads and writes are mucking * with blocking status. * worst case, we read 0 bytes in the loop below, return, and xio * calls us again to finish up. */ rc = globus_l_xio_system_remove_nonblocking(handle); GlobusIXIOSystemAllocIovec(u_iovc, iov); if(!iov) { result = GlobusXIOErrorMemory("iov"); goto error_iovec; } GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc); u_iov = iov; iovc = u_iovc; do { if(total > 0) { /* only capture source first time around */ from = GLOBUS_NULL; } offset += nbytes; GlobusIXIOUtilAdjustIovec(iov, iovc, nbytes); result = globus_l_xio_system_try_read( handle, offset, iov, iovc, flags, from, &nbytes); total += nbytes; } while(result == GLOBUS_SUCCESS && nbytes && total < waitforbytes); *u_nbytes = total; GlobusIXIOSystemFreeIovec(u_iovc, (globus_xio_iovec_t *) u_iov); rc = globus_l_xio_system_add_nonblocking(handle); } GlobusXIOSystemDebugExit(); return result; error_iovec: rc = globus_l_xio_system_add_nonblocking(handle); GlobusXIOSystemDebugExitWithError(); return result; } globus_result_t globus_xio_system_file_read( globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, globus_size_t * nbytes) { return globus_l_xio_system_read( handle, offset, iov, iovc, waitforbytes, 0, GLOBUS_NULL, nbytes); } globus_result_t globus_xio_system_socket_read( globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * from, globus_size_t * nbytes) { return globus_l_xio_system_read( handle, -1, iov, iovc, waitforbytes, flags, from, nbytes); } static globus_result_t globus_l_xio_system_try_write( globus_l_xio_system_t * handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, int flags, globus_sockaddr_t * to, globus_size_t * nbytes) { if(handle->type == GLOBUS_XIO_SYSTEM_FILE) { globus_result_t result; globus_mutex_lock(&handle->lock); { if(handle->file_position != offset && (iovc > 1 || iov->iov_len > 0)) /* else select() mode */ { GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[globus_l_xio_system_try_write] fd=%d, " "Changing file position to %" GLOBUS_OFF_T_FORMAT "\n", handle->fd, offset)); /* assume success as possible failures are ignorable */ lseek(handle->fd, offset, SEEK_SET); handle->file_position = offset; } result = globus_i_xio_system_file_try_write( handle->fd, iov, iovc, nbytes); handle->file_position += *nbytes; } globus_mutex_unlock(&handle->lock); return result; } else { return globus_i_xio_system_socket_try_write( handle->fd, iov, iovc, flags, to, nbytes); } } static globus_result_t globus_l_xio_system_write( globus_l_xio_system_t * handle, globus_off_t offset, const globus_xio_iovec_t * u_iov, int u_iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * to, globus_size_t * u_nbytes) { globus_result_t result; int rc; GlobusXIOName(globus_l_xio_system_write); GlobusXIOSystemDebugEnter(); result = globus_l_xio_system_try_write( handle, offset, u_iov, u_iovc, flags, to, u_nbytes); if(result == GLOBUS_SUCCESS && *u_nbytes < waitforbytes) { struct iovec * iov; int iovc; globus_size_t nbytes = *u_nbytes; globus_size_t total = nbytes; /** * XXX this is not thread safe... both reads and writes are mucking * with blocking status */ rc = globus_l_xio_system_remove_nonblocking(handle); GlobusIXIOSystemAllocIovec(u_iovc, iov); if(!iov) { result = GlobusXIOErrorMemory("iov"); goto error_iovec; } GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc); u_iov = iov; iovc = u_iovc; do { offset += nbytes; GlobusIXIOUtilAdjustIovec(iov, iovc, nbytes); result = globus_l_xio_system_try_write( handle, offset, iov, iovc, flags, to, &nbytes); total += nbytes; } while(result == GLOBUS_SUCCESS && nbytes && total < waitforbytes); *u_nbytes = total; GlobusIXIOSystemFreeIovec(u_iovc, (globus_xio_iovec_t *) u_iov); rc = globus_l_xio_system_add_nonblocking(handle); } GlobusXIOSystemDebugExit(); return result; error_iovec: rc = globus_l_xio_system_add_nonblocking(handle); GlobusXIOSystemDebugExitWithError(); return result; } globus_result_t globus_xio_system_file_write( globus_xio_system_file_handle_t handle, globus_off_t offset, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, globus_size_t * nbytes) { return globus_l_xio_system_write( handle, offset, iov, iovc, waitforbytes, 0, GLOBUS_NULL, nbytes); } globus_result_t globus_xio_system_socket_write( globus_xio_system_socket_handle_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t waitforbytes, int flags, globus_sockaddr_t * to, globus_size_t * nbytes) { return globus_l_xio_system_write( handle, -1, iov, iovc, waitforbytes, flags, to, nbytes); } static globus_result_t globus_l_xio_system_close( int fd) { globus_result_t result; int rc; GlobusXIOName(globus_l_xio_system_close); GlobusXIOSystemDebugEnterFD(fd); do { rc = close(fd); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { result = GlobusXIOErrorSystemError("close", errno); goto error_close; } GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_close: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_off_t globus_xio_system_file_get_position( globus_xio_system_file_t fd) { globus_off_t offset; GlobusXIOName(globus_xio_system_file_get_position); GlobusXIOSystemDebugEnterFD(fd); /* ignore errors, may be a pipe or other unseekable */ offset = lseek(fd, 0, SEEK_CUR); if(offset == -1) { offset = 0; } GlobusXIOSystemDebugExitFD(fd); return offset; } globus_off_t globus_xio_system_file_get_size( globus_xio_system_file_t fd) { globus_off_t size = -1; struct stat buf; GlobusXIOName(globus_xio_system_file_get_size); GlobusXIOSystemDebugEnterFD(fd); if(fstat(fd, &buf) == 0) { size = buf.st_size; } GlobusXIOSystemDebugExitFD(fd); return size; } globus_xio_system_file_t globus_xio_system_convert_stdio( const char * stdio) { if(strcmp(stdio, "stdin") == 0) { return fileno(stdin); } else if(strcmp(stdio, "stdout") == 0) { return fileno(stdout); } else if(strcmp(stdio, "stderr") == 0) { return fileno(stderr); } return GLOBUS_XIO_SYSTEM_INVALID_FILE; } globus_result_t globus_xio_system_file_truncate( globus_xio_system_file_t fd, globus_off_t size) { globus_result_t result; int rc; GlobusXIOName(globus_xio_system_file_truncate); GlobusXIOSystemDebugEnterFD(fd); #ifdef TARGET_ARCH_ARM setErrno(EINVAL); result = GlobusXIOErrorSystemError("ftruncate", errno); #else rc = ftruncate(fd, size); if(rc < 0) { GlobusXIOSystemUpdateErrno(); result = GlobusXIOErrorSystemError("ftruncate", errno); goto error_truncate; } GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_truncate: #endif GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_xio_system_file_open( globus_xio_system_file_t * fd, const char * filename, int flags, unsigned long mode) { globus_result_t result; GlobusXIOName(globus_xio_system_file_open); *fd = -1; GlobusXIOSystemDebugEnterFD(*fd); do { *fd = open(filename, flags, mode); GlobusXIOSystemUpdateErrno(); } while(*fd < 0 && errno == EINTR); if(*fd < 0) { result = GlobusXIOErrorSystemError("open", errno); goto error_open; } /* all handles created by me are closed on exec */ fcntl(*fd, F_SETFD, FD_CLOEXEC); GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] Opened file, %s fd=%d\n", _xio_name, filename, *fd)); GlobusXIOSystemDebugExitFD(*fd); return GLOBUS_SUCCESS; error_open: GlobusXIOSystemDebugExitWithErrorFD(*fd); return result; } globus_result_t globus_xio_system_file_close( globus_xio_system_file_t fd) { return globus_l_xio_system_close(fd); } globus_result_t globus_xio_system_socket_create( globus_xio_system_socket_t * fd, int domain, int type, int protocol) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_create); *fd = -1; GlobusXIOSystemDebugEnterFD(*fd); *fd = socket(domain, type, protocol); GlobusXIOSystemUpdateErrno(); if(*fd == -1) { result = GlobusXIOErrorSystemError("socket", errno); goto error_socket; } #ifndef TARGET_ARCH_NETOS /* all handles created by me are closed on exec */ fcntl(*fd, F_SETFD, FD_CLOEXEC); #endif GlobusXIOSystemDebugExitFD(*fd); return GLOBUS_SUCCESS; error_socket: GlobusXIOSystemDebugExitWithErrorFD(*fd); return result; } globus_result_t globus_xio_system_socket_setsockopt( globus_xio_system_socket_t socket, int level, int optname, const void * optval, globus_socklen_t optlen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_setsockopt); GlobusXIOSystemDebugEnterFD(socket); if(setsockopt(socket, level, optname, (void *) optval, optlen) < 0) { GlobusXIOSystemUpdateErrno(); result = GlobusXIOErrorSystemError("setsockopt", errno); goto error_setsockopt; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_setsockopt: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_getsockopt( globus_xio_system_socket_t socket, int level, int optname, void * optval, globus_socklen_t * optlen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_getsockopt); GlobusXIOSystemDebugEnterFD(socket); if(getsockopt(socket, level, optname, optval, optlen) < 0) { GlobusXIOSystemUpdateErrno(); result = GlobusXIOErrorSystemError("getsockopt", errno); goto error_getsockopt; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_getsockopt: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_getsockname( globus_xio_system_socket_t socket, struct sockaddr * name, globus_socklen_t * namelen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_getsockname); GlobusXIOSystemDebugEnterFD(socket); if(getsockname(socket, name, namelen) < 0) { GlobusXIOSystemUpdateErrno(); result = GlobusXIOErrorSystemError("getsockname", errno); goto error_getsockname; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_getsockname: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_getpeername( globus_xio_system_socket_t socket, struct sockaddr * name, globus_socklen_t * namelen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_getpeername); GlobusXIOSystemDebugEnterFD(socket); if(getpeername(socket, name, namelen) < 0) { GlobusXIOSystemUpdateErrno(); result = GlobusXIOErrorSystemError("getpeername", errno); goto error_getpeername; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_getpeername: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_bind( globus_xio_system_socket_t socket, struct sockaddr * addr, globus_socklen_t addrlen) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_bind); GlobusXIOSystemDebugEnterFD(socket); if(bind(socket, addr, addrlen) < 0) { GlobusXIOSystemUpdateErrno(); result = GlobusXIOErrorSystemError("bind", errno); goto error_bind; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_bind: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_listen( globus_xio_system_socket_t socket, int backlog) { globus_result_t result; GlobusXIOName(globus_xio_system_socket_listen); GlobusXIOSystemDebugEnterFD(socket); if(listen(socket, backlog) < 0) { GlobusXIOSystemUpdateErrno(); result = GlobusXIOErrorSystemError("listen", errno); goto error_listen; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_listen: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_connect( globus_xio_system_socket_t socket, const struct sockaddr * addr, globus_socklen_t addrlen) { globus_result_t result; int rc; GlobusXIOName(globus_xio_system_socket_connect); GlobusXIOSystemDebugEnterFD(socket); do { rc = connect(socket, addr, addrlen); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { result = GlobusXIOErrorSystemError("connect", errno); goto error_connect; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_connect: GlobusXIOSystemDebugExitWithErrorFD(socket); return result; } globus_result_t globus_xio_system_socket_close( globus_xio_system_socket_t socket) { #ifdef TARGET_ARCH_NETOS globus_result_t result; int rc; GlobusXIOName(globus_xio_system_socket_close); GlobusXIOSystemDebugEnterFD(socket); do { rc = socketclose(socket); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { result = GlobusXIOErrorSystemError("close", errno); goto error_close; } GlobusXIOSystemDebugExitFD(socket); return GLOBUS_SUCCESS; error_close: GlobusXIOSystemDebugExitWithErrorFD(fd); return result; #else return globus_l_xio_system_close(socket); #endif } #endif /*TARGET_ARCH_WIN32*/ globus_xio-3.6/globus_xio_driver.c0000666000076400007640000020632211725336355014401 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio.h" #include "globus_i_xio.h" static globus_bool_t globus_l_xio_server_timeout_always( globus_xio_server_t server, globus_xio_operation_type_t type) { return GLOBUS_TRUE; } static globus_bool_t globus_l_xio_timeout_always( globus_xio_handle_t handle, globus_xio_operation_type_t type, void * user_arg) { return GLOBUS_TRUE; } void globus_l_xio_op_restarted( globus_i_xio_op_t * op) { globus_bool_t destroy_handle = GLOBUS_FALSE; globus_i_xio_context_t * context; globus_i_xio_handle_t * handle; GlobusXIOName(globus_l_xio_op_restarted); GlobusXIODebugInternalEnter(); context = op->_op_context; handle = op->_op_handle; globus_mutex_lock(&context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); } globus_result_t globus_i_xio_repass_write( globus_i_xio_op_t * op) { globus_i_xio_op_entry_t * my_op; globus_i_xio_context_entry_t * next_context; globus_result_t res; globus_xio_iovec_t * tmp_iovec; int iovec_count; GlobusXIOName(globus_i_xio_repass_write); GlobusXIODebugInternalEnter(); my_op = &op->entry[op->ndx - 1]; next_context = &op->_op_context->entry[op->ndx - 1]; /* allocate tmp iovec to the bigest it could ever be */ if(my_op->_op_ent_fake_iovec == NULL) { my_op->_op_ent_fake_iovec = (globus_xio_iovec_t *) globus_malloc(sizeof(globus_xio_iovec_t) * my_op->_op_ent_iovec_count); } tmp_iovec = my_op->_op_ent_fake_iovec; GlobusIXIOUtilTransferAdjustedIovec( tmp_iovec, iovec_count, my_op->_op_ent_iovec, my_op->_op_ent_iovec_count, my_op->_op_ent_nbytes); /* repass the operation down */ res = next_context->driver->write_func( next_context->driver_handle, tmp_iovec, iovec_count, op); GlobusXIODebugInternalExit(); return res; } globus_result_t globus_i_xio_repass_read( globus_i_xio_op_t * op) { globus_i_xio_op_entry_t * my_op; globus_i_xio_context_entry_t * next_context; globus_result_t res; globus_xio_iovec_t * tmp_iovec; int iovec_count; GlobusXIOName(globus_i_xio_repass_read); GlobusXIODebugInternalEnter(); my_op = &op->entry[op->ndx - 1]; next_context = &op->_op_context->entry[op->ndx - 1]; /* allocate tmp iovec to the bigest it could ever be */ if(my_op->_op_ent_fake_iovec == NULL) { my_op->_op_ent_fake_iovec = (globus_xio_iovec_t *) globus_malloc(sizeof(globus_xio_iovec_t) * my_op->_op_ent_iovec_count); } tmp_iovec = my_op->_op_ent_fake_iovec; GlobusIXIOUtilTransferAdjustedIovec( tmp_iovec, iovec_count, my_op->_op_ent_iovec, my_op->_op_ent_iovec_count, my_op->_op_ent_nbytes); /* repass the operation down */ res = next_context->driver->read_func( next_context->driver_handle, tmp_iovec, iovec_count, op); GlobusXIODebugInternalExit(); return res; } void globus_i_xio_pass_failed( globus_i_xio_op_t * op, globus_i_xio_context_entry_t * my_context, globus_bool_t * close, globus_bool_t * destroy_handle) { GlobusXIOName(globus_i_xio_pass_failed); GlobusXIODebugInternalEnter(); my_context->outstanding_operations--; /*there is an off chance that we could need to close here*/ if((my_context->state == GLOBUS_XIO_CONTEXT_STATE_CLOSING || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING) && my_context->outstanding_operations == 0 && !my_context->close_started) { globus_assert(my_context->close_op != NULL); *close = GLOBUS_TRUE; } op->ndx = op->entry[op->ndx - 1].prev_ndx; GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, destroy_handle); } GlobusXIODebugInternalExit(); } void globus_i_xio_handle_destroy( globus_i_xio_handle_t * handle) { globus_bool_t destroy_context = GLOBUS_FALSE; GlobusXIOName(globus_i_xio_handle_destroy); GlobusXIODebugInternalEnter(); globus_mutex_lock(&globus_i_xio_mutex); { globus_mutex_lock(&handle->context->mutex); { handle->context->ref--; if(handle->context->ref == 0) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_handle_destroy] :: context->ref == 0.\n"))); destroy_context = GLOBUS_TRUE; } if(handle->sd_monitor != NULL) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_handle_destroy]" " :: signalling handle unload.\n"))); handle->sd_monitor->count--; if(handle->sd_monitor->count == 0) { globus_cond_signal(&globus_i_xio_cond); } } else { globus_list_remove(&globus_i_xio_outstanding_handles_list, globus_list_search( globus_i_xio_outstanding_handles_list, handle)); } } globus_mutex_unlock(&handle->context->mutex); } globus_mutex_unlock(&globus_i_xio_mutex); if(destroy_context) { globus_i_xio_context_destroy(handle->context); } globus_assert(handle->ref == 0); globus_callback_space_destroy(handle->space); globus_free(handle); GlobusXIODebugInternalExit(); } /* * called in the context lock */ void globus_i_xio_handle_dec( globus_i_xio_handle_t * handle, globus_bool_t * destroy_handle) { globus_result_t res; globus_i_xio_context_t * context; globus_i_xio_space_info_t * space_info; GlobusXIOName(globus_i_xio_handle_dec); GlobusXIODebugInternalEnter(); context = handle->context; *destroy_handle = GLOBUS_FALSE; handle->ref--; GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_i_xio_handle_dec] :: handle ref at %d.\n"), handle->ref)); if(handle->ref == 0) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_handle_dec] :: handle ref at 0.\n"))); globus_assert(handle->state == GLOBUS_XIO_HANDLE_STATE_CLOSED); *destroy_handle = GLOBUS_TRUE; /* purge the ch list */ while(!globus_list_empty(handle->cb_list)) { space_info = (globus_i_xio_space_info_t *) globus_list_remove(&handle->cb_list, handle->cb_list); res = globus_callback_unregister( space_info->ch, NULL, NULL, NULL); if(res != GLOBUS_SUCCESS) { globus_panic(GLOBUS_XIO_MODULE, res, _XIOSL("failed to unregister")); } } } GlobusXIODebugInternalExit(); } /* * called locked */ void globus_i_xio_op_destroy( globus_i_xio_op_t * op, globus_bool_t * destroy_handle) { globus_i_xio_handle_t * handle; globus_i_xio_context_t * context; int ctr; GlobusXIOName(globus_i_xio_op_destroy); GlobusXIODebugInternalEnter(); context = op->_op_context; handle = op->_op_handle; globus_assert(op->ref == 0); for(ctr = 0; ctr < op->stack_size; ctr++) { if(op->entry[ctr].dd != NULL) { op->_op_context->entry[ctr].driver->attr_destroy_func( op->entry[ctr].dd); } if(op->_op_context->entry[ctr].driver->attr_destroy_func != NULL && op->entry[ctr].open_attr != NULL) { op->_op_context->entry[ctr].driver->attr_destroy_func( op->entry[ctr].open_attr); op->entry[ctr].open_attr = NULL; } if(op->_op_context->entry[ctr].driver->attr_destroy_func != NULL && op->entry[ctr].close_attr != NULL) { op->_op_context->entry[ctr].driver->attr_destroy_func( op->entry[ctr].close_attr); op->entry[ctr].close_attr = NULL; } } if(op->user_open_sbj) { globus_free(op->user_open_sbj); } if(op->user_open_username) { globus_free(op->user_open_username); } if(op->user_open_pw) { globus_free(op->user_open_pw); } globus_memory_push_node(&context->op_memory, op); if(handle != NULL) { globus_i_xio_handle_dec(handle, destroy_handle); } else { *destroy_handle = GLOBUS_FALSE; } GlobusXIODebugInternalExit(); } void globus_i_xio_driver_resume_op( globus_i_xio_op_t * op) { GlobusXIOName(globus_i_xio_driver_resume_op); GlobusXIODebugInternalEnter(); switch(op->entry[op->ndx - 1].type) { case GLOBUS_XIO_OPERATION_TYPE_OPEN: globus_l_xio_driver_open_op_kickout(op); break; case GLOBUS_XIO_OPERATION_TYPE_READ: globus_l_xio_driver_op_read_kickout(op); break; case GLOBUS_XIO_OPERATION_TYPE_WRITE: globus_l_xio_driver_op_write_kickout(op); break; case GLOBUS_XIO_OPERATION_TYPE_CLOSE: globus_l_xio_driver_op_close_kickout(op); break; default: globus_assert(0 && "Unexpected state in globus_i_xio_driver_resume_op"); break; } GlobusXIODebugInternalExit(); } void globus_i_xio_driver_deliver_op( globus_i_xio_op_t * op, int ndx, globus_xio_operation_type_t deliver_type) { GlobusXIOName(globus_i_xio_driver_deliver_op); GlobusXIODebugInternalEnter(); switch(deliver_type) { case GLOBUS_XIO_OPERATION_TYPE_OPEN: globus_xio_driver_open_delivered(op, ndx, &deliver_type); break; case GLOBUS_XIO_OPERATION_TYPE_READ: globus_xio_driver_read_delivered(op, ndx, &deliver_type); break; case GLOBUS_XIO_OPERATION_TYPE_WRITE: globus_xio_driver_write_delivered(op, ndx, &deliver_type); break; default: globus_assert(0); break; } GlobusXIODebugInternalExit(); } void globus_i_xio_will_block_cb( globus_thread_callback_index_t wb_ndx, globus_callback_space_t space, void * user_args) { globus_xio_operation_type_t deliver_type; globus_i_xio_op_t * op; globus_i_xio_context_t * context; int ndx; GlobusXIOName(globus_i_xio_will_block_cb); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_args; globus_thread_blocking_callback_disable(&wb_ndx); context = op->_op_context; op->restarted = GLOBUS_TRUE; globus_assert(op->ndx == 0); ndx = op->ndx; do { globus_mutex_lock(&context->mutex); { if(op->entry[ndx].deliver_type != NULL) { GlobusXIOOpInc(op); deliver_type = *op->entry[ndx].deliver_type; *op->entry[ndx].deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; op->entry[ndx].deliver_type = NULL; } else { deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; } } globus_mutex_unlock(&context->mutex); switch(deliver_type) { case GLOBUS_XIO_OPERATION_TYPE_OPEN: globus_xio_driver_open_delivered(op, ndx, &deliver_type); break; case GLOBUS_XIO_OPERATION_TYPE_READ: globus_xio_driver_read_delivered(op, ndx, &deliver_type); break; case GLOBUS_XIO_OPERATION_TYPE_WRITE: globus_xio_driver_write_delivered(op, ndx, &deliver_type); break; /* none happens if a driver finishes without passing*/ case GLOBUS_XIO_OPERATION_TYPE_NONE: GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s:%d] :: type none, exiting\n"), _xio_name, __LINE__)); goto exit; /* finishe state means the operation was already delivered */ case GLOBUS_XIO_OPERATION_TYPE_FINISHED: break; case GLOBUS_XIO_OPERATION_TYPE_CLOSE: break; default: globus_assert(0); break; } ndx = op->entry[ndx].next_ndx; GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s:%d] :: Index = %d\n"), _xio_name, __LINE__, ndx)); } while(ndx != op->stack_size && ndx != 0); exit: GlobusXIODebugInternalExit(); } void globus_l_xio_driver_op_write_kickout( void * user_arg) { globus_xio_operation_type_t deliver_type; globus_xio_operation_type_t op_type; int ndx; int wb_ndx; globus_i_xio_handle_t * handle; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_i_xio_op_entry_t * my_op; globus_i_xio_op_t * op; GlobusXIOName(globus_l_xio_driver_op_write_kickout); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; my_op = &op->entry[op->ndx - 1]; op->entry[my_op->prev_ndx].next_ndx = op->ndx; op->ndx = my_op->prev_ndx; ndx = op->ndx; my_context = &op->_op_context->entry[ndx]; handle = op->_op_handle; context = op->_op_context; GlobusIXIOClearCancel(op); /* * before releasing the op back to the user we can safely set this * outside of a mutex. Once the users callbcak is called the value * on the local stack may be changed, theus the magic. */ deliver_type = my_op->type; op_type = my_op->type; my_op->deliver_type = &deliver_type; if(ndx == 0) { /* at top level the callback should never be null */ globus_assert(my_op->_op_ent_data_cb != NULL); globus_thread_blocking_space_callback_push( globus_i_xio_will_block_cb, (void *) op, op->blocking ? GLOBUS_CALLBACK_GLOBAL_SPACE: handle->space, &wb_ndx); my_op->_op_ent_data_cb(op, GlobusXIOObjToResult(op->cached_obj), my_op->_op_ent_nbytes, my_op->user_arg); globus_thread_blocking_callback_pop(&wb_ndx); } else { if(my_op->_op_ent_data_cb == NULL) { globus_xio_driver_finished_write(op, GlobusXIOObjToResult(op->cached_obj), my_op->_op_ent_nbytes); } else { my_op->_op_ent_data_cb(op, GlobusXIOObjToResult(op->cached_obj), my_op->_op_ent_nbytes, my_op->user_arg); } } globus_xio_driver_write_delivered(op, ndx, &deliver_type); GlobusXIODebugInternalExit(); } void globus_l_xio_driver_op_read_kickout( void * user_arg) { globus_xio_operation_type_t deliver_type; globus_xio_operation_type_t op_type; int ndx; int wb_ndx; globus_i_xio_handle_t * handle; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_i_xio_op_entry_t * my_op; globus_i_xio_op_t * op; GlobusXIOName(globus_l_xio_driver_op_read_kickout); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; my_op = &op->entry[op->ndx - 1]; op->entry[my_op->prev_ndx].next_ndx = op->ndx; op->ndx = my_op->prev_ndx; ndx = op->ndx; my_context = &op->_op_context->entry[ndx]; handle = op->_op_handle; context = op->_op_context; GlobusIXIOClearCancel(op); /* * before releasing the op back to the user we can safely set this * outside of a mutex. Once the users callbcak is called the value * on the local stack may be changed, theus the magic. */ deliver_type = my_op->type; op_type = my_op->type; my_op->deliver_type = &deliver_type; if(ndx == 0) { /* at top level the callback should never be null */ globus_assert(my_op->_op_ent_data_cb != NULL); globus_thread_blocking_space_callback_push( globus_i_xio_will_block_cb, (void *) op, op->blocking ? GLOBUS_CALLBACK_GLOBAL_SPACE: handle->space, &wb_ndx); my_op->_op_ent_data_cb(op, GlobusXIOObjToResult(op->cached_obj), my_op->_op_ent_nbytes, my_op->user_arg); globus_thread_blocking_callback_pop(&wb_ndx); } else { if(my_op->_op_ent_data_cb == NULL) { globus_xio_driver_finished_read(op, GlobusXIOObjToResult(op->cached_obj), my_op->_op_ent_nbytes); } else { my_op->_op_ent_data_cb(op, GlobusXIOObjToResult(op->cached_obj), my_op->_op_ent_nbytes, my_op->user_arg); } } globus_xio_driver_read_delivered(op, ndx, &deliver_type); GlobusXIODebugInternalExit(); } void globus_l_xio_driver_purge_read_eof( globus_i_xio_context_entry_t * my_context) { globus_i_xio_op_t * tmp_op; GlobusXIOName(globus_l_xio_driver_purge_read_eof); GlobusXIODebugInternalEnter(); while(!globus_list_empty(my_context->eof_op_list)) { /* we can only get here if a eof has been received */ globus_assert(my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING); tmp_op = (globus_i_xio_op_t *) globus_list_remove(&my_context->eof_op_list, my_context->eof_op_list); globus_assert(tmp_op->entry[tmp_op->ndx - 1].type == GLOBUS_XIO_OPERATION_TYPE_READ); globus_i_xio_register_oneshot( tmp_op->_op_handle, globus_l_xio_driver_op_read_kickout, (void *)tmp_op, (tmp_op->blocking || !tmp_op->_op_handle) ? GLOBUS_CALLBACK_GLOBAL_SPACE : tmp_op->_op_handle->space); } GlobusXIODebugInternalExit(); } globus_result_t globus_i_xio_driver_start_close( globus_i_xio_op_t * op, globus_bool_t can_fail) { globus_result_t res; globus_i_xio_handle_t * handle; globus_i_xio_op_entry_t * my_op; globus_i_xio_context_t * context; globus_i_xio_context_entry_t * my_context; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_bool_t destroy_context = GLOBUS_FALSE; GlobusXIOName(globus_i_xio_driver_start_close); GlobusXIODebugInternalEnter(); op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; my_op = &op->entry[op->ndx - 1]; context = op->_op_context; handle = op->_op_handle; my_context = &context->entry[op->ndx - 1]; globus_mutex_lock(&context->mutex); { GlobusXIOOpInc(op); /* make sure the context lives past this op */ context->ref++; } globus_mutex_unlock(&context->mutex); GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[%s:%d] :: Index = %d\n"), _xio_name, __LINE__, op->ndx)); my_op->in_register = GLOBUS_TRUE; res = my_context->driver->close_func( my_context->driver_handle, my_op->close_attr, op); my_op->in_register = GLOBUS_FALSE; if(res != GLOBUS_SUCCESS && !can_fail) { my_op->in_register = GLOBUS_TRUE; globus_xio_driver_finished_close(op, res); my_op->in_register = GLOBUS_FALSE; } if((res == GLOBUS_SUCCESS || !can_fail) && my_op->prev_ndx == 0) { while(op->finished_delayed) { /* reuse this blocked thread to finish the operation */ op->finished_delayed = GLOBUS_FALSE; globus_i_xio_driver_resume_op(op); } } globus_mutex_lock(&context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } context->ref--; if(context->ref == 0) { destroy_context = GLOBUS_TRUE; } } globus_mutex_unlock(&context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } if(destroy_context) { /* the only way we'll be destroying the context is if this was a * driver op and the handle no longer exists */ globus_assert(!destroy_handle); globus_i_xio_context_destroy(context); } GlobusXIODebugInternalExit(); return res; } /* * driver callback kickout * * when in a register the finish function kicks this out as a oneshot */ void globus_l_xio_driver_op_close_kickout( void * user_arg) { globus_i_xio_op_t * op; globus_i_xio_op_entry_t * my_op; GlobusXIOName(globus_l_xio_driver_op_close_kickout); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; my_op = &op->entry[op->ndx - 1]; op->ndx = my_op->prev_ndx; GlobusIXIOClearCancel(op); if(my_op->cb != NULL) { my_op->cb( op, GlobusXIOObjToResult(op->cached_obj), my_op->user_arg); } else { globus_xio_driver_finished_close( op, GlobusXIOObjToResult(op->cached_obj)); } GlobusXIODebugInternalExit(); } /* * driver callback mickout * * when in a register the finish function kicks this out as a oneshot */ void globus_l_xio_driver_op_accept_kickout( void * user_arg) { globus_i_xio_op_t * op; globus_i_xio_op_entry_t * my_op; GlobusXIOName(globus_l_xio_driver_op_accept_kickout); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; my_op = &op->entry[op->ndx - 1]; op->ndx = my_op->prev_ndx; /* driver's can't cancel accept ops yet, dont need this * this call only works for regular ops, anyway * GlobusIXIOClearCancel(op); */ if(my_op->cb != NULL) { my_op->cb( op, GlobusXIOObjToResult(op->cached_obj), my_op->user_arg); } else { globus_xio_driver_finished_accept( op, NULL, GlobusXIOObjToResult(op->cached_obj)); } GlobusXIODebugInternalExit(); } void globus_l_xio_driver_open_op_kickout( void * user_arg) { globus_i_xio_handle_t * handle; globus_i_xio_context_t * context; globus_i_xio_context_entry_t * my_context; int ndx = 0; int wb_ndx; globus_i_xio_op_entry_t * my_op; globus_i_xio_op_t * op; globus_xio_operation_type_t deliver_type; GlobusXIOName(globus_l_xio_driver_open_op_kickout); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *) user_arg; my_op = &op->entry[op->ndx - 1]; op->ndx = my_op->prev_ndx; ndx = op->ndx; my_context = &op->_op_context->entry[ndx]; handle = op->_op_handle; context = op->_op_context; deliver_type = my_op->type; my_op->deliver_type =&deliver_type; GlobusIXIOClearCancel(op); if(ndx == 0) { /* at top level the callback should never be null */ globus_assert(my_op->cb != NULL); globus_thread_blocking_space_callback_push( globus_i_xio_will_block_cb, (void *) op, op->blocking ? GLOBUS_CALLBACK_GLOBAL_SPACE: handle->space, &wb_ndx); my_op->cb(op, GlobusXIOObjToResult(op->cached_obj), my_op->user_arg); globus_thread_blocking_callback_pop(&wb_ndx); } else { if(my_op->cb == NULL) { globus_xio_driver_finished_open(NULL, op, GlobusXIOObjToResult(op->cached_obj)); } else { my_op->cb(op, GlobusXIOObjToResult(op->cached_obj), my_op->user_arg); } } globus_xio_driver_open_delivered(op, ndx, &deliver_type); GlobusXIODebugInternalExit(); } /************************************************************************** * context driver api funcitons * ---------------------------- *************************************************************************/ void globus_i_xio_context_destroy( globus_i_xio_context_t * xio_context) { int ctr; GlobusXIOName(globus_i_xio_context_destroy); GlobusXIODebugInternalEnter(); globus_assert(xio_context->ref == 0); GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL(" context @ 0x%x: ref=%d size=%d\n"), xio_context, xio_context->ref, xio_context->stack_size)); for(ctr = 0; ctr < xio_context->stack_size; ctr++) { globus_fifo_destroy(&xio_context->entry[ctr].pending_read_queue); } globus_mutex_destroy(&xio_context->mutex); globus_mutex_destroy(&xio_context->cancel_mutex); globus_memory_destroy(&xio_context->op_memory); globus_free(xio_context); GlobusXIODebugInternalExit(); } globus_i_xio_context_t * globus_i_xio_context_create( int stack_size) { globus_i_xio_context_t * xio_context; int size; int ctr; GlobusXIOName(globus_i_xio_context_create); GlobusXIODebugInternalEnter(); size = sizeof(globus_i_xio_context_t) + (sizeof(globus_i_xio_context_entry_t) * (stack_size - 1)); xio_context = (globus_i_xio_context_t *) globus_malloc(size); if(xio_context != NULL) { memset(xio_context, '\0', size); globus_mutex_init(&xio_context->mutex, NULL); globus_mutex_init(&xio_context->cancel_mutex, NULL); xio_context->stack_size = stack_size; globus_memory_init(&xio_context->op_memory, sizeof(globus_i_xio_op_t) + (sizeof(globus_i_xio_op_entry_t) * (stack_size - 1)), GLOBUS_XIO_HANDLE_DEFAULT_OPERATION_COUNT); xio_context->ref++; for(ctr = 0; ctr < xio_context->stack_size; ctr++) { xio_context->entry[ctr].whos_my_daddy = xio_context; globus_fifo_init(&xio_context->entry[ctr].pending_read_queue); } } GlobusXIODebugInternalExit(); return xio_context; } /************************************************************************** * macro wrapper functions * ----------------------- * * this is mainly a compile test, but who knows, someone may want it *************************************************************************/ void * globus_i_xio_attr_get_ds( globus_i_xio_attr_t * attr, globus_xio_driver_t driver) { void * rc; GlobusIXIOAttrGetDS(rc, attr, driver); return rc; } /* * read ahead stuff */ void globus_xio_driver_operation_destroy( globus_xio_operation_t operation) { globus_i_xio_context_t * context; globus_bool_t destroy_context = GLOBUS_FALSE; globus_i_xio_op_t * op; GlobusXIOName(globus_xio_driver_operation_destroy); GlobusXIODebugInternalEnter(); op = operation; context = op->_op_context; globus_mutex_lock(&context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { context->ref--; if(context->ref == 0) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_xio_driver_operation_destroy] :: context->ref == 0.\n"))); destroy_context = GLOBUS_TRUE; } globus_memory_push_node(&context->op_memory, op); } } globus_mutex_unlock(&context->mutex); if(destroy_context) { globus_i_xio_context_destroy(context); } GlobusXIODebugInternalExit(); } globus_result_t globus_xio_driver_operation_create( globus_xio_operation_t * operation, globus_xio_driver_handle_t driver_handle) { globus_i_xio_op_t * op; globus_i_xio_op_entry_t * my_op; globus_result_t res; globus_i_xio_context_t * context; int index; GlobusXIOName(globus_xio_driver_operation_create); GlobusXIODebugEnter(); context = driver_handle->whos_my_daddy; for(index = 0; index < context->stack_size && &context->entry[index] != driver_handle; index++) { } if(index == context->stack_size) { res = GlobusXIOErrorParameter("driver_handle"); goto err; } /* driver_handles are to the drivers below the current one */ index--; GlobusXIOOperationCreate(op, context); if(op == NULL) { res = GlobusXIOErrorMemory("op"); goto err; } op->ndx = index + 1; op->type = GLOBUS_XIO_OPERATION_TYPE_DRIVER; op->state = GLOBUS_XIO_OP_STATE_OPERATING; op->ref = 1; op->_op_handle = NULL; op->_op_context = context; op->_op_handle_timeout_cb = NULL; my_op = &op->entry[index]; my_op->_op_ent_nbytes = 0; my_op->_op_ent_wait_for = 0; my_op->prev_ndx = -1; my_op->type = GLOBUS_XIO_OPERATION_TYPE_DRIVER; globus_mutex_lock(&context->mutex); context->ref++; globus_mutex_unlock(&context->mutex); *operation = op; GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_i_xio_driver_attr_cntl( globus_i_xio_attr_t * attr, globus_xio_driver_t driver, int cmd, va_list ap) { char * tmp_str; globus_result_t res = GLOBUS_SUCCESS; void * ds; globus_xio_attr_cmd_t general_cmd; globus_xio_timeout_server_callback_t server_timeout_cb; globus_xio_timeout_callback_t timeout_cb; globus_reltime_t * delay_time; globus_callback_space_t space; GlobusXIOName(globus_i_xio_driver_attr_cntl); GlobusXIODebugEnter(); if(driver != NULL) { GlobusIXIOAttrGetDS(ds, attr, driver); if(ds == NULL) { res = driver->attr_init_func(&ds); if(res != GLOBUS_SUCCESS) { goto err; } if(attr->ndx >= attr->max) { attr->max *= 2; attr->entry = (globus_i_xio_attr_ent_t *) globus_realloc(attr->entry, attr->max * sizeof(globus_i_xio_attr_ent_t)); } attr->entry[attr->ndx].driver = driver; attr->entry[attr->ndx].driver_data = ds; attr->ndx++; } /* if the driver is capable of parsing the strings and this is the string parser command, if there is no table defined the SET_STRING command will be passed to the driver. this is fine. they may want to parse it in their own way */ if(driver->string_table != NULL && cmd == GLOBUS_XIO_SET_STRING_OPTIONS) { char * opt_str; opt_str = va_arg(ap, char *); res = globus_i_xio_string_cntl_parser( opt_str, driver->string_table, ds, driver->attr_cntl_func); } else { res = driver->attr_cntl_func(ds, cmd, ap); } if(res != GLOBUS_SUCCESS) { goto err; } } else { general_cmd = cmd; switch(general_cmd) { case GLOBUS_XIO_ATTR_SET_TIMEOUT_ALL: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); attr->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_timeout_always; } attr->open_timeout_cb = timeout_cb; attr->close_timeout_cb = timeout_cb; attr->read_timeout_cb = timeout_cb; attr->write_timeout_cb = timeout_cb; GlobusTimeReltimeCopy(attr->open_timeout_period, *delay_time); GlobusTimeReltimeCopy(attr->close_timeout_period, *delay_time); GlobusTimeReltimeCopy(attr->read_timeout_period, *delay_time); GlobusTimeReltimeCopy(attr->write_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_OPEN: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); attr->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_timeout_always; } attr->open_timeout_cb = timeout_cb; GlobusTimeReltimeCopy(attr->open_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_CLOSE: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); attr->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_timeout_always; } attr->close_timeout_cb = timeout_cb; GlobusTimeReltimeCopy(attr->close_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_READ: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); attr->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_timeout_always; } attr->read_timeout_cb = timeout_cb; GlobusTimeReltimeCopy(attr->read_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_WRITE: timeout_cb = va_arg(ap, globus_xio_timeout_callback_t); delay_time = va_arg(ap, globus_reltime_t *); attr->timeout_arg = va_arg(ap, void *); if(timeout_cb == NULL) { timeout_cb = globus_l_xio_timeout_always; } attr->write_timeout_cb = timeout_cb; GlobusTimeReltimeCopy(attr->write_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_TIMEOUT_ACCEPT: server_timeout_cb = va_arg(ap, globus_xio_timeout_server_callback_t); delay_time = va_arg(ap, globus_reltime_t *); attr->timeout_arg = va_arg(ap, void *); if(server_timeout_cb == NULL) { server_timeout_cb = globus_l_xio_server_timeout_always; } attr->accept_timeout_cb = server_timeout_cb; GlobusTimeReltimeCopy(attr->accept_timeout_period, *delay_time); break; case GLOBUS_XIO_ATTR_SET_SPACE: space = va_arg(ap, globus_callback_space_t); res = globus_callback_space_reference(space); if(res != GLOBUS_SUCCESS) { goto err; } globus_callback_space_destroy(attr->space); attr->space = space; break; case GLOBUS_XIO_ATTR_CLOSE_NO_CANCEL: attr->no_cancel = va_arg(ap, globus_bool_t); break; case GLOBUS_XIO_ATTR_SET_CREDENTIAL: attr->user_open_cred = va_arg(ap, gss_cred_id_t); tmp_str = va_arg(ap, char *); attr->user_open_sbj = globus_libc_strdup(tmp_str); tmp_str = va_arg(ap, char *); attr->user_open_username = globus_libc_strdup(tmp_str); tmp_str = va_arg(ap, char *); attr->user_open_pw = globus_libc_strdup(tmp_str); break; default: res = GlobusXIOErrorInvalidCommand(general_cmd); goto err; } } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_i_xio_driver_dd_cntl( globus_i_xio_op_t * op, globus_xio_driver_t driver, globus_xio_operation_type_t type, int cmd, va_list ap) { globus_result_t res = GLOBUS_SUCCESS; int ndx; int ctr; void * in_attr = NULL; GlobusXIOName(globus_i_xio_driver_dd_cntl); GlobusXIODebugEnter(); if(driver != NULL) { ndx = -1; for(ctr = 0; ctr < op->stack_size && ndx == -1; ctr++) { if(driver == op->_op_context->entry[ctr].driver) { switch(type) { case GLOBUS_XIO_OPERATION_TYPE_OPEN: if(op->entry[ctr].open_attr == NULL) { res = op->_op_context->entry[ctr].driver->attr_init_func( &op->entry[ctr].open_attr); } in_attr = op->entry[ctr].open_attr; break; case GLOBUS_XIO_OPERATION_TYPE_CLOSE: if(op->entry[ctr].close_attr == NULL) { res = op->_op_context->entry[ctr].driver->attr_init_func( &op->entry[ctr].close_attr); } in_attr = op->entry[ctr].close_attr; break; default: if(op->entry[ctr].dd == NULL) { res = op->_op_context->entry[ctr].driver->attr_init_func( &op->entry[ctr].dd); } in_attr = op->entry[ctr].dd; break; } if(res != GLOBUS_SUCCESS) { goto err; } ndx = ctr; } } if(ndx == -1) { res = GlobusXIOErrorInvalidDriver("not found"); goto err; } if(op->_op_context->entry[ndx].driver->attr_cntl_func) { res = op->_op_context->entry[ndx].driver->attr_cntl_func( in_attr, cmd, ap); if(res != GLOBUS_SUCCESS) { goto err; } } else { res = GlobusXIOErrorInvalidDriver(_XIOSL("driver doesn't support dd cntl")); goto err; } } else { globus_off_t * out_offt; /* could end up here with non-dd attr cntls... none supported at driver * level yet, so no biggie */ switch(cmd) { case GLOBUS_XIO_DD_SET_OFFSET: op->_op_ent_offset = va_arg(ap, globus_off_t); break; case GLOBUS_XIO_DD_GET_OFFSET: out_offt = va_arg(ap, globus_off_t *); *out_offt = op->_op_ent_offset; break; default: res = GlobusXIOErrorInvalidCommand(cmd); goto err; } } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_driver_attr_cntl( globus_xio_operation_t op, globus_xio_driver_t driver, int cmd, ...) { int prev_ndx; globus_result_t res; va_list ap; GlobusXIOName(globus_xio_driver_data_descriptor_cntl); GlobusXIODebugEnter(); if(op == NULL) { res = GlobusXIOErrorParameter("op"); goto err; } # ifdef HAVE_STDARG_H { va_start(ap, cmd); } # else { va_start(ap); } # endif prev_ndx = op->entry[op->ndx - 1].prev_ndx; res = globus_i_xio_driver_dd_cntl( op, driver, op->entry[prev_ndx].type, cmd, ap); va_end(ap); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_driver_data_descriptor_cntl( globus_xio_operation_t op, globus_xio_driver_t driver, int cmd, ...) { globus_result_t res; va_list ap; GlobusXIOName(globus_xio_driver_data_descriptor_cntl); GlobusXIODebugEnter(); if(op == NULL) { res = GlobusXIOErrorParameter("op"); goto err; } # ifdef HAVE_STDARG_H { va_start(ap, cmd); } # else { va_start(ap); } # endif res = globus_i_xio_driver_dd_cntl( op, driver, GLOBUS_XIO_OPERATION_TYPE_DD, cmd, ap); va_end(ap); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_i_xio_driver_handle_cntl( globus_i_xio_context_t * context, int start_ndx, globus_xio_driver_t driver, int cmd, va_list ap) { globus_result_t res = GLOBUS_SUCCESS; int ctr; globus_bool_t called; GlobusXIOName(globus_i_xio_driver_handle_cntl); GlobusXIODebugEnter(); if(context == NULL) { res = GlobusXIOErrorParameter("conext"); goto err; } if(driver != NULL) { for(ctr = start_ndx; ctr < context->stack_size; ctr++) { called = GLOBUS_FALSE; if(driver == context->entry[ctr].driver || driver == GLOBUS_XIO_QUERY) { if(context->entry[ctr].state == GLOBUS_XIO_CONTEXT_STATE_NONE && context->entry[ctr].driver->link_cntl_func) { /* This driver hasn't been opened yet, slot contains link * object */ res = context->entry[ctr].driver->link_cntl_func( context->entry[ctr].driver_handle, cmd, ap); called = GLOBUS_TRUE; } else if(context->entry[ctr].state != GLOBUS_XIO_CONTEXT_STATE_NONE && context->entry[ctr].driver->handle_cntl_func) { res = context->entry[ctr].driver->handle_cntl_func( context->entry[ctr].driver_handle, cmd, ap); called = GLOBUS_TRUE; } if(called && res == GLOBUS_SUCCESS) { break; } if(driver == GLOBUS_XIO_QUERY) { if(called && res != GLOBUS_SUCCESS && globus_xio_error_match(res, GLOBUS_XIO_ERROR_COMMAND)) { /* try again */ res = GLOBUS_SUCCESS; } } else if(!called) { res = GlobusXIOErrorInvalidDriver( _XIOSL("handle_cntl not supported")); } if(res != GLOBUS_SUCCESS) { goto err; } } } if(ctr == context->stack_size) { /* none found, throw error */ if(driver != GLOBUS_XIO_QUERY) { res = GlobusXIOErrorInvalidDriver(_XIOSL("not found")); } else { res = GlobusXIOErrorInvalidCommand(cmd); } goto err; } } else { /* support XIO specific cntls at driver level?? */ } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_driver_merge_handle( globus_xio_operation_t op, globus_xio_driver_handle_t src_driver_handle) { int ctr; globus_result_t res; globus_i_xio_context_t * dst_context; globus_i_xio_context_t * src_context; GlobusXIOName(globus_xio_driver_merge_handle); GlobusXIODebugEnter(); if(op == NULL) { res = GlobusXIOErrorParameter("op"); goto err; } if(src_driver_handle == NULL) { res = GlobusXIOErrorParameter("src_driver_handle"); goto err; } dst_context = op->_op_context; src_context = src_driver_handle->whos_my_daddy; /* * if they are the same just indicate success */ if(dst_context == src_context) { return GLOBUS_SUCCESS; } if(dst_context->stack_size != src_context->stack_size) { res = GlobusXIOErrorParameter("src_driver_handle"); goto err; } for(ctr = op->ndx; ctr < dst_context->stack_size; ctr++) { /* verify that the drivers are compatible */ if(dst_context->entry[ctr].driver != src_context->entry[ctr].driver) { res = GlobusXIOErrorParameter("src_driver_handle"); goto err; } dst_context->entry[ctr].whos_my_daddy = dst_context; dst_context->entry[ctr].driver_handle = src_context->entry[ctr].driver_handle; GlobusXIOContextStateChange(&dst_context->entry[ctr], GLOBUS_XIO_CONTEXT_STATE_OPEN); } /* XXX need to remove references on src context so it can be destroyed */ GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_driver_handle_cntl( globus_xio_driver_handle_t driver_handle, globus_xio_driver_t driver, int cmd, ...) { globus_result_t res; va_list ap; globus_i_xio_context_t * context; int start_ndx = 0; GlobusXIOName(globus_xio_driver_handle_cntl); GlobusXIODebugEnter(); if(driver_handle == NULL) { res = GlobusXIOErrorParameter("driver_handle"); goto err; } context = driver_handle->whos_my_daddy; if(context == NULL) { res = GlobusXIOErrorParameter("op"); goto err; } # ifdef HAVE_STDARG_H { va_start(ap, cmd); } # else { va_start(ap); } # endif if(driver == GLOBUS_XIO_QUERY) { for(; start_ndx < context->stack_size && driver_handle != &context->entry[start_ndx]; start_ndx++) { } } res = globus_i_xio_driver_handle_cntl(context, start_ndx, driver, cmd, ap); va_end(ap); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_driver_operation_cancel( globus_xio_driver_handle_t driver_handle, globus_xio_operation_t operation) { globus_result_t res; globus_i_xio_context_t * context; globus_i_xio_op_t * op; int source_ndx; GlobusXIOName(globus_xio_driver_operation_cancel); GlobusXIODebugEnter(); op = (globus_i_xio_op_t *) operation; if(op == NULL) { res = GlobusXIOErrorParameter("op"); goto err; } context = op->_op_context; for(source_ndx = 0; source_ndx < context->stack_size && &context->entry[source_ndx] != driver_handle; source_ndx++) { } if(source_ndx == context->stack_size) { res = GlobusXIOErrorParameter("driver_handle"); goto err; } /* driver_handles are to the drivers below the current one */ source_ndx--; globus_mutex_lock(&context->cancel_mutex); { res = globus_i_xio_operation_cancel(op, source_ndx); } globus_mutex_unlock(&context->cancel_mutex); GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } void globus_xio_driver_set_eof_received( globus_xio_operation_t op) { globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; GlobusXIOName(globus_xio_driver_set_eof_received); GlobusXIODebugEnter(); context = op->_op_context; my_context = &context->entry[op->entry[op->ndx - 1].prev_ndx]; globus_mutex_lock(&context->mutex); { globus_assert( my_context->read_operations > 0 && _XIOSL("Must be called on behalf of read operations")); globus_assert( my_context->state == GLOBUS_XIO_CONTEXT_STATE_OPEN || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING); if(my_context->state == GLOBUS_XIO_CONTEXT_STATE_OPEN) { GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED); } } globus_mutex_unlock(&context->mutex); GlobusXIODebugExit(); } globus_bool_t globus_xio_driver_eof_received( globus_xio_operation_t op) { globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_bool_t received = GLOBUS_FALSE; GlobusXIOName(globus_xio_driver_eof_received); GlobusXIODebugEnter(); context = op->_op_context; my_context = &context->entry[op->entry[op->ndx - 1].prev_ndx]; globus_mutex_lock(&context->mutex); { globus_assert( my_context->read_operations > 0 && _XIOSL("Must be called on behalf of read operations")); globus_assert( my_context->state == GLOBUS_XIO_CONTEXT_STATE_OPEN || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING); if(my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING) { received = GLOBUS_TRUE; } } globus_mutex_unlock(&context->mutex); GlobusXIODebugExit(); return received; } /*************************************************************************** * driver setup functions * ---------------------- **************************************************************************/ globus_result_t globus_xio_driver_init( globus_xio_driver_t * out_driver, const char * driver_name, void * user_data) { globus_i_xio_driver_t * driver; globus_result_t res; GlobusXIOName(globus_xio_driver_init); GlobusXIODebugEnter(); driver = (globus_i_xio_driver_t *) globus_malloc(sizeof(globus_i_xio_driver_t)); if(driver == NULL) { res = GlobusXIOErrorMemory("driver"); goto err; } memset(driver, '\0', sizeof(globus_i_xio_driver_t)); driver->name = globus_libc_strdup(driver_name); if(!driver->name) { globus_free(driver); res = GlobusXIOErrorMemory("driver->name"); goto err; } driver->user_data = user_data; *out_driver = driver; GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_driver_get_user_data( globus_xio_driver_t in_driver, void ** out_user_data) { globus_result_t res; globus_i_xio_driver_t * driver; GlobusXIOName(globus_xio_driver_get_user_data); GlobusXIODebugEnter(); if(in_driver == NULL) { res = GlobusXIOErrorMemory("in_driver"); goto err; } if(out_user_data == NULL) { res = GlobusXIOErrorMemory("out_user_data"); goto err; } driver = in_driver; *out_user_data = driver->user_data; GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_driver_destroy( globus_xio_driver_t driver) { GlobusXIOName(globus_xio_driver_destroy); GlobusXIODebugEnter(); globus_free(driver->name); globus_free(driver); GlobusXIODebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_xio_driver_set_transport( globus_xio_driver_t driver, globus_xio_driver_transport_open_t transport_open_func, globus_xio_driver_close_t close_func, globus_xio_driver_read_t read_func, globus_xio_driver_write_t write_func, globus_xio_driver_handle_cntl_t handle_cntl_func) { GlobusXIOName(globus_xio_driver_set_transport); GlobusXIODebugEnter(); driver->transport_open_func = transport_open_func; driver->close_func = close_func; driver->read_func = read_func; driver->write_func = write_func; driver->handle_cntl_func = handle_cntl_func; GlobusXIODebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_xio_driver_set_transform( globus_xio_driver_t driver, globus_xio_driver_transform_open_t transform_open_func, globus_xio_driver_close_t close_func, globus_xio_driver_read_t read_func, globus_xio_driver_write_t write_func, globus_xio_driver_handle_cntl_t handle_cntl_func, globus_xio_driver_push_driver_t push_driver_func) { GlobusXIOName(globus_xio_driver_set_transform); GlobusXIODebugEnter(); driver->transform_open_func = transform_open_func; driver->close_func = close_func; driver->read_func = read_func; driver->write_func = write_func; driver->handle_cntl_func = handle_cntl_func; driver->push_driver_func = push_driver_func; GlobusXIODebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_xio_driver_set_server( globus_xio_driver_t driver, globus_xio_driver_server_init_t server_init_func, globus_xio_driver_server_accept_t server_accept_func, globus_xio_driver_server_destroy_t server_destroy_func, globus_xio_driver_server_cntl_t server_cntl_func, globus_xio_driver_link_cntl_t link_cntl_func, globus_xio_driver_link_destroy_t link_destroy_func) { GlobusXIOName(globus_xio_driver_set_server); GlobusXIODebugEnter(); driver->server_init_func = server_init_func; driver->server_accept_func = server_accept_func; driver->server_destroy_func = server_destroy_func; driver->server_cntl_func = server_cntl_func; driver->link_cntl_func = link_cntl_func; driver->link_destroy_func = link_destroy_func; GlobusXIODebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_xio_driver_set_attr( globus_xio_driver_t driver, globus_xio_driver_attr_init_t attr_init_func, globus_xio_driver_attr_copy_t attr_copy_func, globus_xio_driver_attr_cntl_t attr_cntl_func, globus_xio_driver_attr_destroy_t attr_destroy_func) { GlobusXIOName(globus_xio_driver_set_attr); GlobusXIODebugEnter(); if(driver == NULL) { return GlobusXIOErrorParameter("driver"); } if(attr_init_func == NULL) { return GlobusXIOErrorParameter("attr_init_func"); } if(attr_copy_func == NULL) { return GlobusXIOErrorParameter("attr_copy_func"); } if(attr_destroy_func == NULL) { return GlobusXIOErrorParameter("attr_destroy_func"); } driver->attr_init_func = attr_init_func; driver->attr_copy_func = attr_copy_func; driver->attr_cntl_func = attr_cntl_func; driver->attr_destroy_func = attr_destroy_func; GlobusXIODebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_xio_driver_string_cntl_set_table( globus_xio_driver_t driver, globus_xio_string_cntl_table_t * table) { globus_result_t result; GlobusXIOName(globus_xio_driver_set_string_table); GlobusXIODebugEnter(); if(driver == NULL) { result = GlobusXIOErrorParameter("driver"); goto error; } if(table == NULL) { result = GlobusXIOErrorParameter("table"); goto error; } driver->string_table = table; GlobusXIODebugExit(); return GLOBUS_SUCCESS; error: GlobusXIODebugExitWithError(); return result; } void globus_xio_operation_block_timeout( globus_xio_operation_t op) { op->block_timeout = GLOBUS_TRUE; } void globus_xio_operation_unblock_timeout( globus_xio_operation_t op) { op->block_timeout = GLOBUS_FALSE; } /* note, this is called from win32 threads, therefor, it can never use * globus mutex calls */ void globus_xio_operation_refresh_timeout( globus_xio_operation_t op) { op->progress = GLOBUS_TRUE; } /** returns true if operation already canceled */ globus_bool_t globus_xio_operation_enable_cancel( globus_xio_operation_t op, globus_xio_driver_cancel_callback_t cb, void * user_arg) { globus_bool_t already_canceled; globus_mutex_t * mutex; if(op->type == GLOBUS_XIO_OPERATION_TYPE_ACCEPT) { mutex = &op->_op_server->mutex; } else { mutex = &op->_op_context->cancel_mutex; } globus_mutex_lock(mutex); { already_canceled = op->canceled != 0; if(op->canceled == 0) { op->cancel_cb = cb; op->cancel_arg = user_arg; } } globus_mutex_unlock(mutex); return already_canceled; } void globus_xio_operation_disable_cancel( globus_xio_operation_t op) { globus_mutex_t * mutex; if(op->type == GLOBUS_XIO_OPERATION_TYPE_ACCEPT) { mutex = &op->_op_server->mutex; } else { mutex = &op->_op_context->cancel_mutex; } globus_mutex_lock(mutex); { op->cancel_cb = NULL; op->cancel_arg = NULL; } globus_mutex_unlock(mutex); } /* this is intended to only be used with a lock that a user also holds in the * cancel callback. I have not thought of the validity outside of that use */ globus_bool_t globus_xio_operation_is_canceled( globus_xio_operation_t op) { return op->canceled != 0; } globus_bool_t globus_xio_driver_operation_is_blocking( globus_xio_operation_t op) { return op->blocking; } globus_size_t globus_xio_operation_get_wait_for( globus_xio_operation_t op) { return op->entry[op->ndx - 1]._op_ent_wait_for; } void * globus_xio_operation_get_driver_specific( globus_xio_operation_t op) { return op->_op_context->entry[op->ndx - 1].driver_handle; } globus_xio_driver_t globus_xio_operation_get_user_driver( globus_xio_operation_t op) { return op->_op_context->entry[op->ndx - 1].driver; } globus_xio_driver_handle_t globus_xio_operation_get_driver_handle( globus_xio_operation_t op) { return &op->_op_context->entry[op->ndx]; } globus_xio_driver_handle_t globus_xio_operation_get_driver_self_handle( globus_xio_operation_t op) { return &op->_op_context->entry[op->ndx - 1]; } globus_result_t globus_xio_operation_attr_cntl( globus_xio_operation_t op, globus_xio_attr_cmd_t cmd, ...) { char ** tmp_ptr; globus_result_t result; gss_cred_id_t * out_cred; va_list ap; GlobusXIOName(globus_xio_operation_attr_cntl); if(op == NULL) { result = GlobusXIOErrorParameter("op"); goto error_param; } # ifdef HAVE_STDARG_H { va_start(ap, cmd); } # else { va_start(ap); } # endif switch(cmd) { case GLOBUS_XIO_ATTR_GET_CREDENTIAL: out_cred = va_arg(ap, gss_cred_id_t *); if(out_cred != NULL) { *out_cred = op->user_open_cred; } tmp_ptr = va_arg(ap, char **); if(tmp_ptr != NULL) { *tmp_ptr = globus_libc_strdup(op->user_open_sbj); } tmp_ptr = va_arg(ap, char **); if(tmp_ptr != NULL) { *tmp_ptr = globus_libc_strdup(op->user_open_username); } tmp_ptr = va_arg(ap, char **); if(tmp_ptr != NULL) { *tmp_ptr = globus_libc_strdup(op->user_open_pw); } break; default: result = GlobusXIOErrorParameter("cmd"); goto error_cmd; } va_end(ap); return GLOBUS_SUCCESS; error_cmd: error_param: va_end(ap); return result; } void * globus_xio_operation_get_data_descriptor( globus_xio_operation_t op, globus_bool_t force_create) { if(op->entry[op->ndx - 1].dd == NULL && (op->is_user_dd || force_create)) { /* need to create a dd */ if(op->_op_context->entry[op->ndx - 1].driver->attr_init_func( &op->entry[op->ndx - 1].dd) != GLOBUS_SUCCESS) { op->entry[op->ndx - 1].dd = NULL; } } return op->entry[op->ndx - 1].dd; } globus_result_t globus_xio_operation_copy_stack( globus_xio_operation_t op, globus_xio_stack_t * stack) { globus_result_t result; globus_i_xio_server_t * server; globus_i_xio_context_t * context; globus_i_xio_stack_t * istack; int ndx; GlobusXIOName(globus_xio_operation_copy_stack); GlobusXIODebugEnter(); result = globus_xio_stack_init(stack, NULL); if(result != GLOBUS_SUCCESS) { goto error_init; } istack = *stack; switch(op->type) { case GLOBUS_XIO_OPERATION_TYPE_SERVER_INIT: server = op->_op_server; for(ndx = op->stack_size - 1; ndx > op->ndx; ndx--) { istack->size++; globus_list_insert( &istack->driver_stack, server->entry[ndx].driver); } break; case GLOBUS_XIO_OPERATION_TYPE_ACCEPT: server = op->_op_server; for(ndx = op->stack_size - 1; ndx >= op->ndx; ndx--) { istack->size++; globus_list_insert( &istack->driver_stack, server->entry[ndx].driver); } break; default: context = op->_op_context; for(ndx = op->stack_size - 1; ndx >= op->ndx; ndx--) { istack->size++; globus_list_insert( &istack->driver_stack, context->entry[ndx].driver); } break; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; error_init: GlobusXIODebugExitWithError(); return result; } globus_xio-3.6/missing0000755000076400007640000002540612225614602012073 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: globus_xio-3.6/configure.in0000664000076400007640000000402612225614575013013 00000000000000dnl AC_REVISION($Revision: 1.10.14.1 $) AC_INIT(Makefile.am) GLOBUS_INIT AM_PROG_LIBTOOL dnl config header goes here dnl check for -lsocket -lnsl CHECK_NEED_LNSL CHECK_NEED_LSOCKET GPT_SET_LIBS(["$EXTERNAL_LIBS -lm"]) dnl Initialize the automake rules the last argument AM_INIT_AUTOMAKE($GPT_NAME, $GPT_VERSION) dnl Build hooks for all 'builtin' drivers echo -n "Checking for builtin drivers... " XIO_BUILTIN_DIRS= XIO_BUILTIN_DOXY_DIRS= XIO_BUILTIN_LIBS= BUILTIN_EXTENSIONS_DEC= BUILTIN_EXTENSIONS_DEF= builtins=`ls builtins | grep -v CVS | grep -v Makefile` if test "X$builtins" != "X" ; then echo for builtin in $builtins ; do if test -f builtins/$builtin/Makefile.in ; then XIO_BUILTIN_DIRS="$XIO_BUILTIN_DIRS $builtin" XIO_BUILTIN_DOXY_DIRS="$XIO_BUILTIN_DOXY_DIRS ../builtins/${builtin}" lib_name="builtins/${builtin}/libglobus_xio_${builtin}_driver.la" XIO_BUILTIN_LIBS="$XIO_BUILTIN_LIBS $lib_name" BUILTIN_EXTENSIONS_DEC="${BUILTIN_EXTENSIONS_DEC}GlobusXIODeclareModule(${builtin}); " BUILTIN_EXTENSIONS_DEF="$BUILTIN_EXTENSIONS_DEF {GlobusXIOExtensionName(${builtin}), GlobusXIOMyModule(${builtin})}," echo "Including driver: $builtin" fi done else echo "none found" fi AC_SUBST(XIO_BUILTIN_DIRS) AC_SUBST(XIO_BUILTIN_LIBS) AC_SUBST(BUILTIN_EXTENSIONS_DEC) AC_SUBST(BUILTIN_EXTENSIONS_DEF) CFLAGS="$CFLAGS -DGLOBUS_BUILTIN" LAC_DOXYGEN("../ $XIO_BUILTIN_DOXY_DIRS", "*.doc", "${GLOBUS_LOCATION:-/usr}/sbin/globus-vararg-enums-doxygen-filter.pl") AC_CONFIG_HEADERS(config.h) AC_CHECK_FUNCS(sysconf) GLOBUS_FINALIZE AC_OUTPUT( Makefile pkgdata/Makefile pkgdata/pkg_data_src.gpt builtins/Makefile doxygen/Makefile doxygen/Doxyfile doxygen/Doxyfile-internal version.h extensions.h dnl NOTE: do not put anything below this line! builtins/file/Makefile builtins/http/Makefile builtins/mode_e/Makefile builtins/ordering/Makefile builtins/queue/Makefile builtins/tcp/Makefile builtins/telnet/Makefile builtins/udp/Makefile) globus_xio-3.6/globus_xio_system_win32.c0000666000076400007640000006213411374254655015457 00000000000000/* * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ #include "globus_config.h" #ifdef TARGET_ARCH_WIN32 #include "globus_i_xio_win32.h" #include "version.h" static int globus_l_xio_win32_event_activate(void); static int globus_l_xio_win32_event_deactivate(void); globus_module_descriptor_t globus_i_xio_system_module = { "globus_xio_system_win32", globus_l_xio_win32_event_activate, globus_l_xio_win32_event_deactivate, NULL, NULL, &local_version }; typedef struct globus_l_xio_win32_event_entry_s { /* these two are constant */ struct globus_l_xio_win32_event_thread_s * owner; int index; globus_i_xio_win32_event_cb_t callback; void * user_arg; globus_bool_t post_pending; } globus_l_xio_win32_event_entry_t; typedef struct globus_l_xio_win32_event_thread_s { win32_mutex_t lock; win32_mutex_t post_lock; win32_mutex_t wait_lock; int num_entries; globus_list_t * pending_posts; globus_bool_t sleeping; globus_bool_t wakeup_pending; globus_l_xio_win32_event_entry_t * entries[MAXIMUM_WAIT_OBJECTS]; HANDLE events[MAXIMUM_WAIT_OBJECTS]; HANDLE thread_handle; HANDLE wakeup_handle; } globus_l_xio_win32_event_thread_t; static win32_mutex_t globus_l_xio_win32_event_thread_lock; static globus_l_xio_win32_event_thread_t ** globus_l_xio_win32_event_threads; static int globus_l_xio_win32_event_thread_count; static globus_bool_t globus_l_xio_win32_event_activated; static unsigned __stdcall globus_l_xio_win32_event_thread( void * arg); static int globus_l_xio_win32_event_activate(void) { WORD version; WSADATA data; GlobusXIOName(globus_l_xio_win32_event_activate); if(globus_i_xio_system_common_activate() != GLOBUS_SUCCESS) { goto error_common; } GlobusXIOSystemDebugEnter(); version = MAKEWORD(2, 0); if(WSAStartup(version, &data) != 0) { goto error_wsa; } if(globus_i_xio_win32_complete_activate() != GLOBUS_SUCCESS) { goto error_complete; } if(globus_i_xio_win32_file_activate() != GLOBUS_SUCCESS) { goto error_file; } if(globus_i_xio_win32_mode_activate() != GLOBUS_SUCCESS) { goto error_mode; } win32_mutex_init(&globus_l_xio_win32_event_thread_lock, 0); globus_l_xio_win32_event_thread_count = 0; globus_l_xio_win32_event_threads = 0; globus_l_xio_win32_event_activated = GLOBUS_TRUE; GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_mode: globus_i_xio_win32_file_deactivate(); error_file: globus_i_xio_win32_complete_deactivate(); error_complete: WSACleanup(); error_wsa: GlobusXIOSystemDebugExitWithError(); globus_i_xio_system_common_deactivate(); error_common: return GLOBUS_FAILURE; } static void globus_l_xio_win32_event_thread_destroy( globus_l_xio_win32_event_thread_t * thread); static int globus_l_xio_win32_event_deactivate(void) { int i; globus_l_xio_win32_event_thread_t * thread; GlobusXIOName(globus_l_xio_win32_event_deactivate); GlobusXIOSystemDebugEnter(); win32_mutex_lock(&globus_l_xio_win32_event_thread_lock); { globus_l_xio_win32_event_activated = GLOBUS_FALSE; } win32_mutex_unlock(&globus_l_xio_win32_event_thread_lock); for(i = 0; i < globus_l_xio_win32_event_thread_count; i++) { thread = globus_l_xio_win32_event_threads[i]; win32_mutex_lock(&thread->lock); { thread->wakeup_pending = GLOBUS_TRUE; SetEvent(thread->wakeup_handle); } win32_mutex_unlock(&thread->lock); while(WaitForSingleObject( thread->thread_handle, INFINITE) != WAIT_OBJECT_0) { /* XXX error */ } globus_l_xio_win32_event_thread_destroy(thread); } globus_free(globus_l_xio_win32_event_threads); win32_mutex_destroy(&globus_l_xio_win32_event_thread_lock); globus_i_xio_win32_file_deactivate(); globus_i_xio_win32_complete_deactivate(); WSACleanup(); GlobusXIOSystemDebugExit(); globus_i_xio_system_common_deactivate(); return GLOBUS_SUCCESS; } static void globus_l_xio_win32_event_bad_apple( const HANDLE * handles, int count) { DWORD flags; GlobusXIOName(globus_l_xio_win32_event_bad_apple); GlobusXIOSystemDebugEnter(); while(count--) { globus_assert(handles[count] != 0 && "Null handle in event array"); if(!GetHandleInformation(handles[count], &flags) && GetLastError() == ERROR_INVALID_HANDLE) { /* XXX at some point we may want to forcibly remove this bad * handle, but at the moment this api is internal and therefore * it is indicative of an internal bug */ GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_INFO, ("[%s] Bad apple: handle=%lu\n", _xio_name, (unsigned long) handles[count])); } } GlobusXIOSystemDebugExit(); } static int globus_l_xio_win32_event_wait( const HANDLE * handles, int count, int offset, globus_bool_t infinite) { int rc = -1; DWORD wrc; GlobusXIOName(globus_l_xio_win32_event_wait); GlobusXIOSystemDebugEnter(); if(offset < count) { count -= offset; wrc = WaitForMultipleObjects( count, handles + offset, FALSE, infinite ? INFINITE : 0); if(wrc == WAIT_FAILED) { int err = GetLastError(); GlobusXIOSystemDebugSysError("Wait error", err); if(err == ERROR_INVALID_HANDLE) { globus_l_xio_win32_event_bad_apple(handles + offset, count); } } else if(wrc >= WAIT_OBJECT_0 && wrc < WAIT_OBJECT_0 + count) { rc = wrc - WAIT_OBJECT_0 + offset; } else if(wrc >= WAIT_ABANDONED_0 && wrc < WAIT_ABANDONED_0 + count) { rc = wrc - WAIT_ABANDONED_0 + offset; } } GlobusXIOSystemDebugExit(); return rc; } static void globus_l_xio_win32_event_remove( globus_l_xio_win32_event_thread_t * thread, globus_l_xio_win32_event_entry_t * entry); /** * this returns -1 or the prior index of the entry replacing this one */ static int globus_l_xio_win32_event_dispatch( globus_l_xio_win32_event_entry_t * entry) { int index = -1; GlobusXIOName(globus_l_xio_win32_event_dispatch); GlobusXIOSystemDebugEnter(); if(!entry->callback(entry->user_arg)) { win32_mutex_lock(&entry->owner->lock); { globus_l_xio_win32_event_remove(entry->owner, entry); /* remove always takes last entry */ index = entry->owner->num_entries; } win32_mutex_unlock(&entry->owner->lock); } GlobusXIOSystemDebugExit(); return index; } static unsigned __stdcall globus_l_xio_win32_event_thread( void * arg) { globus_l_xio_win32_event_thread_t * thread; int count; int index; GlobusXIOName(globus_l_xio_win32_event_thread); GlobusXIOSystemDebugEnter(); thread = (globus_l_xio_win32_event_thread_t *) arg; do { /* this lock prevents event objects from being closed while * sleeping in the wait() call. It is only used by * unregister_event() as a synchronization point */ win32_mutex_lock(&thread->wait_lock); { win32_mutex_lock(&thread->lock); { count = thread->num_entries; thread->sleeping = GLOBUS_TRUE; } win32_mutex_unlock(&thread->lock); index = globus_l_xio_win32_event_wait( thread->events, count, 0, GLOBUS_TRUE); } win32_mutex_unlock(&thread->wait_lock); win32_mutex_lock(&thread->post_lock); { thread->sleeping = GLOBUS_FALSE; if(index < 0) { /* XXX error */ } else if(!globus_list_empty(thread->pending_posts)) { /** * dispatch all pending posts */ globus_l_xio_win32_event_entry_t * consumed; globus_l_xio_win32_event_entry_t * entry; consumed = thread->entries[index]; globus_l_xio_win32_event_dispatch(consumed); do { entry = (globus_l_xio_win32_event_entry_t *) globus_list_remove( &thread->pending_posts, thread->pending_posts); entry->post_pending = GLOBUS_FALSE; if(entry != consumed) { globus_l_xio_win32_event_dispatch(entry); } } while(!globus_list_empty(thread->pending_posts)); } else { /** * dispatch consumed event and check rest with 0 timeout * The added complexity here ensures we don't starve anyone */ do { int replacement; replacement = globus_l_xio_win32_event_dispatch( thread->entries[index]); if(replacement < 0 || replacement >= count) { /** * either wasn't removed or the replacement is * outside the range I am processing in this iteration * * skip to next entry */ index++; } else { /** * replacement is in my range, reduce count and * maintain current index. */ count--; } /* check the rest */ index = globus_l_xio_win32_event_wait( thread->events, count, index, GLOBUS_FALSE); } while(index >= 0); } } win32_mutex_unlock(&thread->post_lock); } while(globus_l_xio_win32_event_activated); GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; } static globus_bool_t globus_l_xio_win32_event_wakeup_cb( void * arg) { globus_l_xio_win32_event_thread_t * thread; GlobusXIOName(globus_l_xio_win32_event_wakeup_cb); GlobusXIOSystemDebugEnter(); thread = (globus_l_xio_win32_event_thread_t *) arg; win32_mutex_lock(&thread->lock); { thread->wakeup_pending = GLOBUS_FALSE; } win32_mutex_unlock(&thread->lock); GlobusXIOSystemDebugExit(); return GLOBUS_TRUE; } static globus_result_t globus_l_xio_win32_event_add( globus_l_xio_win32_event_entry_t ** uentry, globus_l_xio_win32_event_thread_t * thread, HANDLE event_handle, globus_i_xio_win32_event_cb_t callback, void * user_arg); static globus_result_t globus_l_xio_win32_event_thread_init( globus_l_xio_win32_event_thread_t ** uthread) { globus_result_t result; globus_l_xio_win32_event_thread_t * thread; globus_l_xio_win32_event_entry_t * entry; GlobusXIOName(globus_l_xio_win32_event_thread_init); GlobusXIOSystemDebugEnter(); thread = (globus_l_xio_win32_event_thread_t *) globus_calloc(1, sizeof(globus_l_xio_win32_event_thread_t)); if(!thread) { result = GlobusXIOErrorMemory("thread"); goto error_alloc; } thread->wakeup_handle = CreateEvent(0, FALSE, FALSE, 0); if(thread->wakeup_handle == 0) { result = GlobusXIOErrorSystemError( "CreateEvent", GetLastError()); goto error_create; } result = globus_l_xio_win32_event_add( &entry, thread, thread->wakeup_handle, globus_l_xio_win32_event_wakeup_cb, thread); if(result != GLOBUS_SUCCESS) { goto error_add; } win32_mutex_init(&thread->lock, 0); win32_mutex_init(&thread->post_lock, 0); win32_mutex_init(&thread->wait_lock, 0); *uthread = thread; GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_add: CloseHandle(thread->wakeup_handle); error_create: globus_free(thread); error_alloc: GlobusXIOSystemDebugExitWithError(); return result; } static void globus_l_xio_win32_event_thread_destroy( globus_l_xio_win32_event_thread_t * thread) { int i; GlobusXIOName(globus_l_xio_win32_event_thread_destroy); GlobusXIOSystemDebugEnter(); win32_mutex_destroy(&thread->wait_lock); win32_mutex_destroy(&thread->post_lock); win32_mutex_destroy(&thread->lock); CloseHandle(thread->wakeup_handle); if(thread->thread_handle) { CloseHandle(thread->thread_handle); } globus_list_free(thread->pending_posts); for(i = 0; i < MAXIMUM_WAIT_OBJECTS; i++) { if(thread->entries[i]) { globus_free(thread->entries[i]); } } globus_free(thread); GlobusXIOSystemDebugExit(); } static globus_result_t globus_l_xio_win32_event_get_thread( globus_l_xio_win32_event_thread_t ** uthread) { int i; globus_l_xio_win32_event_thread_t * thread = 0; globus_result_t result; GlobusXIOName(globus_l_xio_win32_event_get_thread); GlobusXIOSystemDebugEnter(); for(i = 0; i < globus_l_xio_win32_event_thread_count; i++) { if(globus_l_xio_win32_event_threads[i]->num_entries < MAXIMUM_WAIT_OBJECTS) { thread = globus_l_xio_win32_event_threads[i]; break; } } if(!thread) { /* make room for another MAXIMUM_WAIT_OBJECTS (64) events */ globus_l_xio_win32_event_thread_t ** new_threads; new_threads = (globus_l_xio_win32_event_thread_t **) globus_realloc( globus_l_xio_win32_event_threads, sizeof(globus_l_xio_win32_event_thread_t) * (globus_l_xio_win32_event_thread_count + 1)); if(!new_threads) { result = GlobusXIOErrorMemory("new_threads"); goto error_realloc; } globus_l_xio_win32_event_threads = new_threads; result = globus_l_xio_win32_event_thread_init(&thread); if(result != GLOBUS_SUCCESS) { goto error_init; } globus_l_xio_win32_event_threads[ globus_l_xio_win32_event_thread_count] = thread; thread->thread_handle = (HANDLE) _beginthreadex( 0, 0, globus_l_xio_win32_event_thread, thread, 0, 0); if(thread->thread_handle == 0) { /* technically, i should be checking errno, but a look at the * source code for _beginthreadex() shows LastError untouched * after CreateThread fails */ result = GlobusXIOErrorSystemError( "_beginthreadex", GetLastError()); goto error_thread; } globus_l_xio_win32_event_thread_count++; } *uthread = thread; GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_thread: globus_l_xio_win32_event_thread_destroy(thread); error_init: error_realloc: GlobusXIOSystemDebugExitWithError(); return result; } /* called with thread entry locked and guaranteed room for one more entry */ static globus_result_t globus_l_xio_win32_event_add( globus_l_xio_win32_event_entry_t ** uentry, globus_l_xio_win32_event_thread_t * thread, HANDLE event_handle, globus_i_xio_win32_event_cb_t callback, void * user_arg) { globus_result_t result; globus_l_xio_win32_event_entry_t * entry; GlobusXIOName(globus_l_xio_win32_event_add); GlobusXIOSystemDebugEnter(); if(!thread->entries[thread->num_entries]) { entry = (globus_l_xio_win32_event_entry_t *) globus_malloc(sizeof(globus_l_xio_win32_event_entry_t)); if(!entry) { result = GlobusXIOErrorMemory("entry"); goto error_entry; } entry->owner = thread; entry->index = thread->num_entries; thread->entries[thread->num_entries] = entry; } else { entry = thread->entries[thread->num_entries]; } thread->num_entries++; entry->callback = callback; entry->user_arg = user_arg; entry->post_pending = GLOBUS_FALSE; thread->events[entry->index] = event_handle; *uentry = entry; GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_entry: GlobusXIOSystemDebugExitWithError(); return result; } /* called with thread entry locked */ static void globus_l_xio_win32_event_remove( globus_l_xio_win32_event_thread_t * thread, globus_l_xio_win32_event_entry_t * entry) { globus_l_xio_win32_event_entry_t * shift_entry; GlobusXIOName(globus_l_xio_win32_event_remove); GlobusXIOSystemDebugEnter(); thread->num_entries--; /* if entry isn't already the last one, swap it with the last one */ if(entry->index < thread->num_entries) { /* swap last entry with the 'removed' one */ shift_entry = thread->entries[thread->num_entries]; shift_entry->index = entry->index; thread->entries[shift_entry->index] = shift_entry; /* put old entry in it's place (effectively a free store) */ entry->index = thread->num_entries; thread->entries[entry->index] = entry; /* move last event object to its new location */ thread->events[shift_entry->index] = thread->events[thread->num_entries]; } GlobusXIOSystemDebugExit(); } globus_result_t globus_i_xio_win32_event_register( globus_i_xio_win32_event_entry_t * entry_handle, HANDLE event_handle, globus_i_xio_win32_event_cb_t callback, void * user_arg) { globus_l_xio_win32_event_thread_t * thread; globus_l_xio_win32_event_entry_t * entry; globus_result_t result; globus_bool_t do_wakeup = GLOBUS_FALSE; GlobusXIOName(globus_i_xio_win32_event_register); GlobusXIOSystemDebugEnter(); win32_mutex_lock(&globus_l_xio_win32_event_thread_lock); if(!globus_l_xio_win32_event_activated) { result = GlobusXIOErrorNotActivated(); goto error_deactivated; } result = globus_l_xio_win32_event_get_thread(&thread); if(result != GLOBUS_SUCCESS) { goto error_nothread; } win32_mutex_lock(&thread->lock); { result = globus_l_xio_win32_event_add( &entry, thread, event_handle, callback, user_arg); if(result != GLOBUS_SUCCESS) { goto error_add; } if(thread->sleeping && !thread->wakeup_pending) { thread->wakeup_pending = GLOBUS_TRUE; do_wakeup = GLOBUS_TRUE; } } win32_mutex_unlock(&thread->lock); win32_mutex_unlock(&globus_l_xio_win32_event_thread_lock); if(do_wakeup) { /** * I do this outside the lock to avoid immediate contention in the * thead. This leaves the possibility that the thread is gone * before this call, resulting in segv. However, this is only * possible if we get deactivated, which means someone's being dumb * and using a deactivated lib. */ SetEvent(thread->wakeup_handle); } *entry_handle = entry; GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_add: win32_mutex_unlock(&thread->lock); error_nothread: error_deactivated: win32_mutex_unlock(&globus_l_xio_win32_event_thread_lock); GlobusXIOSystemDebugExitWithError(); return result; } static globus_bool_t globus_l_xio_win32_event_unregister_cb( void * user_arg) { GlobusXIOName(globus_l_xio_win32_event_unregister_cb); GlobusXIOSystemDebugEnter(); GlobusXIOSystemDebugExit(); return GLOBUS_FALSE; } /* the complexity here is to ensure that the event object will not be waited on * when this call returns. this allows user to immediately close the event * object * * this must be called with post_lock held */ void globus_i_xio_win32_event_unregister( globus_i_xio_win32_event_entry_t entry_handle) { globus_l_xio_win32_event_thread_t * thread; GlobusXIOName(globus_i_xio_win32_event_unregister); GlobusXIOSystemDebugEnter(); thread = entry_handle->owner; entry_handle->callback = globus_l_xio_win32_event_unregister_cb; win32_mutex_lock(&thread->lock); { if(thread->sleeping && !thread->wakeup_pending) { thread->wakeup_pending = GLOBUS_TRUE; SetEvent(thread->wakeup_handle); } } win32_mutex_unlock(&thread->lock); win32_mutex_lock(&thread->wait_lock); { if(thread->sleeping) { /* thread is waiting on post_lock * wait returned a signaled event, can't just remove entry * post event to force above callback to remove entry */ globus_i_xio_win32_event_post(entry_handle); } else { /* thread is waiting on wait_lock, fake this event * above callback will cause it to be removed */ if(entry_handle->post_pending) { /* remove posted event */ globus_list_remove( &thread->pending_posts, globus_list_search( thread->pending_posts, entry_handle)); entry_handle->post_pending = GLOBUS_FALSE; } globus_l_xio_win32_event_dispatch(entry_handle); } } win32_mutex_unlock(&thread->wait_lock); GlobusXIOSystemDebugExit(); } void globus_i_xio_win32_event_lock( globus_i_xio_win32_event_entry_t entry_handle) { GlobusXIOName(globus_i_xio_win32_event_lock); GlobusXIOSystemDebugEnter(); win32_mutex_lock(&entry_handle->owner->post_lock); GlobusXIOSystemDebugExit(); } void globus_i_xio_win32_event_unlock( globus_i_xio_win32_event_entry_t entry_handle) { GlobusXIOName(globus_i_xio_win32_event_unlock); GlobusXIOSystemDebugEnter(); win32_mutex_unlock(&entry_handle->owner->post_lock); GlobusXIOSystemDebugExit(); } /* this must be called with post_lock held */ void globus_i_xio_win32_event_post( globus_i_xio_win32_event_entry_t entry_handle) { globus_l_xio_win32_event_thread_t * thread; GlobusXIOName(globus_i_xio_win32_event_post); GlobusXIOSystemDebugEnter(); thread = entry_handle->owner; if(!entry_handle->post_pending) { globus_list_insert(&thread->pending_posts, entry_handle); entry_handle->post_pending = GLOBUS_TRUE; win32_mutex_lock(&thread->lock); { if(thread->sleeping && !thread->wakeup_pending) { thread->wakeup_pending = GLOBUS_TRUE; SetEvent(thread->wakeup_handle); } } win32_mutex_unlock(&thread->lock); } GlobusXIOSystemDebugExit(); } #endif /* TARGET_ARCH_WIN32 */ globus_xio-3.6/globus_xio_load.c0000666000076400007640000001330010363625117014007 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio_load.h" #include "globus_i_xio.h" /* provides local_extensions */ #include "extensions.h" globus_extension_registry_t globus_i_xio_driver_registry; int globus_i_xio_load_init(void) { GlobusXIOName(globus_i_xio_load_init); GlobusXIODebugInternalEnter(); globus_extension_register_builtins(local_extensions); GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; } int globus_i_xio_load_destroy(void) { GlobusXIOName(globus_i_xio_load_destroy); GlobusXIODebugInternalEnter(); globus_extension_unregister_builtins(local_extensions); GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; } globus_result_t globus_xio_driver_load( const char * driver_name, globus_xio_driver_t * out_driver) { char buf[256]; globus_extension_handle_t handle; globus_bool_t activated = GLOBUS_FALSE; globus_result_t result; int rc; globus_xio_driver_hook_t * hook; GlobusXIOName(globus_xio_driver_load); GlobusXIODebugEnter(); if(!driver_name) { result = GlobusXIOErrorParameter("driver_name"); goto error_param; } if(!out_driver) { result = GlobusXIOErrorParameter("out_driver"); goto error_param; } hook = (globus_xio_driver_hook_t *) globus_extension_lookup( &handle, GLOBUS_XIO_DRIVER_REGISTRY, (void *) driver_name); if(!hook) { snprintf(buf, 256, GLOBUS_XIO_EXTENSION_FORMAT, driver_name); buf[255] = 0; rc = globus_extension_activate(buf); if(rc != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( _XIOSL("driver activation"), (globus_result_t) rc); goto error_activate; } activated = GLOBUS_TRUE; hook = (globus_xio_driver_hook_t *) globus_extension_lookup( &handle, GLOBUS_XIO_DRIVER_REGISTRY, (void *) driver_name); } if(!hook) { result = GlobusXIOErrorInvalidDriver(_XIOSL("driver lookup failed")); goto error_hook; } result = hook->init(out_driver); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed(_XIOSL("globus_xio_driver_init_t"), result); goto error_init; } globus_assert( *out_driver && "init returned success but passed back null driver"); (*out_driver)->hook = hook; (*out_driver)->extension_handle = handle; (*out_driver)->extension_activated = activated; return GLOBUS_SUCCESS; error_init: globus_extension_release(handle); error_hook: if(activated) { globus_extension_deactivate(buf); } error_activate: *out_driver = GLOBUS_NULL; error_param: GlobusXIODebugExitWithError(); return result; } globus_result_t globus_xio_driver_unload( globus_xio_driver_t driver) { globus_xio_driver_hook_t * hook; globus_extension_handle_t handle; globus_bool_t activated; globus_result_t result; char buf[256]; GlobusXIOName(globus_xio_driver_unload); GlobusXIODebugEnter(); if(!driver) { result = GlobusXIOErrorParameter("driver"); goto error_param; } hook = driver->hook; handle = driver->extension_handle; activated = driver->extension_activated; if(activated) { snprintf(buf, 256, GLOBUS_XIO_EXTENSION_FORMAT, driver->name); buf[255] = 0; } globus_i_xio_close_handles(driver); hook->destroy(driver); globus_extension_release(handle); if(activated) { globus_extension_deactivate(buf); } GlobusXIODebugExit(); return GLOBUS_SUCCESS; error_param: GlobusXIODebugExitWithError(); return result; } globus_bool_t globus_xio_driver_error_match( globus_xio_driver_t driver, globus_object_t * error, int type) { globus_bool_t match = GLOBUS_FALSE; GlobusXIOName(globus_xio_driver_error_match); GlobusXIODebugEnter(); if(driver && driver->extension_handle) { match = globus_extension_error_match( driver->extension_handle, error, type); } GlobusXIODebugExit(); return match; } globus_bool_t globus_xio_driver_error_match_with_cb( globus_xio_driver_t driver, globus_object_t * error, globus_extension_error_match_cb_t callback, void * type) { globus_bool_t match = GLOBUS_FALSE; GlobusXIOName(globus_xio_driver_error_match); GlobusXIODebugEnter(); if(driver && driver->extension_handle) { match = globus_extension_error_match_with_cb( driver->extension_handle, error, callback, type); } GlobusXIODebugExit(); return match; } globus_xio-3.6/globus_automake_pre_top0000644000076400007640000000000012225575522015316 00000000000000globus_xio-3.6/gptdata.sh0000664000076400007640000000032712225614605012454 00000000000000GPT_NAME='globus_xio' GPT_MAJOR_VERSION='3' GPT_MINOR_VERSION='6' GPT_AGE_VERSION='3' GPT_CFLAGS='@GPT_PKG_CFLAGS@' GPT_INCLUDES='@GPT_EXTERNAL_INCLUDES@' GPT_LIBS='@GPT_EXTERNAL_LIBS@' GPT_BUILD_WITH_FLAVORS='yes' globus_xio-3.6/pkgdata/0000775000076400007640000000000012225614640012164 500000000000000globus_xio-3.6/pkgdata/pkg_data_src.gpt.in0000666000076400007640000000273312225561753015663 00000000000000 Globus XIO Framework Communication @GPT_PKG_CFLAGS@ @GPT_PKG_LDFLAGS@ @GPT_EXTERNAL_INCLUDES@ -lglobus_xio @GPT_EXTERNAL_LIBS@ globus_xio-3.6/pkgdata/pkg_data_src.pc.in0000664000076400007640000000073412225614600015456 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ GLOBUS_FLAVOR_NAME=@GLOBUS_FLAVOR_NAME@ flavorincludedir=@flavorincludedir@ Name: globus-xio Description: Globus Toolkit - Globus XIO Framework Version: 3.6 Requires.private: globus-common >= 14 @GPT_PKGCONFIG_DEPENDENCIES@ globus-core >= 8 Libs: -L${libdir} -lglobus_xio Libs.private: @GPT_EXTERNAL_LIBS@ Cflags: @GPT_PKG_CFLAGS@ -I${includedir} -I${flavorincludedir} @GPT_EXTERNAL_INCLUDES@ globus_xio-3.6/pkgdata/Makefile.am0000644000076400007640000000461012163267535014147 00000000000000include $(top_srcdir)/globus_automake_pre FILELIST_FILES = noflavor_data.filelist \ $(GLOBUS_FLAVOR_NAME)_dev.filelist \ noflavor_doc.filelist \ $(GLOBUS_FLAVOR_NAME)_pgm.filelist \ $(GLOBUS_FLAVOR_NAME)_pgm_static.filelist \ $(GLOBUS_FLAVOR_NAME)_rtl.filelist METADATA_FILES = \ pkg_data_noflavor_data.gpt \ pkg_data_$(GLOBUS_FLAVOR_NAME)_dev.gpt \ pkg_data_noflavor_doc.gpt \ pkg_data_$(GLOBUS_FLAVOR_NAME)_pgm.gpt \ pkg_data_$(GLOBUS_FLAVOR_NAME)_pgm_static.gpt \ pkg_data_$(GLOBUS_FLAVOR_NAME)_rtl.gpt pkg_DATA = $(FILELIST_FILES) $(METADATA_FILES) pkgconfdir = @pkgconfdir@ ## pkgconf = [ DATA ] pkgconf_DATA = @pkgconffile@ filelist_file: $(MAKEFILE_AMS) @for p in $(FILELIST_FILES); do \ if test -f "$$p"; then \ rm -f $$p; \ fi; \ done $(pkg_DATA): all_filelists all_filelists: filelist_file @(cd .. && $(MAKE) $(AM_MAKEFLAGS) filelist) \ ## This trick allows "-k" to keep its natural meaning when running a ## recursive rule. || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; # # Override the normal install target to avoid dying when a given # kind of metadata file is missing by calling "true" install-pkgDATA: $(pkg_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdir)" || $(mkinstalldirs) "$(DESTDIR)$(pkgdir)"; @list='$(pkg_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=`echo $$p | sed -e 's|^.*/||'`; \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pkgdir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pkgdir)/$$f"; \ done || true @list='$(pkg_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=`echo $$p | sed -e 's|^.*/||'`; \ if expr $$p : '.*filelist$$' > /dev/null ; then \ if test `cat $$d$$p | wc -l` = 2; then \ listtype=`echo "$$p" | sed -e 's!\.filelist!!'`; \ rm "$(DESTDIR)$(pkgdir)/$$f" ; \ rm "$(DESTDIR)$(pkgdir)/pkg_data_$${listtype}.gpt"; \ fi ; \ fi; \ done || true $(METADATA_FILES): pkg_data_src.gpt @$(GPT_LOCATION)/sbin/gpt_generate_bin_pkg_data \ --flavor=$(GLOBUS_FLAVOR_NAME) pkg_data_src.gpt EXTRA_DIST = $(pkgconffile_in) distclean-local: @if test -f master.filelist; then \ rm *.filelist; \ fi; \ if test -f pkg_data_noflavor_data.gpt; then \ rm pkg_data_*.gpt; \ fi include $(top_srcdir)/globus_automake_post globus_xio-3.6/pkgdata/Makefile.in0000664000076400007640000005110312225614604014151 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/pkg_data_src.gpt.in $(srcdir)/pkg_data_src.pc.in \ $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = pkgdata ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = $pkgconffile pkg_data_src.gpt depcomp = am__depfiles_maybe = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(pkgconfdir)" pkgDATA_INSTALL = $(INSTALL_DATA) pkgconfDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkg_DATA) $(pkgconf_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies FILELIST_FILES = noflavor_data.filelist \ $(GLOBUS_FLAVOR_NAME)_dev.filelist \ noflavor_doc.filelist \ $(GLOBUS_FLAVOR_NAME)_pgm.filelist \ $(GLOBUS_FLAVOR_NAME)_pgm_static.filelist \ $(GLOBUS_FLAVOR_NAME)_rtl.filelist METADATA_FILES = \ pkg_data_noflavor_data.gpt \ pkg_data_$(GLOBUS_FLAVOR_NAME)_dev.gpt \ pkg_data_noflavor_doc.gpt \ pkg_data_$(GLOBUS_FLAVOR_NAME)_pgm.gpt \ pkg_data_$(GLOBUS_FLAVOR_NAME)_pgm_static.gpt \ pkg_data_$(GLOBUS_FLAVOR_NAME)_rtl.gpt pkg_DATA = $(FILELIST_FILES) $(METADATA_FILES) pkgconf_DATA = @pkgconffile@ EXTRA_DIST = $(pkgconffile_in) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign pkgdata/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign pkgdata/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $pkgconffile: $(top_builddir)/config.status $(srcdir)/pkg_data_src.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ pkg_data_src.gpt: $(top_builddir)/config.status $(srcdir)/pkg_data_src.gpt.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: uninstall-pkgDATA: @$(NORMAL_UNINSTALL) @list='$(pkg_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdir)/$$f"; \ done install-pkgconfDATA: $(pkgconf_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfdir)" @list='$(pkgconf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfdir)/$$f'"; \ $(pkgconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfdir)/$$f"; \ done uninstall-pkgconfDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconf_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(pkgconfdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-local dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pkgDATA install-pkgconfDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pkgDATA \ uninstall-pkgconfDATA .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distclean-local \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-pkgDATA install-pkgconfDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am uninstall-pkgDATA uninstall-pkgconfDATA filelist_file: $(MAKEFILE_AMS) @for p in $(FILELIST_FILES); do \ if test -f "$$p"; then \ rm -f $$p; \ fi; \ done $(pkg_DATA): all_filelists all_filelists: filelist_file @(cd .. && $(MAKE) $(AM_MAKEFLAGS) filelist) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; # # Override the normal install target to avoid dying when a given # kind of metadata file is missing by calling "true" install-pkgDATA: $(pkg_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdir)" || $(mkinstalldirs) "$(DESTDIR)$(pkgdir)"; @list='$(pkg_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=`echo $$p | sed -e 's|^.*/||'`; \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pkgdir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pkgdir)/$$f"; \ done || true @list='$(pkg_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=`echo $$p | sed -e 's|^.*/||'`; \ if expr $$p : '.*filelist$$' > /dev/null ; then \ if test `cat $$d$$p | wc -l` = 2; then \ listtype=`echo "$$p" | sed -e 's!\.filelist!!'`; \ rm "$(DESTDIR)$(pkgdir)/$$f" ; \ rm "$(DESTDIR)$(pkgdir)/pkg_data_$${listtype}.gpt"; \ fi ; \ fi; \ done || true $(METADATA_FILES): pkg_data_src.gpt @$(GPT_LOCATION)/sbin/gpt_generate_bin_pkg_data \ --flavor=$(GLOBUS_FLAVOR_NAME) pkg_data_src.gpt distclean-local: @if test -f master.filelist; then \ rm *.filelist; \ fi; \ if test -f pkg_data_noflavor_data.gpt; then \ rm pkg_data_*.gpt; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-pkgDATA link-pkgconfDATA : unlink: unlink-recursive unlink-pkgDATA unlink-pkgconfDATA : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-pkgDATA unlink-pkgDATA filelist-pkgDATA link-pkgconfDATA unlink-pkgconfDATA filelist-pkgconfDATA filelist: filelist-recursive filelist-pkgDATA filelist-pkgconfDATA : link-pkgDATA: $(pkg_DATA) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(pkgdir) @list='$(pkg_DATA)'; for p in $$list; do \ mydir=`pwd`; \ target_p=$(DESTDIR)$(pkgdir)/$$p; \ if test -f $(srcdir)/$$p; then \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$fullsrcdir/$$p $$target_p"; \ ln -s $$fullsrcdir/$$p $$target_p; \ fi; \ else if test -f $$p; then \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$mydir/$$p $$target_p"; \ ln -s $$mydir/$$p $$target_p; \ fi; \ fi; fi; \ done unlink-pkgDATA: @$(NORMAL_UNINSTALL) @list='$(pkg_DATA)'; for p in $$list; do \ target_p=$(DESTDIR)$(pkgdir)/$$p; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-pkgDATA: @list='$(pkg_DATA)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ dirname='pkg'; \ origp="$$p" ; \ p="`echo $(pkgdir)/$$p | sed -e 's!^$(prefix)!!'`"; \ case "$$dirname-$$origp" in \ *-pkg_data_*.gpt) \ type=`echo $$origp | sed -e 's!^pkg_data_!!' -e 's!.gpt$$!!'`; \ echo "$$p" >> "$${filelistdir}/$${type}.filelist" ; \ ;; \ *-*.filelist) \ echo "$$p" >> "$${filelistdir}/$${origp}" ; \ ;; \ *-*.pc) \ echo "$$p" >> "$${filelistdir}/$(GLOBUS_FLAVOR_NAME)_dev.filelist"; \ ;; \ *-*.pm) \ echo "$$p" >> "$${filelistdir}/$(GLOBUS_FLAVOR_NAME)_rtl.filelist"; \ ;; \ *doc-*) \ echo "$$p" >> "$${filelistdir}/noflavor_doc.filelist"; \ ;; \ *) \ echo "$$p" >> "$${filelistdir}/noflavor_data.filelist"; \ ;; \ esac ; \ done link-pkgconfDATA: $(pkgconf_DATA) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(pkgconfdir) @list='$(pkgconf_DATA)'; for p in $$list; do \ mydir=`pwd`; \ target_p=$(DESTDIR)$(pkgconfdir)/$$p; \ if test -f $(srcdir)/$$p; then \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$fullsrcdir/$$p $$target_p"; \ ln -s $$fullsrcdir/$$p $$target_p; \ fi; \ else if test -f $$p; then \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$mydir/$$p $$target_p"; \ ln -s $$mydir/$$p $$target_p; \ fi; \ fi; fi; \ done unlink-pkgconfDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconf_DATA)'; for p in $$list; do \ target_p=$(DESTDIR)$(pkgconfdir)/$$p; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-pkgconfDATA: @list='$(pkgconf_DATA)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ dirname='pkgconf'; \ origp="$$p" ; \ p="`echo $(pkgconfdir)/$$p | sed -e 's!^$(prefix)!!'`"; \ case "$$dirname-$$origp" in \ *-pkg_data_*.gpt) \ type=`echo $$origp | sed -e 's!^pkg_data_!!' -e 's!.gpt$$!!'`; \ echo "$$p" >> "$${filelistdir}/$${type}.filelist" ; \ ;; \ *-*.filelist) \ echo "$$p" >> "$${filelistdir}/$${origp}" ; \ ;; \ *-*.pc) \ echo "$$p" >> "$${filelistdir}/$(GLOBUS_FLAVOR_NAME)_dev.filelist"; \ ;; \ *-*.pm) \ echo "$$p" >> "$${filelistdir}/$(GLOBUS_FLAVOR_NAME)_rtl.filelist"; \ ;; \ *doc-*) \ echo "$$p" >> "$${filelistdir}/noflavor_doc.filelist"; \ ;; \ *) \ echo "$$p" >> "$${filelistdir}/noflavor_data.filelist"; \ ;; \ esac ; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/globus_i_xio_system_common.h0000666000076400007640000004036211522621705016306 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_I_XIO_SYSTEM_COMMON_INCLUDE #define GLOBUS_I_XIO_SYSTEM_COMMON_INCLUDE #include "config.h" #include "globus_common.h" #include "globus_xio_system.h" #include "globus_xio_driver.h" GlobusDebugDeclare(GLOBUS_XIO_SYSTEM); #define GlobusXIOSystemDebugPrintf(level, message) \ GlobusDebugPrintf(GLOBUS_XIO_SYSTEM, level, message) #define GlobusXIOSystemDebugFwrite(level, buffer, size, count) \ GlobusDebugFwrite(GLOBUS_XIO_SYSTEM, level, buffer, size, count) #define GlobusXIOSystemDebugEnter() \ GlobusXIOSystemDebugPrintf( \ GLOBUS_I_XIO_SYSTEM_DEBUG_TRACE, \ ("[%s] Entering\n", _xio_name)) #define GlobusXIOSystemDebugExit() \ GlobusXIOSystemDebugPrintf( \ GLOBUS_I_XIO_SYSTEM_DEBUG_TRACE, \ ("[%s] Exiting\n", _xio_name)) #define GlobusXIOSystemDebugExitWithError() \ GlobusXIOSystemDebugPrintf( \ GLOBUS_I_XIO_SYSTEM_DEBUG_TRACE, \ ("[%s] Exiting with error\n", _xio_name)) #define GlobusXIOSystemDebugEnterFD(fd) \ GlobusXIOSystemDebugPrintf( \ GLOBUS_I_XIO_SYSTEM_DEBUG_TRACE, \ ("[%s] fd=%lu, Entering\n", _xio_name, (unsigned long)(fd))) #define GlobusXIOSystemDebugExitFD(fd) \ GlobusXIOSystemDebugPrintf( \ GLOBUS_I_XIO_SYSTEM_DEBUG_TRACE, \ ("[%s] fd=%lu, Exiting\n", _xio_name, (unsigned long)(fd))) #define GlobusXIOSystemDebugExitWithErrorFD(fd) \ GlobusXIOSystemDebugPrintf( \ GLOBUS_I_XIO_SYSTEM_DEBUG_TRACE, \ ("[%s] fd=%lu, Exiting with error\n", _xio_name, (unsigned long)(fd))) #ifdef WIN32 #include #define GlobusXIOSystemUpdateErrno() (errno = WSAGetLastError()) #elif defined(TARGET_ARCH_NETOS) #define GlobusXIOSystemUpdateErrno() (errno = getErrno()) #else #define GlobusXIOSystemUpdateErrno() #endif #define GlobusXIOSystemDebugRawBuffer(nbytes, buffer) \ do \ { \ GlobusXIOSystemDebugPrintf( \ GLOBUS_I_XIO_SYSTEM_DEBUG_RAW, \ ("[%s] Begin RAW data ************\n", _xio_name)); \ GlobusXIOSystemDebugFwrite( \ GLOBUS_I_XIO_SYSTEM_DEBUG_RAW, buffer, 1, nbytes); \ GlobusXIOSystemDebugPrintf( \ GLOBUS_I_XIO_SYSTEM_DEBUG_RAW, \ ("\n[%s] End RAW data ************\n", _xio_name)); \ } while(0) #define GlobusXIOSystemDebugRawIovec(nbytes, iovec) \ do \ { \ if(GlobusDebugTrue( \ GLOBUS_XIO_SYSTEM, GLOBUS_I_XIO_SYSTEM_DEBUG_RAW)) \ { \ globus_size_t _bytes = nbytes; \ int _i = 0; \ \ while(_bytes > 0) \ { \ globus_size_t _len = (iovec)[_i].iov_len; \ \ if(_bytes < _len) \ { \ _len = _bytes; \ } \ _bytes -= _len; \ \ GlobusDebugMyPrintf( \ GLOBUS_XIO_SYSTEM, \ ("[%s] Begin RAW data %i ************\n", \ _xio_name, _i)); \ GlobusDebugMyFwrite( \ GLOBUS_XIO_SYSTEM, \ (iovec)[_i].iov_base, 1, _len); \ GlobusDebugMyPrintf( \ GLOBUS_XIO_SYSTEM, \ ("\n[%s] End RAW data %i ************\n", \ _xio_name, _i)); \ _i++; \ } \ } \ } while(0) #define GlobusIXIOSystemAllocOperation(op_info) \ do \ { \ globus_i_xio_system_op_info_t * _op_info; \ \ _op_info = (globus_i_xio_system_op_info_t *) \ globus_memory_pop_node(&globus_i_xio_system_op_info_memory); \ if(_op_info) \ { \ memset(_op_info, 0, sizeof(globus_i_xio_system_op_info_t)); \ } \ (op_info) = _op_info; \ } while(0) #define GlobusIXIOSystemFreeOperation(op_info) \ (globus_memory_push_node(&globus_i_xio_system_op_info_memory, (op_info))) #define GlobusIXIOSystemAllocIovec(count, iov) \ do \ { \ int _count; \ \ _count = (count); \ \ if(_count < 10) \ { \ (iov) = (struct iovec *) \ globus_memory_pop_node(&globus_i_xio_system_iov_memory); \ } \ else \ { \ (iov) = (struct iovec *) \ globus_malloc(sizeof(struct iovec) * _count); \ } \ } while(0) #define GlobusIXIOSystemFreeIovec(count, iovec) \ do \ { \ int _count = (count); \ if(_count < 10) \ { \ globus_memory_push_node( \ &globus_i_xio_system_iov_memory, (iovec)); \ } \ else \ { \ globus_free((iovec)); \ } \ } while(0) extern globus_memory_t globus_i_xio_system_op_info_memory; extern globus_memory_t globus_i_xio_system_iov_memory; enum globus_i_xio_system_error_levels { GLOBUS_I_XIO_SYSTEM_DEBUG_TRACE = 1, GLOBUS_I_XIO_SYSTEM_DEBUG_DATA = 2, GLOBUS_I_XIO_SYSTEM_DEBUG_INFO = 4, GLOBUS_I_XIO_SYSTEM_DEBUG_RAW = 8 }; typedef enum { GLOBUS_I_XIO_SYSTEM_OP_ACCEPT, GLOBUS_I_XIO_SYSTEM_OP_CONNECT, GLOBUS_I_XIO_SYSTEM_OP_READ, GLOBUS_I_XIO_SYSTEM_OP_WRITE } globus_i_xio_system_op_type_t; typedef enum { /* initial state */ GLOBUS_I_XIO_SYSTEM_OP_NEW, /* transition to this requires fdset lock */ GLOBUS_I_XIO_SYSTEM_OP_PENDING, /* transition to this requires cancel lock */ GLOBUS_I_XIO_SYSTEM_OP_COMPLETE, /* transition to this requires fdset and cancel lock */ GLOBUS_I_XIO_SYSTEM_OP_CANCELED } globus_i_xio_system_op_state_t; #if !defined(HAVE_RECVMSG) || defined(WIN32) struct msghdr { void * msg_name; int msg_namelen; struct iovec * msg_iov; int msg_iovlen; void * msg_control; int msg_controllen; int msg_flags; }; #endif typedef struct { /* common members */ globus_i_xio_system_op_type_t type; globus_i_xio_system_op_state_t state; globus_xio_operation_t op; #ifndef WIN32 struct globus_l_xio_system_s * handle; #else struct globus_l_xio_win32_socket_s *handle; #endif globus_object_t * error; void * user_arg; /* used for reads/writes, 0 for others. here to simplify some things */ globus_size_t nbytes; globus_size_t waitforbytes; globus_off_t offset; union { /* non data ops -- connect, accept */ struct { globus_xio_system_callback_t callback; globus_xio_system_socket_t * out_fd; } non_data; /* data ops */ struct { globus_xio_system_data_callback_t callback; struct iovec * start_iov; int start_iovc; struct iovec * iov; int iovc; globus_sockaddr_t * addr; int flags; } data; } sop; } globus_i_xio_system_op_info_t; globus_result_t globus_i_xio_system_try_read( globus_xio_system_file_t fd, void * buf, globus_size_t buflen, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_readv( globus_xio_system_file_t fd, const globus_xio_iovec_t * iov, int iovc, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_recv( globus_xio_system_socket_t fd, void * buf, globus_size_t buflen, int flags, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_recvfrom( globus_xio_system_socket_t fd, void * buf, globus_size_t buflen, int flags, globus_sockaddr_t * from, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_recvmsg( globus_xio_system_socket_t fd, struct msghdr * msghdr, int flags, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_write( globus_xio_system_file_t fd, void * buf, globus_size_t buflen, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_writev( globus_xio_system_file_t fd, const globus_xio_iovec_t * iov, int iovc, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_send( globus_xio_system_socket_t fd, void * buf, globus_size_t buflen, int flags, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_sendto( globus_xio_system_socket_t fd, void * buf, globus_size_t buflen, int flags, const globus_sockaddr_t * to, globus_size_t * nbytes); globus_result_t globus_i_xio_system_try_sendmsg( globus_xio_system_socket_t fd, struct msghdr * msghdr, int flags, globus_size_t * nbytes); globus_result_t globus_i_xio_system_file_try_read( globus_xio_system_file_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t * nbytes); globus_result_t globus_i_xio_system_file_try_write( globus_xio_system_file_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t * nbytes); globus_result_t globus_i_xio_system_socket_try_read( globus_xio_system_socket_t handle, const globus_xio_iovec_t * iov, int iovc, int flags, globus_sockaddr_t * from, globus_size_t * nbytes); globus_result_t globus_i_xio_system_socket_try_write( globus_xio_system_socket_t handle, const globus_xio_iovec_t * iov, int iovc, int flags, globus_sockaddr_t * to, globus_size_t * nbytes); int globus_i_xio_system_common_activate(void); int globus_i_xio_system_common_deactivate(void); #endif globus_xio-3.6/dirt.sh0000666000076400007640000000005412225561753011776 00000000000000DIRT_TIMESTAMP=1381426155 DIRT_BRANCH_ID=83 globus_xio-3.6/bootstrap0000777000076400007640000000200711522621705012434 00000000000000#! /bin/sh # checking for the GLOBUS_LOCATION if test "x$GLOBUS_LOCATION" = "x"; then echo "Using default GLOBUS_LOCATION of /usr" GLOBUS_LOCATION="/usr" fi if [ ! -f ${GLOBUS_LOCATION}/share/globus/globus-bootstrap.sh ]; then echo "ERROR: Unable to locate \${GLOBUS_LOCATION}/share/globus/globus-bootstrap.sh" echo " Please ensure that you have installed the globus-core package and" echo " that GLOBUS_LOCATION is set to the proper directory" exit fi echo -n "Checking for builtin drivers... " builtins=`ls builtins | grep -v CVS |grep -v Makefile` builtin_makefiles= delim= if test "X$builtins" != "X" ; then echo for builtin in $builtins ; do if test -f builtins/$builtin/Makefile.am ; then builtin_makefiles="$builtin_makefiles builtins/$builtin/Makefile" echo "Including driver: $builtin" fi done else echo "none found" fi cp -f configure.in.in configure.in echo "$builtin_makefiles)" >> configure.in . ${GLOBUS_LOCATION}/share/globus/globus-bootstrap.sh globus_xio-3.6/aclocal.m40000664000076400007640000104031612225614576012346 00000000000000# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 48 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR dnl dnl Doxygen related macros dnl AC_DEFUN([LAC_DOXYGEN_PROJECT],dnl [ lac_doxygen_project=`echo "$1" | sed -e 's/_/ /g'` AC_SUBST(lac_doxygen_project) ]) AC_DEFUN([LAC_DOXYGEN_SOURCE_DIRS],dnl [ lac_doxygen_srcdirs=[$1] AC_SUBST(lac_doxygen_srcdirs) ]) AC_DEFUN([LAC_DOXYGEN_INPUT_FILTER],dnl [ lac_doxygen_input_filter=[$1] AC_SUBST(lac_doxygen_input_filter) ]) AC_DEFUN([LAC_DOXYGEN_OUTPUT_TAGFILE],dnl [ lac_doxygen_output_tagfile=[$1] AC_SUBST(lac_doxygen_output_tagfile) ]) AC_DEFUN([LAC_DOXYGEN_TAGFILES],dnl [ lac_doxygen_tagfiles="" for x in "" $1; do if test "X$x" != "X" ; then lac_tag_base=`echo ${x} | sed -e 's|.*/||' -e 's|\.tag$||'` lac_tag="${lac_tag_base}.tag" lac_doxygen_tagfiles="$lac_doxygen_tagfiles $x" lac_doxygen_internal_tagfiles="$lac_doxygen_internal_tagfiles ${x}i" lac_html_dir=`echo ${x} | sed -e 's|.*/\(.*/html\)/.*|../../\1|'` lac_doxygen_installdox="$lac_doxygen_installdox -l${lac_tag}@${lac_html_dir}" fi done AC_SUBST(lac_doxygen_tagfiles) AC_SUBST(lac_doxygen_internal_tagfiles) AC_SUBST(lac_doxygen_installdox) ]) AC_DEFUN([LAC_DOXYGEN_FILE_PATTERNS],dnl [ lac_doxygen_file_patterns=[$1] ]) AC_DEFUN([LAC_DOXYGEN_EXAMPLE_DIR],dnl [ lac_doxygen_examples=[$1] ]) AC_DEFUN([LAC_DOXYGEN_PREDEFINES],dnl [ lac_doxygen_predefines=[$1] ]) AC_DEFUN([LAC_DOXYGEN],dnl [ AC_ARG_ENABLE(doxygen, AC_HELP_STRING([--enable-doxygen[[=PATH]]], [Use Doxygen to generate doxygen. If specified, PATH is the path to the doxygen executable; otherwise it is autodiscovered]), [ if test "$enableval" = "yes"; then AC_PATH_PROG(DOXYGEN, doxygen, [ AC_MSG_ERROR(Doxygen installation not found) ]) else DOXYGEN="$enableval" AC_SUBST(DOXYGEN) fi ], [ DOXYGEN="" AC_SUBST(DOXYGEN) ]) AC_ARG_ENABLE(internal-doc, AC_HELP_STRING( [--enable-internal-doc], [Generate Doxygen documentation for internal functions. Requires --enable-doxygen]), [ DOXYFILE="Doxyfile-internal" AC_SUBST(DOXYFILE) ], [ DOXYFILE="Doxyfile" AC_SUBST(DOXYFILE) ]) if test -n "$DOXYGEN" ; then AC_PATH_PROG(DOT, dot) if test -z "$GLOBUS_SH_PERL" ; then AC_PATH_PROG(PERL, perl) else PERL="$GLOBUS_SH_PERL" AC_SUBST(PERL) fi if test "$DOT" != ""; then HAVE_DOT=YES else HAVE_DOT=NO fi AC_SUBST(HAVE_DOT) LAC_DOXYGEN_SOURCE_DIRS($1) LAC_DOXYGEN_FILE_PATTERNS($2) LAC_DOXYGEN_INPUT_FILTER($3) LAC_DOXYGEN_PROJECT($GPT_NAME) LAC_DOXYGEN_OUTPUT_TAGFILE($GPT_NAME) lac_dep_check="${GLOBUS_LOCATION:-$ac_default_prefix}/sbin/globus-build-doxygen-dependencies" if test ! -x $lac_dep_check ; then # assume we are dealing with common lac_dep_check="$srcdir/scripts/globus-build-doxygen-dependencies" chmod 0755 $lac_dep_check fi AC_MSG_CHECKING([documentation dependencies]) tagfiles="`$lac_dep_check -src $srcdir/pkgdata/pkg_data_src.gpt.in 2>/dev/null`" if test "$?" != "0"; then AC_MSG_RESULT([failed]) AC_MSG_ERROR([Documentation dependencies could not be satisfied.]) else AC_MSG_RESULT([ok]) fi LAC_DOXYGEN_TAGFILES($tagfiles) AC_SUBST(lac_doxygen_file_patterns) AC_SUBST(lac_doxygen_examples) AC_SUBST(lac_doxygen_predefines) fi ] ) AC_DEFUN([CHECK_NEED_LSOCKET], [ dnl dnl Check whether we need -lsocket dnl AC_MSG_CHECKING(for -lsocket) if test "${lac_cv_lsocket+set}" = set; then AC_MSG_RESULT([(cached) $lac_cv_lsocket]) else AC_TRY_LINK( [ #include #include ], [ int fd; fd = socket(AF_INET,SOCK_STREAM,0); ], [ lac_cv_lsocket="no" ], [ lac_cv_lsocket="yes" EXTERNAL_LIBS="$EXTERNAL_LIBS -lsocket" ] ) AC_MSG_RESULT($lac_cv_lsocket) fi ]) AC_DEFUN([CHECK_NEED_LNSL], [ dnl dnl Check whether we need -lnsl dnl AC_MSG_CHECKING(for -lnsl) if test "${lac_cv_lnsl+set}" = set; then AC_MSG_RESULT([(cached) $lac_cv_lnsl]) else AC_TRY_LINK( [ #include ], [ struct hostent * host; host = gethostbyname("localhost"); ], [ lac_cv_lnsl="no" ], [ lac_cv_lnsl="yes" EXTERNAL_LIBS="$EXTERNAL_LIBS -lnsl" ] ) AC_MSG_RESULT($lac_cv_lnsl) fi ]) AC_DEFUN([GLOBUS_INITIALIZERS], [ initializer_prefix="${prefix}" test "$initializer_prefix" = "NONE" && initializer_prefix="$ac_default_prefix" initializer_exec_prefix="${exec_prefix}" test "$initializer_exec_prefix" = "NONE" && initializer_exec_prefix='${prefix}' test "$datarootdir" = "" && datarootdir='${prefix}/share' AC_SUBST(datarootdir) case $guess_libdir:${host}:${libdir} in 1:*linux*:*lib64) libdir32="${libdir%%64}" libdir64="${libdir}" libdir_choice=" case \`uname -m\` in aarch64|ppc64|s390x|sparc64|x86_64) libdir=\"$libdir64\" ;; *) libdir=\"$libdir32\" ;; esac " perl_libdir_choice=" if (\`uname -m\` =~ /^(aarch64|ppc64|s390x|sparc64|x86_64)\$/) { \$libdir = \"$libdir64\"; } else { \$libdir = \"$libdir32\"; } " ;; 1:*linux*:*lib) libdir32="${libdir}" libdir64="${libdir}64" libdir_choice=" case \`uname -m\` in aarch64|ppc64|s390x|sparc64|x86_64) libdir=\"$libdir64\" ;; *) libdir=\"$libdir32\" ;; esac " perl_libdir_choice=" if (\`uname -m\` =~ /^(aarch64|ppc64|s390x|sparc64|x86_64)\$/) { \$libdir = \"$libdir64\"; } else { \$libdir = \"$libdir32\"; } " ;; *) libdir_choice="libdir=\"$libdir\"" perl_libdir_choice=" \$libdir = \"$libdir\";"; ;; esac echo "$libdir_choice" | sed "s/\"/'/g" > globus-script-libdir-choice GLOBUS_LIBDIR_CHOICE="globus-script-libdir-choice" echo "$perl_libdir_choice" | sed "s/^ //" > globus-perl-libdir-choice GLOBUS_PERL_LIBDIR_CHOICE="globus-perl-libdir-choice" AC_SUBST_FILE(GLOBUS_LIBDIR_CHOICE) AC_SUBST_FILE(GLOBUS_PERL_LIBDIR_CHOICE) cat > globus-script-initializer << EOF if test -n "\${GLOBUS_LOCATION}" ; then prefix="\${GLOBUS_LOCATION}" else prefix="$initializer_prefix" fi exec_prefix="$initializer_exec_prefix" sbindir="$sbindir" bindir="$bindir" $libdir_choice includedir="$includedir" datarootdir="$datarootdir" datadir="$datadir" libexecdir="$libexecdir" sysconfdir="$sysconfdir" sharedstatedir="$sharedstatedir" localstatedir="$localstatedir" aclocaldir="$aclocaldir" EOF GLOBUS_SCRIPT_INITIALIZER=globus-script-initializer AC_SUBST_FILE(GLOBUS_SCRIPT_INITIALIZER) cat > globus-perl-initializer << EOF my (\$prefix, \$exec_prefix, \$libdir, \$perlmoduledir); my (\$sbindir, \$bindir, \$includedir, \$datarootdir, \$datadir, \$libexecdir, \$sysconfdir, \$sharedstatedir, \$localstatedir, \$aclocaldir); BEGIN { if (exists \$ENV{GLOBUS_LOCATION}) { \$prefix = \$ENV{GLOBUS_LOCATION}; } else { \$prefix = "$initializer_prefix"; } \$exec_prefix = "$initializer_exec_prefix"; $perl_libdir_choice \$sbindir = "$sbindir"; \$bindir = "$bindir"; \$includedir = "$includedir"; \$datarootdir = "$datarootdir"; \$datadir = "$datadir"; \$perlmoduledir = "$perlmoduledir"; \$libexecdir = "$libexecdir"; \$sysconfdir = "$sysconfdir"; \$sharedstatedir = "$sharedstatedir"; \$localstatedir = "$localstatedir"; \$aclocaldir = "$aclocaldir"; if (exists \$ENV{GPT_LOCATION}) { unshift(@INC, "\$ENV{GPT_LOCATION}/lib/perl"); } unshift(@INC, "\${perlmoduledir}"); } EOF GLOBUS_PERL_INITIALIZER=globus-perl-initializer AC_SUBST_FILE(GLOBUS_PERL_INITIALIZER) ]) AC_DEFUN([GLOBUS_INIT], [ AM_MAINTAINER_MODE dnl Default prefix is $GLOBUS_LOCATION, falling back to /usr if that dnl is not present in the environment. Can be overridden by using dnl --prefix during configure time AC_PREFIX_DEFAULT(${GLOBUS_LOCATION:-/usr}) # checking for the GLOBUS_LOCATION GLOBUS_LOCATION="${GLOBUS_LOCATION:-/usr}" GPT_LOCATION="${GPT_LOCATION:-${GLOBUS_LOCATION}}" # This is created in globus-bootstrap.sh . "${srcdir}/gptdata.sh" if test "x$GPT_BUILD_WITH_FLAVORS" = "xno"; then GLOBUS_FLAVOR_NAME="noflavor" fi eval_path() { _pathval="[$]1" _old_pathval="" while test "$_pathval" != "$_old_pathval"; do _old_pathval="$_pathval" eval "_pathval=\"$_pathval\"" done echo "$_pathval" } AC_ARG_WITH(flavor, AC_HELP_STRING([--with-flavor=FLAVOR], [Specify the globus build flavor or without-flavor for a flavor independent]), [ case $withval in no) NO_FLAVOR="yes" ;; yes) echo "Please specify a globus build flavor" >&2 exit 1 ;; *) if test "x$GLOBUS_FLAVOR_NAME" = "xnoflavor"; then echo "Warning: package doesn't build with flavors $withval ignored" >&2 echo "Warning: $withval ignored" >&2 else GLOBUS_FLAVOR_NAME=$withval if test ! -f "${GLOBUS_LOCATION}/share/globus/flavors/flavor_$GLOBUS_FLAVOR_NAME.gpt"; then echo "ERROR: Flavor $GLOBUS_FLAVOR_NAME has not been installed" >&2 exit 1 fi fi ;; esac ], [ if test "x$GLOBUS_FLAVOR_NAME" = "x"; then echo "Please specify a globus build flavor" >&2 exit 1 fi ] ) GPT_INIT AM_CONDITIONAL(WITHOUT_FLAVORS, test "$NO_FLAVOR" = "yes") AC_SUBST(GLOBUS_FLAVOR_NAME) # get the environment scripts . ${GLOBUS_LOCATION}/share/globus/globus-build-env-$GLOBUS_FLAVOR_NAME.sh GLOBUS_INITIALIZERS doxygendir="`eval_path '$doxygendir'`" AC_SUBST(CC) AC_SUBST(CPP) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LD) AC_SUBST(LDFLAGS) AC_SUBST(LIBS) AC_SUBST(CXX) AC_SUBST(CXXCPP) AC_SUBST(CXXFLAGS) AC_SUBST(INSURE) AC_SUBST(DOXYGEN) AC_SUBST(F77) AC_SUBST(F77FLAGS) AC_SUBST(F90) AC_SUBST(F90FLAGS) AC_SUBST(AR) AC_SUBST(ARFLAGS) AC_SUBST(RANLIB) AC_SUBST(PERL) AC_SUBST(CROSS) AC_SUBST(cross_compiling) AC_SUBST(OBJEXT) AC_SUBST(EXEEXT) AC_SUBST(OBJECT_MODE) AC_SUBST(setupdir) AC_SUBST(testdir) AC_SUBST(flavorincludedir) AC_SUBST(pkgdir) AC_SUBST(aclocaldir) AC_SUBST(perlmoduledir) AC_SUBST(doxygendir) dnl define FILELIST_FILE variable FILELIST_FILE=`pwd`; FILELIST_FILE="$FILELIST_FILE/pkgdata/master.filelist" AC_SUBST(FILELIST_FILE) dnl export version information dnl branch id 99999 means that timestamp refers to build time if test -f $srcdir/dirt.sh ; then . $srcdir/dirt.sh else DIRT_TIMESTAMP=`perl -e 'print time'` DIRT_BRANCH_ID=99999 fi dnl GPT_MAJOR_VERSION and GPT_MINOR_VERSION provided by GPT_INIT AC_SUBST(GPT_MAJOR_VERSION) AC_SUBST(GPT_MINOR_VERSION) AC_SUBST(GPT_AGE_VERSION) AC_SUBST(DIRT_TIMESTAMP) AC_SUBST(DIRT_BRANCH_ID) AC_ARG_ENABLE([programs], AC_HELP_STRING([--disable-programs], [Don't compile/link programs]), [case "${enableval}" in yes) ENABLE_PROGRAMS=true ;; no) ENABLE_PROGRAMS=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-programs]) ;; esac], [ENABLE_PROGRAMS=true]) AM_CONDITIONAL(ENABLE_PROGRAMS, test "x$ENABLE_PROGRAMS" = "xtrue") dnl END OF GLOBUS_INIT ]) dnl Nothing to do here after ensure flavoring is removed AC_DEFUN([GLOBUS_FINALIZE], []) dnl GPT_INIT() AC_DEFUN([GPT_INIT], [ GPT_LOCATION="${GPT_LOCATION:-${GLOBUS_LOCATION:-/usr}}" dnl --with-docdir for older autoconf (<2.60) AC_ARG_WITH([docdir], AC_HELP_STRING([--with-docdir=DIR], [Install documentation in DIR [[DATADIR/doc/PACKAGE]]]), [case $withval in yes|no) AC_MSG_ERROR([Invalid DIR]) ;; *) docdir="$withval" ;; esac ], [ if test -z "$docdir"; then docdir='${datadir}/doc/${PACKAGE}' fi ]) AC_SUBST(docdir) AC_SUBST(GPT_LOCATION) AC_SUBST(GPT_PKGCONFIG_DEPENDENCIES) # bootstrap extracts the the name and version of the package from the # src metadata into gptdata.sh for easier processing . ${srcdir}/gptdata.sh GPT_VERSION="$GPT_MAJOR_VERSION.$GPT_MINOR_VERSION" # Determine if GPT is version 2.x GPT_IS_2="no" if test -f "$GPT_LOCATION/sbin/gpt-build"; then GPT_IS_2="yes" fi AC_SUBST(GPT_IS_2) #Default to shared, before checking static-only GPT_LINKTYPE="shared" # We have to figure out if we're linking only static before build_config AC_ARG_ENABLE(static-only, AC_HELP_STRING([--enable-static-only], [Don't do any dynamic linking]), [ case $enableval in no) GPT_LINKTYPE="shared" ;; yes) GPT_LINKTYPE="static" dnl if test "$STATIC_LDFLAGS" = ""; then dnl GPT_LDFLAGS=" -all-static $GPT_LDFLAGS" dnl else dnl GPT_LDFLAGS=" $STATIC_LDFLAGS $GPT_LDFLAGS" dnl fi ;; *) echo "--enable-static-only has no arguments" >&2 exit 1 ;; esac ] ) #extract the cumulative build environment from the installed development tree [ if $GPT_LOCATION/sbin/gpt_build_config -src $srcdir/pkgdata/pkg_data_src.gpt.in -f $GLOBUS_FLAVOR_NAME -link $GPT_LINKTYPE; then echo "Dependencies Complete"; else exit 1; fi ] # The following variables are used to manage the build enviroment # GPT_CFLAGS, GPT_INCLUDES, GPT_PGM_LINKS, GPT_LIB_LINKS, and GPT_LDFLAGS # are the variables used in the Makefile.am's # GPT_PKG_CFLAGS, GPT_EXTERNAL_INCLUDES and GPT_EXTERNAL_LIBS are stored # as build data in the packaging metadata file. # GPT_CONFIG_FLAGS, GPT_CONFIG_INCLUDES, GPT_CONFIG_PGM_LINKS, and # GPT_CONFIG_LIB_LINKS are returned by gpt_build_config and contain build # environment data from the dependent packages. . ./gpt_build_temp.sh rm ./gpt_build_temp.sh GPT_CFLAGS="$GPT_CONFIG_CFLAGS" GPT_INCLUDES="$GPT_CONFIG_INCLUDES" GPT_LIBS="$GPT_CONFIG_PKG_LIBS $GPT_CONFIG_LIBS" GPT_LDFLAGS="$GPT_CONFIG_STATIC_LINKLINE $GPT_LDFLAGS" GPT_PGM_LINKS="$GPT_CONFIG_PGM_LINKS $GPT_CONFIG_LIBS" GPT_LIB_LINKS="-version-info $GPT_MAJOR_VERSION:$GPT_MINOR_VERSION:$GPT_AGE_VERSION $GPT_CONFIG_LIB_LINKS $GPT_CONFIG_LIBS" AC_SUBST(GPT_CFLAGS) AC_SUBST(GPT_PKG_CFLAGS) AC_SUBST(GPT_INCLUDES) AC_SUBST(GPT_EXTERNAL_INCLUDES) AC_SUBST(GPT_EXTERNAL_LIBS) AC_SUBST(GPT_LIBS) AC_SUBST(GPT_LDFLAGS) AC_SUBST(GPT_CONFIG_CFLAGS) AC_SUBST(GPT_CONFIG_INCLUDES) AC_SUBST(GPT_CONFIG_LIBS) AC_SUBST(GPT_CONFIG_PKG_LIBS) AC_SUBST(GPT_PGM_LINKS) AC_SUBST(GPT_LIB_LINKS) AC_SUBST(GPT_LINKTYPE) builddir=`pwd` AC_SUBST(builddir) # Export pkg-config information about this package pkgconfdir='${libdir}/pkgconfig' pkgconffile=`echo "${GPT_NAME}.pc" | sed -e 's!_!-!g'` pkgconffile_in="pkg_data_src.pc.in" AC_SUBST(pkgconfdir) AC_SUBST(pkgconffile) AC_SUBST(pkgconffile_in) AC_CONFIG_FILES(pkgdata/$pkgconffile:pkgdata/pkg_data_src.pc.in) ]) AC_DEFUN([GPT_SET_CFLAGS], [ GPT_CFLAGS_TMP=$1 GPT_CFLAGS="$GPT_CFLAGS_TMP $GPT_CFLAGS" GPT_PKG_CFLAGS="$GPT_CFLAGS_TMP $GPT_PKG_CFLAGS" ]) AC_DEFUN([GPT_SET_INCLUDES], [ GPT_INCLUDES_TMP=$1 GPT_EXTERNAL_INCLUDES="$GPT_EXTERNAL_INCLUDES $GPT_INCLUDES_TMP" GPT_INCLUDES="$GPT_INCLUDES_TMP $GPT_INCLUDES" ]) AC_DEFUN([GPT_SET_LIBS], [ GPT_LIBS_TMP=$1 GPT_EXTERNAL_LIBS="$GPT_EXTERNAL_LIBS $GPT_LIBS_TMP" GPT_LIB_LINKS=" $GPT_LIB_LINKS $GPT_LIBS_TMP" GPT_PGM_LINKS=" $GPT_PGM_LINKS $GPT_LIBS_TMP" ]) AC_DEFUN([GPT_SET_LDFLAGS], [ GPT_LDFLAGS_TMP=$1 GPT_EXTERNAL_LDFLAGS="$GPT_EXTERNAL_LDFLAGS $GPT_LDFLAGS_TMP" GPT_LDFLAGS=" $GPT_LDFLAGS_TMP $GPT_LDFLAGS" ]) globus_xio-3.6/builtins/0000775000076400007640000000000012225614640012402 500000000000000globus_xio-3.6/builtins/tcp/0000775000076400007640000000000012225614640013170 500000000000000globus_xio-3.6/builtins/tcp/globus_xio_tcp_driver.c0000666000076400007640000024705011522621711017655 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio_driver.h" #include "globus_xio_tcp_driver.h" #include "version.h" #ifdef HAVE_NETINET_TCP_H #include #endif #ifdef WIN32 #define EADDRINUSE WSAEADDRINUSE #endif #ifdef HAVE_SOCKAPI_H #include #define SOMAXCONN 5 #endif #ifndef TARGET_ARCH_NETOS #include #endif GlobusDebugDefine(GLOBUS_XIO_TCP); #define GlobusXIOTcpDebugPrintf(level, message) \ GlobusDebugPrintf(GLOBUS_XIO_TCP, level, message) #define GlobusXIOTcpDebugEnter() \ GlobusXIOTcpDebugPrintf( \ GLOBUS_L_XIO_TCP_DEBUG_TRACE, \ ("[%s] Entering\n", _xio_name)) #define GlobusXIOTcpDebugExit() \ GlobusXIOTcpDebugPrintf( \ GLOBUS_L_XIO_TCP_DEBUG_TRACE, \ ("[%s] Exiting\n", _xio_name)) #define GlobusXIOTcpDebugExitWithError() \ GlobusXIOTcpDebugPrintf( \ GLOBUS_L_XIO_TCP_DEBUG_TRACE, \ ("[%s] Exiting with error\n", _xio_name)) enum globus_l_xio_error_levels { GLOBUS_L_XIO_TCP_DEBUG_TRACE = 1, GLOBUS_L_XIO_TCP_DEBUG_INFO = 2 }; static int globus_l_xio_tcp_activate(void); static int globus_l_xio_tcp_deactivate(void); GlobusXIODefineModule(tcp) = { "globus_xio_tcp", globus_l_xio_tcp_activate, globus_l_xio_tcp_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; #define GlobusXIOTcpErrorNoAddrs() \ globus_error_put( \ globus_error_construct_error( \ GlobusXIOMyModule(tcp), \ GLOBUS_NULL, \ GLOBUS_XIO_TCP_ERROR_NO_ADDRS, \ __FILE__, \ _xio_name, \ __LINE__, \ "No addrs for INET family")) /* * attribute structure */ typedef struct { /* server attrs */ char * listener_serv; int listener_port; int listener_backlog; int listener_min_port; int listener_max_port; /* handle/server attrs */ globus_xio_system_socket_t fd; char * bind_address; globus_bool_t restrict_port; globus_bool_t resuseaddr; globus_bool_t no_ipv6; /* handle attrs */ globus_bool_t keepalive; globus_bool_t linger; int linger_time; globus_bool_t oobinline; int sndbuf; int rcvbuf; globus_bool_t nodelay; int connector_min_port; int connector_max_port; /* data descriptor */ int send_flags; globus_bool_t global; globus_bool_t use_blocking_io; } globus_l_attr_t; /* default attr (never put any string literals in here, else they may be * freed by the affect global attr stuff) */ static globus_l_attr_t globus_l_xio_tcp_attr_default = { GLOBUS_NULL, /* listener_serv */ 0, /* listener_port */ -1, /* listener_backlog (SOMAXCONN) */ 0, /* listener_min_port */ 0, /* listener_max_port */ GLOBUS_XIO_TCP_INVALID_HANDLE, /* fd */ GLOBUS_NULL, /* bind_address */ GLOBUS_TRUE, /* restrict_port */ GLOBUS_FALSE, /* reuseaddr */ GLOBUS_FALSE, /* no_ipv6 */ GLOBUS_FALSE, /* keepalive */ GLOBUS_FALSE, /* linger */ 0, /* linger_time */ GLOBUS_FALSE, /* oobinline */ 0, /* sndbuf (system default) */ 0, /* rcvbuf (system default) */ GLOBUS_FALSE, /* nodelay */ 0, /* connector_min_port */ 0, /* connector_max_port */ 0, /* send_flags */ GLOBUS_FALSE, /* global */ GLOBUS_FALSE /* use_blocking_io */ }; static int globus_l_xio_tcp_port_range_state_file; static globus_mutex_t globus_l_xio_tcp_port_range_state_lock; /* string parse options table. this rable has all of the options that the use can set via strings */ static globus_xio_string_cntl_table_t tcp_l_string_opts_table[] = { {"port", GLOBUS_XIO_TCP_SET_SERVICE, globus_xio_string_cntl_string}, {"listen_range", GLOBUS_XIO_TCP_SET_LISTEN_RANGE, globus_xio_string_cntl_int_int}, {"iface", GLOBUS_XIO_TCP_SET_INTERFACE, globus_xio_string_cntl_string}, {"reuse", GLOBUS_XIO_TCP_SET_REUSEADDR, globus_xio_string_cntl_bool}, {"noipv6", GLOBUS_XIO_TCP_SET_NO_IPV6, globus_xio_string_cntl_bool}, {"keepalive", GLOBUS_XIO_TCP_SET_KEEPALIVE, globus_xio_string_cntl_bool}, {"sndbuf", GLOBUS_XIO_TCP_SET_SNDBUF, globus_xio_string_cntl_formated_int}, {"rcvbuf", GLOBUS_XIO_TCP_SET_RCVBUF, globus_xio_string_cntl_formated_int}, {"nodelay", GLOBUS_XIO_TCP_SET_NODELAY, globus_xio_string_cntl_bool}, {NULL, 0, NULL} }; /* * server structure */ typedef struct { globus_xio_system_socket_handle_t listener_system; globus_xio_system_socket_t listener_fd; globus_bool_t converted; } globus_l_server_t; /* * handle structure */ typedef struct { globus_xio_system_socket_handle_t system; globus_xio_system_socket_t fd; globus_bool_t converted; globus_object_t * connection_error; globus_xio_operation_t read_op; globus_xio_operation_t write_op; globus_bool_t use_blocking_io; globus_mutex_t lock; } globus_l_handle_t; static globus_bool_t globus_l_xio_tcp_get_env_pair( const char * env_name, int * min, int * max) { char * min_max; GlobusXIOName(globus_l_xio_tcp_get_env_pair); min_max = globus_module_getenv(env_name); if(min_max && sscanf(min_max, " %d , %d", min, max) == 2) { return GLOBUS_TRUE; } return GLOBUS_FALSE; } #if !defined(WIN32) && !defined(TARGET_ARCH_NETOS) static void globus_l_xio_tcp_file_close(void) { int rc; if(globus_l_xio_tcp_port_range_state_file < 0) { return; } do { rc = close(globus_l_xio_tcp_port_range_state_file); } while(rc < 0 && errno == EINTR); globus_l_xio_tcp_port_range_state_file = -1; } static void globus_l_xio_tcp_file_lock(void) { int rc; struct flock fl; globus_mutex_lock(&globus_l_xio_tcp_port_range_state_lock); if(globus_l_xio_tcp_port_range_state_file >= 0) { memset(&fl, 0, sizeof (fl)); fl.l_whence = SEEK_SET; fl.l_type = F_WRLCK; do { rc = fcntl(globus_l_xio_tcp_port_range_state_file, F_SETLKW, &fl); } while(rc < 0 && errno == EINTR); if(rc < 0) { fprintf(stderr, "Unable to lock state file: %s\n", strerror(errno)); globus_l_xio_tcp_file_close(); } } } static void globus_l_xio_tcp_file_unlock() { int rc; struct flock fl; if(globus_l_xio_tcp_port_range_state_file >= 0) { memset(&fl, 0, sizeof (fl)); fl.l_whence = SEEK_SET; fl.l_type = F_UNLCK; do { rc = fcntl(globus_l_xio_tcp_port_range_state_file, F_SETLK, &fl); } while(rc < 0 && errno == EINTR); if(rc < 0) { fprintf(stderr, "Unable to unlock state file: %s\n", strerror(errno)); globus_l_xio_tcp_file_close(); } } globus_mutex_unlock(&globus_l_xio_tcp_port_range_state_lock); } static void globus_l_xio_tcp_file_open( const char * pathname) { do { globus_l_xio_tcp_port_range_state_file = open(pathname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); } while(globus_l_xio_tcp_port_range_state_file < 0 && errno == EINTR); if(globus_l_xio_tcp_port_range_state_file < 0) { fprintf(stderr, "Could not open lock file %s: %s\n", pathname, strerror(errno)); } else { /* test locking -- if they fail, they will close the fd */ globus_l_xio_tcp_file_lock(); globus_l_xio_tcp_file_unlock(); } } static int globus_l_xio_tcp_file_read_port(void) { char buf[6]; int rc; int nbytes = 0; int port = -1; if(globus_l_xio_tcp_port_range_state_file < 0) { return -1; } if(lseek(globus_l_xio_tcp_port_range_state_file, 0, SEEK_SET) == 0) { do { if((rc = read( globus_l_xio_tcp_port_range_state_file, buf + nbytes, 5 - nbytes)) > 0) { nbytes += rc; } } while((rc > 0 && nbytes < 5) || (rc < 0 && errno == EINTR)); if(nbytes == 5) { buf[5] = 0; port = atoi(buf); } } return port; } static void globus_l_xio_tcp_file_write_port( int port) { char buf[6]; int rc = -1; int nbytes = 0; if(globus_l_xio_tcp_port_range_state_file < 0) { return; } snprintf(buf, 6, "%.5d", port); if(lseek(globus_l_xio_tcp_port_range_state_file, 0, SEEK_SET) == 0) { do { if((rc = write( globus_l_xio_tcp_port_range_state_file, buf + nbytes, 6 - nbytes)) > 0) { nbytes += rc; } } while((rc >= 0 && nbytes < 6) || (rc < 0 && errno == EINTR)); } if(rc < 0) { fprintf(stderr, "Unable to update state file: %s\n", strerror(errno)); globus_l_xio_tcp_file_close(); } } #else #define globus_l_xio_tcp_file_close() #define globus_l_xio_tcp_file_lock() #define globus_l_xio_tcp_file_unlock() #define globus_l_xio_tcp_file_open(x) #define globus_l_xio_tcp_file_read_port() -1 #define globus_l_xio_tcp_file_write_port(x) #endif /* * initialize a driver attribute */ static globus_result_t globus_l_xio_tcp_attr_init( void ** out_attr) { globus_l_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_tcp_attr_init); GlobusXIOTcpDebugEnter(); /* * create a tcp attr structure and intialize its values */ attr = (globus_l_attr_t *) globus_malloc(sizeof(globus_l_attr_t)); if(!attr) { result = GlobusXIOErrorMemory("attr"); goto error_attr; } memcpy(attr, &globus_l_xio_tcp_attr_default, sizeof(globus_l_attr_t)); *out_attr = attr; GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_attr: GlobusXIOTcpDebugExitWithError(); return result; } /* * modify the attribute structure */ static globus_result_t globus_l_xio_tcp_attr_cntl( void * driver_attr, int cmd, va_list ap) { globus_l_attr_t * attr; globus_xio_system_socket_t * out_fd; char ** out_string; int * out_int; globus_bool_t * out_bool; globus_result_t result; GlobusXIOName(globus_l_xio_tcp_attr_cntl); GlobusXIOTcpDebugEnter(); attr = (globus_l_attr_t *) driver_attr; if(attr->global && cmd != GLOBUS_XIO_TCP_AFFECT_ATTR_DEFAULTS) { attr = &globus_l_xio_tcp_attr_default; } switch(cmd) { case GLOBUS_XIO_TCP_AFFECT_ATTR_DEFAULTS: attr->global = va_arg(ap, globus_bool_t); break; /** * server attrs */ /* char * service_name */ case GLOBUS_XIO_TCP_SET_SERVICE: if(attr->listener_serv) { globus_free(attr->listener_serv); } attr->listener_serv = va_arg(ap, char *); if(attr->listener_serv) { attr->listener_serv = globus_libc_strdup(attr->listener_serv); if(!attr->listener_serv) { result = GlobusXIOErrorMemory("listener_serv"); goto error_memory; } } break; /* char ** service_name_out */ case GLOBUS_XIO_TCP_GET_SERVICE: out_string = va_arg(ap, char **); if(attr->listener_serv) { *out_string = globus_libc_strdup(attr->listener_serv); if(!*out_string) { result = GlobusXIOErrorMemory("listener_serv_out"); goto error_memory; } } else { *out_string = GLOBUS_NULL; } break; /* int listener_port */ case GLOBUS_XIO_TCP_SET_PORT: attr->listener_port = va_arg(ap, int); break; /* int * listener_port_out */ case GLOBUS_XIO_TCP_GET_PORT: out_int = va_arg(ap, int *); *out_int = attr->listener_port; break; /* int listener_backlog */ case GLOBUS_XIO_TCP_SET_BACKLOG: attr->listener_backlog = va_arg(ap, int); break; /* int * listener_backlog_out */ case GLOBUS_XIO_TCP_GET_BACKLOG: out_int = va_arg(ap, int *); *out_int = attr->listener_backlog; break; /* int listener_min_port */ /* int listener_max_port */ case GLOBUS_XIO_TCP_SET_LISTEN_RANGE: attr->listener_min_port = va_arg(ap, int); attr->listener_max_port = va_arg(ap, int); break; /* int * listener_min_port_out */ /* int * listener_max_port_out */ case GLOBUS_XIO_TCP_GET_LISTEN_RANGE: out_int = va_arg(ap, int *); *out_int = attr->listener_min_port; out_int = va_arg(ap, int *); *out_int = attr->listener_max_port; break; /** * handle/server attrs */ /* globus_xio_system_socket_t fd */ case GLOBUS_XIO_TCP_SET_HANDLE: attr->fd = va_arg(ap, globus_xio_system_socket_t); break; /* globus_xio_system_socket_t * fd_out */ case GLOBUS_XIO_TCP_GET_HANDLE: out_fd = va_arg(ap, globus_xio_system_socket_t *); *out_fd = attr->fd; break; /* char * interface */ case GLOBUS_XIO_TCP_SET_INTERFACE: if(attr->bind_address) { globus_free(attr->bind_address); } attr->bind_address = va_arg(ap, char *); if(attr->bind_address) { attr->bind_address = globus_libc_strdup(attr->bind_address); if(!attr->bind_address) { result = GlobusXIOErrorMemory("bind_address"); goto error_memory; } } break; /* char ** interface_out */ case GLOBUS_XIO_TCP_GET_INTERFACE: out_string = va_arg(ap, char **); if(attr->bind_address) { *out_string = globus_libc_strdup(attr->bind_address); if(!*out_string) { result = GlobusXIOErrorMemory("bind_address_out"); goto error_memory; } } else { *out_string = GLOBUS_NULL; } break; /* globus_bool_t restrict_port */ case GLOBUS_XIO_TCP_SET_RESTRICT_PORT: attr->restrict_port = va_arg(ap, globus_bool_t); break; /* globus_bool_t * restrict_port_out */ case GLOBUS_XIO_TCP_GET_RESTRICT_PORT: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->restrict_port; break; /* globus_bool_t resuseaddr */ case GLOBUS_XIO_TCP_SET_REUSEADDR: attr->resuseaddr = va_arg(ap, globus_bool_t); break; /* globus_bool_t * resuseaddr_out */ case GLOBUS_XIO_TCP_GET_REUSEADDR: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->resuseaddr; break; /* globus_bool_t no_ipv6 */ case GLOBUS_XIO_TCP_SET_NO_IPV6: attr->no_ipv6 = va_arg(ap, globus_bool_t); break; /* globus_bool_t * no_ipv6_out */ case GLOBUS_XIO_TCP_GET_NO_IPV6: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->no_ipv6; break; /** * handle attrs */ /* globus_bool_t keepalive */ case GLOBUS_XIO_TCP_SET_KEEPALIVE: attr->keepalive = va_arg(ap, globus_bool_t); break; /* globus_bool_t * keepalive_out */ case GLOBUS_XIO_TCP_GET_KEEPALIVE: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->keepalive; break; /* globus_bool_t linger */ /* int linger_time */ case GLOBUS_XIO_TCP_SET_LINGER: attr->linger = va_arg(ap, globus_bool_t); attr->linger_time = va_arg(ap, int); break; /* globus_bool_t * linger_out */ /* int * linger_time_out */ case GLOBUS_XIO_TCP_GET_LINGER: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->linger; out_int = va_arg(ap, int *); *out_int = attr->linger_time; break; /* globus_bool_t oobinline */ case GLOBUS_XIO_TCP_SET_OOBINLINE: attr->oobinline = va_arg(ap, globus_bool_t); break; /* globus_bool_t * oobinline_out */ case GLOBUS_XIO_TCP_GET_OOBINLINE: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->oobinline; break; /* int sndbuf */ case GLOBUS_XIO_TCP_SET_SNDBUF: attr->sndbuf = va_arg(ap, int); break; /* int * sndbuf_out */ case GLOBUS_XIO_TCP_GET_SNDBUF: out_int = va_arg(ap, int *); *out_int = attr->sndbuf; break; /* int rcvbuf */ case GLOBUS_XIO_TCP_SET_RCVBUF: attr->rcvbuf = va_arg(ap, int); break; /* int * rcvbuf_out */ case GLOBUS_XIO_TCP_GET_RCVBUF: out_int = va_arg(ap, int *); *out_int = attr->rcvbuf; break; /* globus_bool_t nodelay */ case GLOBUS_XIO_TCP_SET_NODELAY: attr->nodelay = va_arg(ap, globus_bool_t); break; /* globus_bool_t * nodelay_out */ case GLOBUS_XIO_TCP_GET_NODELAY: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->nodelay; break; /* int connector_min_port */ /* int connector_max_port */ case GLOBUS_XIO_TCP_SET_CONNECT_RANGE: attr->connector_min_port = va_arg(ap, int); attr->connector_max_port = va_arg(ap, int); break; /* int * connector_min_port_out */ /* int * connector_max_port_out */ case GLOBUS_XIO_TCP_GET_CONNECT_RANGE: out_int = va_arg(ap, int *); *out_int = attr->connector_min_port; out_int = va_arg(ap, int *); *out_int = attr->connector_max_port; break; /** * data descriptors */ /* int send_flags */ case GLOBUS_XIO_TCP_SET_SEND_FLAGS: attr->send_flags = va_arg(ap, int); break; /* int * send_flags_out */ case GLOBUS_XIO_TCP_GET_SEND_FLAGS: out_int = va_arg(ap, int *); *out_int = attr->send_flags; break; /* globus_bool_t use_blocking_io */ case GLOBUS_XIO_TCP_SET_BLOCKING_IO: attr->use_blocking_io = va_arg(ap, globus_bool_t); break; /* globus_bool_t * use_blocking_io */ case GLOBUS_XIO_TCP_GET_BLOCKING_IO: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->use_blocking_io; break; default: result = GlobusXIOErrorInvalidCommand(cmd); goto error_invalid; break; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_memory: error_invalid: GlobusXIOTcpDebugExitWithError(); return result; } /* * copy an attribute structure */ static globus_result_t globus_l_xio_tcp_attr_copy( void ** dst, void * src) { globus_l_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_tcp_attr_copy); GlobusXIOTcpDebugEnter(); attr = (globus_l_attr_t *) globus_malloc(sizeof(globus_l_attr_t)); if(!attr) { result = GlobusXIOErrorMemory("attr"); goto error_attr; } memcpy(attr, src, sizeof(globus_l_attr_t)); if(attr->bind_address) { attr->bind_address = globus_libc_strdup(attr->bind_address); if(!attr->bind_address) { result = GlobusXIOErrorMemory("bind_address"); goto error_bind_address; } } if(attr->listener_serv) { attr->listener_serv = globus_libc_strdup(attr->listener_serv); if(!attr->listener_serv) { result = GlobusXIOErrorMemory("listener_serv"); goto error_listener_serv; } } /* copies do not inherit the affect_global */ attr->global = GLOBUS_FALSE; *dst = attr; GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_listener_serv: if(attr->bind_address) { globus_free(attr->bind_address); } error_bind_address: globus_free(attr); error_attr: GlobusXIOTcpDebugExitWithError(); return result; } /* * destroy an attr structure */ static globus_result_t globus_l_xio_tcp_attr_destroy( void * driver_attr) { globus_l_attr_t * attr; GlobusXIOName(globus_l_xio_tcp_attr_destroy); GlobusXIOTcpDebugEnter(); attr = (globus_l_attr_t *) driver_attr; if(attr->bind_address) { globus_free(attr->bind_address); } if(attr->listener_serv) { globus_free(attr->listener_serv); } globus_free(driver_attr); GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_tcp_apply_handle_attrs( const globus_l_attr_t * attr, globus_xio_system_socket_t fd, globus_bool_t do_bind_attrs, globus_bool_t converted) { globus_result_t result; int int_one = 1; GlobusXIOName(globus_l_xio_tcp_apply_handle_attrs); GlobusXIOTcpDebugEnter(); if(do_bind_attrs) { if(attr->resuseaddr) { result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_REUSEADDR, &int_one, sizeof(int_one)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } } if(attr->keepalive) { result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_KEEPALIVE, &int_one, sizeof(int_one)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } if(attr->linger) { struct linger linger; linger.l_onoff = 1; linger.l_linger = attr->linger_time; result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } if(attr->oobinline) { result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_OOBINLINE, &int_one, sizeof(int_one)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } #ifdef TCP_RFC1323 if(attr->sndbuf || attr->rcvbuf) { /* On AIX, RFC 1323 extensions can be set system-wide, * using the 'no' network options command. But we can also set them * per-socket, so let's try just in case. */ result = globus_xio_system_socket_setsockopt( fd, IPPROTO_TCP, TCP_RFC1323, &int_one, sizeof(int_one)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } #endif if(attr->sndbuf) { result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_SNDBUF, &attr->sndbuf, sizeof(attr->sndbuf)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } if(attr->rcvbuf) { result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_RCVBUF, &attr->rcvbuf, sizeof(attr->rcvbuf)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } if(attr->nodelay) { result = globus_xio_system_socket_setsockopt( fd, IPPROTO_TCP, TCP_NODELAY, &int_one, sizeof(int_one)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_sockopt: GlobusXIOTcpDebugExitWithError(); return result; } static globus_result_t globus_l_xio_tcp_contact_string( globus_xio_system_socket_t fd, int cmd, char ** contact_string) { globus_result_t result; globus_sockaddr_t sock_name; globus_socklen_t sock_len; int flags; GlobusXIOName(globus_l_xio_tcp_contact_string); GlobusXIOTcpDebugEnter(); sock_len = sizeof(sock_name); flags = 0; switch(cmd) { case GLOBUS_XIO_TCP_GET_LOCAL_NUMERIC_CONTACT: case GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT: flags |= GLOBUS_LIBC_ADDR_NUMERIC; /* fall through */ case GLOBUS_XIO_TCP_GET_LOCAL_CONTACT: case GLOBUS_XIO_GET_LOCAL_CONTACT: result = globus_xio_system_socket_getsockname( fd, (struct sockaddr *) &sock_name, &sock_len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; case GLOBUS_XIO_TCP_GET_REMOTE_NUMERIC_CONTACT: case GLOBUS_XIO_GET_REMOTE_NUMERIC_CONTACT: flags |= GLOBUS_LIBC_ADDR_NUMERIC; /* fall through */ case GLOBUS_XIO_TCP_GET_REMOTE_CONTACT: case GLOBUS_XIO_GET_REMOTE_CONTACT: result = globus_xio_system_socket_getpeername( fd, (struct sockaddr *) &sock_name, &sock_len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; default: globus_assert(0 && "Unexpected command"); result = GlobusXIOErrorInvalidCommand(cmd); goto error_sockopt; } result = globus_libc_addr_to_contact_string( &sock_name, flags, contact_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_libc_addr_to_contact_string", result); goto error_contact; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_contact: error_sockopt: GlobusXIOTcpDebugExitWithError(); return result; } typedef struct { globus_xio_operation_t op; globus_xio_system_socket_t accepted_fd; } globus_l_accept_info_t; static globus_result_t globus_l_xio_tcp_link_cntl( void * driver_link, int cmd, va_list ap) { globus_l_accept_info_t * accept_info; globus_result_t result; char ** out_string; globus_xio_system_socket_t * out_fd; GlobusXIOName(globus_l_xio_tcp_link_cntl); GlobusXIOTcpDebugEnter(); accept_info = (globus_l_accept_info_t *) driver_link; switch(cmd) { /* globus_xio_system_socket_t * fd_out */ case GLOBUS_XIO_TCP_GET_HANDLE: out_fd = va_arg(ap, globus_xio_system_socket_t *); *out_fd = accept_info->accepted_fd; break; /* char ** contact_string_out */ case GLOBUS_XIO_TCP_GET_LOCAL_NUMERIC_CONTACT: case GLOBUS_XIO_TCP_GET_LOCAL_CONTACT: case GLOBUS_XIO_TCP_GET_REMOTE_NUMERIC_CONTACT: case GLOBUS_XIO_TCP_GET_REMOTE_CONTACT: case GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT: case GLOBUS_XIO_GET_LOCAL_CONTACT: case GLOBUS_XIO_GET_REMOTE_NUMERIC_CONTACT: case GLOBUS_XIO_GET_REMOTE_CONTACT: out_string = va_arg(ap, char **); result = globus_l_xio_tcp_contact_string( accept_info->accepted_fd, cmd, out_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_contact_string", result); goto error_contact; } break; default: result = GlobusXIOErrorInvalidCommand(cmd); goto error_invalid; break; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_invalid: error_contact: GlobusXIOTcpDebugExitWithError(); return result; } /* * destroy the link structure */ static globus_result_t globus_l_xio_tcp_link_destroy( void * driver_link) { globus_l_accept_info_t * accept_info; GlobusXIOName(globus_l_xio_tcp_link_destroy); GlobusXIOTcpDebugEnter(); accept_info = (globus_l_accept_info_t *) driver_link; if(accept_info->accepted_fd != GLOBUS_XIO_TCP_INVALID_HANDLE) { globus_xio_system_socket_close(accept_info->accepted_fd); } globus_free(accept_info); GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_tcp_bind( globus_xio_system_socket_t fd, const struct sockaddr * addr, int addr_len, int min_port, int max_port, globus_bool_t listener) { int port; globus_bool_t done; globus_sockaddr_t myaddr; globus_result_t result; int stop_port; globus_bool_t unlock = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_tcp_bind); GlobusXIOTcpDebugEnter(); GlobusLibcSockaddrGetPort(*addr, port); if(port == 0) { port = min_port; stop_port = max_port; if(listener && min_port == globus_l_xio_tcp_attr_default.listener_min_port && max_port == globus_l_xio_tcp_attr_default.listener_max_port && globus_l_xio_tcp_port_range_state_file >= 0) { int tmpport; unlock = GLOBUS_TRUE; globus_l_xio_tcp_file_lock(); tmpport = globus_l_xio_tcp_file_read_port(); if(tmpport < max_port && tmpport >= min_port) { port = tmpport + 1; stop_port = tmpport; } } else if(min_port != 0 && max_port != 0) { port = min_port + (int)(rand() % (max_port-min_port)); stop_port = port > min_port ? port - 1 : max_port; } } else { stop_port = port; } done = GLOBUS_FALSE; do { GlobusLibcSockaddrCopy(myaddr, *addr, addr_len); GlobusLibcSockaddrSetPort(myaddr, port); result = globus_xio_system_socket_bind( fd, (struct sockaddr *) &myaddr, GlobusLibcSockaddrLen(&myaddr)); if(result != GLOBUS_SUCCESS) { if(port++ == stop_port) { goto error_bind; } else if(port > max_port) { port = min_port; } } else { done = GLOBUS_TRUE; } } while(!done); if(unlock) { globus_l_xio_tcp_file_write_port(port); globus_l_xio_tcp_file_unlock(); } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_bind: if(unlock) { globus_l_xio_tcp_file_unlock(); } GlobusXIOTcpDebugExitWithError(); return result; } static globus_result_t globus_l_xio_tcp_create_listener( globus_l_server_t * server, globus_l_attr_t * attr) { globus_result_t result; globus_addrinfo_t * save_addrinfo; globus_addrinfo_t * addrinfo; globus_addrinfo_t addrinfo_hints; char portbuf[10]; char * port; globus_xio_system_socket_t fd; GlobusXIOName(globus_l_xio_tcp_create_listener); GlobusXIOTcpDebugEnter(); if(attr->listener_serv) { port = attr->listener_serv; } else { snprintf(portbuf, sizeof(portbuf), "%d", attr->listener_port); port = portbuf; } /* setup hints for types of connectable sockets we want */ memset(&addrinfo_hints, 0, sizeof(globus_addrinfo_t)); addrinfo_hints.ai_flags = GLOBUS_AI_PASSIVE; addrinfo_hints.ai_family = attr->no_ipv6 ? PF_INET : PF_UNSPEC; addrinfo_hints.ai_socktype = SOCK_STREAM; addrinfo_hints.ai_protocol = 0; result = globus_libc_getaddrinfo( attr->bind_address, port, &addrinfo_hints, &save_addrinfo); if(result != GLOBUS_SUCCESS && attr->listener_serv && attr->listener_port > 0) { /* it's possible the service name doesnt exist, since they also * specified a numeric port, lets try that one */ snprintf(portbuf, sizeof(portbuf), "%d", attr->listener_port); result = globus_libc_getaddrinfo( attr->bind_address, portbuf, &addrinfo_hints, &save_addrinfo); } if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed("globus_libc_getaddrinfo", result); goto error_getaddrinfo; } /* bind to the first one possible -- * its not possible to bind multiple interfaces (except on some openbsd) * so, if the system doesnt map its inet interfaces to inet6, we * may have a problem */ for(addrinfo = save_addrinfo; addrinfo; addrinfo = addrinfo->ai_next) { if(GlobusLibcProtocolFamilyIsIP(addrinfo->ai_family)) { globus_bool_t found = GLOBUS_FALSE; do { result = globus_xio_system_socket_create( &fd, addrinfo->ai_family, addrinfo->ai_socktype, addrinfo->ai_protocol); if(result != GLOBUS_SUCCESS) { break; } result = globus_l_xio_tcp_apply_handle_attrs( attr, fd, GLOBUS_TRUE, GLOBUS_FALSE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_apply_handle_attrs", result); globus_xio_system_socket_close(fd); break; } result = globus_l_xio_tcp_bind( fd, addrinfo->ai_addr, addrinfo->ai_addrlen, attr->restrict_port ? attr->listener_min_port : 0, attr->restrict_port ? attr->listener_max_port : 0, GLOBUS_TRUE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_bind", result); globus_xio_system_socket_close(fd); break; } result = globus_xio_system_socket_listen( fd, attr->listener_backlog < 0 ? SOMAXCONN : attr->listener_backlog); if(result != GLOBUS_SUCCESS) { globus_xio_system_socket_close(fd); if(globus_error_errno_match( globus_error_peek(result), GLOBUS_XIO_MODULE, EADDRINUSE)) { /* there's a race between bind and listen, let's try * this all over again */ continue; } else { break; } } found = GLOBUS_TRUE; } while(!found); if(found) { break; } } } if(!addrinfo) { if(result == GLOBUS_SUCCESS) { result = GlobusXIOTcpErrorNoAddrs(); } goto error_no_addrinfo; } server->listener_fd = fd; globus_libc_freeaddrinfo(save_addrinfo); GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_no_addrinfo: globus_libc_freeaddrinfo(save_addrinfo); error_getaddrinfo: GlobusXIOTcpDebugExitWithError(); return result; } /* * server interface funcs */ static globus_result_t globus_l_xio_tcp_server_init( void * driver_attr, const globus_xio_contact_t * contact_info, globus_xio_operation_t op) { globus_l_server_t * server; globus_l_attr_t * attr; globus_result_t result; globus_xio_contact_t my_contact_info; char * cs; GlobusXIOName(globus_l_xio_tcp_server_init); GlobusXIOTcpDebugEnter(); attr = (globus_l_attr_t *) (driver_attr ? driver_attr : &globus_l_xio_tcp_attr_default); server = (globus_l_server_t *) globus_malloc(sizeof(globus_l_server_t)); if(!server) { result = GlobusXIOErrorMemory("server"); goto error_server; } server->converted = GLOBUS_FALSE; if(attr->fd == GLOBUS_XIO_TCP_INVALID_HANDLE) { result = globus_l_xio_tcp_create_listener(server, attr); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_create_listener", result); goto error_listener; } } else { /* user specified handle */ server->listener_fd = attr->fd; server->converted = GLOBUS_TRUE; result = globus_l_xio_tcp_apply_handle_attrs( attr, server->listener_fd, GLOBUS_FALSE, GLOBUS_FALSE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_apply_handle_attrs", result); goto error_listener; } } result = globus_xio_system_socket_init( &server->listener_system, server->listener_fd, GLOBUS_XIO_SYSTEM_TCP_LISTENER); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_init", result); goto error_init; } result = globus_l_xio_tcp_contact_string( server->listener_fd, GLOBUS_XIO_TCP_GET_LOCAL_CONTACT, &cs); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_contact_string", result); goto error_pass; } result = globus_xio_contact_parse(&my_contact_info, cs); globus_free(cs); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_contact_parse", result); goto error_pass; } result = globus_xio_driver_pass_server_init(op, &my_contact_info, server); globus_xio_contact_destroy(&my_contact_info); if(result != GLOBUS_SUCCESS) { goto error_pass; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_pass: globus_xio_system_socket_destroy(server->listener_system); error_init: if(!server->converted) { globus_xio_system_socket_close(server->listener_fd); } error_listener: globus_free(server); error_server: GlobusXIOTcpDebugExitWithError(); return result; } static void globus_l_xio_tcp_system_accept_cb( globus_result_t result, void * user_arg) { globus_l_accept_info_t * accept_info; GlobusXIOName(globus_l_xio_tcp_system_accept_cb); GlobusXIOTcpDebugEnter(); accept_info = (globus_l_accept_info_t *) user_arg; if(result == GLOBUS_SUCCESS) { globus_xio_driver_finished_accept( accept_info->op, accept_info, GLOBUS_SUCCESS); } else { globus_xio_driver_finished_accept( accept_info->op, GLOBUS_NULL, result); globus_free(accept_info); } GlobusXIOTcpDebugExit(); } static globus_result_t globus_l_xio_tcp_server_accept( void * driver_server, globus_xio_operation_t op) { globus_l_server_t * server; globus_result_t result; globus_l_accept_info_t * accept_info; GlobusXIOName(globus_l_xio_tcp_server_accept); GlobusXIOTcpDebugEnter(); server = (globus_l_server_t *) driver_server; /* create the link structure */ accept_info = (globus_l_accept_info_t *) globus_malloc(sizeof(globus_l_accept_info_t)); if(!accept_info) { result = GlobusXIOErrorMemory("accept_info"); goto error_info; } accept_info->op = op; accept_info->accepted_fd = GLOBUS_XIO_TCP_INVALID_HANDLE; result = globus_xio_system_socket_register_accept( op, server->listener_system, &accept_info->accepted_fd, globus_l_xio_tcp_system_accept_cb, accept_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_register_accept", result); goto error_register; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_register: globus_free(accept_info); error_info: GlobusXIOTcpDebugExitWithError(); return result; } static globus_result_t globus_l_xio_tcp_server_cntl( void * driver_server, int cmd, va_list ap) { globus_l_server_t * server; globus_result_t result; char ** out_string; globus_xio_system_socket_t * out_fd; GlobusXIOName(globus_l_xio_tcp_server_cntl); GlobusXIOTcpDebugEnter(); server = (globus_l_server_t *) driver_server; switch(cmd) { /* globus_xio_system_socket_t * fd_out */ case GLOBUS_XIO_TCP_GET_HANDLE: out_fd = va_arg(ap, globus_xio_system_socket_t *); *out_fd = server->listener_fd; break; /* char ** contact_string_out */ case GLOBUS_XIO_TCP_GET_LOCAL_NUMERIC_CONTACT: case GLOBUS_XIO_TCP_GET_LOCAL_CONTACT: case GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT: case GLOBUS_XIO_GET_LOCAL_CONTACT: out_string = va_arg(ap, char **); result = globus_l_xio_tcp_contact_string( server->listener_fd, cmd, out_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_contact_string", result); goto error_contact; } break; default: result = GlobusXIOErrorInvalidCommand(cmd); goto error_invalid; break; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_invalid: error_contact: GlobusXIOTcpDebugExitWithError(); return result; } static globus_result_t globus_l_xio_tcp_server_destroy( void * driver_server) { globus_result_t result; globus_l_server_t * server; GlobusXIOName(globus_l_xio_tcp_server_destroy); GlobusXIOTcpDebugEnter(); server = (globus_l_server_t *) driver_server; globus_xio_system_socket_destroy(server->listener_system); if(!server->converted) { result = globus_xio_system_socket_close(server->listener_fd); if(result != GLOBUS_SUCCESS) { goto error_close; } } globus_free(server); GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_close: globus_free(server); GlobusXIOTcpDebugExitWithError(); return result; } static globus_result_t globus_l_xio_tcp_handle_init( globus_l_handle_t ** handle) { globus_result_t result; GlobusXIOName(globus_l_xio_tcp_handle_init); GlobusXIOTcpDebugEnter(); *handle = (globus_l_handle_t *) globus_calloc(1, sizeof(globus_l_handle_t)); if(!*handle) { result = GlobusXIOErrorMemory("handle"); goto error_handle; } globus_mutex_init(&(*handle)->lock, GLOBUS_NULL); GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_handle: GlobusXIOTcpDebugExitWithError(); return result; } static void globus_l_xio_tcp_handle_destroy( globus_l_handle_t * handle) { GlobusXIOName(globus_l_xio_tcp_handle_destroy); GlobusXIOTcpDebugEnter(); globus_mutex_destroy(&handle->lock); if(handle->connection_error) { globus_object_free(handle->connection_error); } globus_free(handle); GlobusXIOTcpDebugExit(); } static globus_result_t globus_l_xio_tcp_bind_local( globus_xio_system_socket_t fd, globus_l_attr_t * attr) { globus_result_t result; globus_addrinfo_t * save_addrinfo; globus_addrinfo_t * addrinfo; globus_addrinfo_t addrinfo_hints; char * port = "0"; GlobusXIOName(globus_l_xio_tcp_bind_local); GlobusXIOTcpDebugEnter(); memset(&addrinfo_hints, 0, sizeof(globus_addrinfo_t)); addrinfo_hints.ai_flags = GLOBUS_AI_PASSIVE; addrinfo_hints.ai_family = attr->no_ipv6 ? PF_INET : PF_UNSPEC; addrinfo_hints.ai_socktype = SOCK_STREAM; addrinfo_hints.ai_protocol = 0; result = globus_libc_getaddrinfo( attr->bind_address, port, &addrinfo_hints, &save_addrinfo); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed("globus_libc_getaddrinfo", result); goto error_getaddrinfo; } /* bind to the first one possible -- * its not possible to bind multiple interfaces (except on some openbsd) * so, if the system doesnt map its inet interfaces to inet6, we * may have a problem */ for(addrinfo = save_addrinfo; addrinfo; addrinfo = addrinfo->ai_next) { if(GlobusLibcProtocolFamilyIsIP(addrinfo->ai_family)) { result = globus_l_xio_tcp_bind( fd, addrinfo->ai_addr, addrinfo->ai_addrlen, attr->restrict_port ? attr->connector_min_port : 0, attr->restrict_port ? attr->connector_max_port : 0, GLOBUS_FALSE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_bind", result); continue; } break; } } if(!addrinfo) { if(result == GLOBUS_SUCCESS) { result = GlobusXIOTcpErrorNoAddrs(); } goto error_no_addrinfo; } globus_libc_freeaddrinfo(save_addrinfo); GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_no_addrinfo: globus_libc_freeaddrinfo(save_addrinfo); error_getaddrinfo: GlobusXIOTcpDebugExitWithError(); return result; } typedef struct { globus_xio_operation_t op; globus_l_handle_t * handle; globus_l_attr_t * attr; globus_addrinfo_t * save_addrinfo; globus_addrinfo_t * next_addrinfo; char * contact_string; } globus_l_connect_info_t; static globus_result_t globus_l_xio_tcp_connect_next( globus_l_connect_info_t * connect_info); static void globus_l_xio_tcp_system_connect_cb( globus_result_t result, void * user_arg) { globus_l_connect_info_t * connect_info; GlobusXIOName(globus_l_xio_tcp_system_connect_cb); GlobusXIOTcpDebugEnter(); connect_info = (globus_l_connect_info_t *) user_arg; if(result != GLOBUS_SUCCESS) { globus_xio_system_socket_destroy(connect_info->handle->system); globus_xio_system_socket_close(connect_info->handle->fd); if(!globus_xio_operation_is_canceled(connect_info->op)) { globus_result_t res; res = globus_l_xio_tcp_connect_next(connect_info); if(res == GLOBUS_SUCCESS) { goto error_tryagain; } } } if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailedWithMessage(result, "Unable to connect to %s", connect_info->contact_string); globus_l_xio_tcp_handle_destroy(connect_info->handle); connect_info->handle = GLOBUS_NULL; } globus_xio_driver_finished_open( connect_info->handle, connect_info->op, result); globus_libc_freeaddrinfo(connect_info->save_addrinfo); globus_l_xio_tcp_attr_destroy(connect_info->attr); globus_free(connect_info->contact_string); globus_free(connect_info); GlobusXIOTcpDebugExit(); return; error_tryagain: GlobusXIOTcpDebugExitWithError(); return; } static globus_result_t globus_l_xio_tcp_connect_next( globus_l_connect_info_t * connect_info) { globus_addrinfo_t * addrinfo; globus_xio_system_socket_t fd; globus_result_t result; globus_sockaddr_t myaddr; globus_l_attr_t * attr; GlobusXIOName(globus_l_xio_tcp_connect_next); GlobusXIOTcpDebugEnter(); attr = connect_info->attr; result = GLOBUS_SUCCESS; for(addrinfo = connect_info->next_addrinfo; addrinfo; addrinfo = addrinfo->ai_next) { if(GlobusLibcProtocolFamilyIsIP(addrinfo->ai_family)) { result = globus_xio_system_socket_create( &fd, addrinfo->ai_family, addrinfo->ai_socktype, addrinfo->ai_protocol); if(result != GLOBUS_SUCCESS) { continue; } result = globus_l_xio_tcp_apply_handle_attrs( attr, fd, GLOBUS_TRUE, GLOBUS_FALSE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_apply_handle_attrs", result); globus_xio_system_socket_close(fd); continue; } /* if specifying interface or outgoing port ranges, need to bind */ if(attr->bind_address || (attr->restrict_port && attr->connector_max_port > 0)) { result = globus_l_xio_tcp_bind_local(fd, attr); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_bind_local", result); globus_xio_system_socket_close(fd); continue; } } connect_info->handle->fd = fd; connect_info->next_addrinfo = addrinfo->ai_next; GlobusLibcSockaddrCopy( myaddr, *addrinfo->ai_addr, addrinfo->ai_addrlen); result = globus_xio_system_socket_init( &connect_info->handle->system, fd, GLOBUS_XIO_SYSTEM_TCP); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_init", result); globus_xio_system_socket_close(fd); continue; } result = globus_xio_system_socket_register_connect( connect_info->op, connect_info->handle->system, &myaddr, globus_l_xio_tcp_system_connect_cb, connect_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_register_connect", result); globus_xio_system_socket_destroy(connect_info->handle->system); globus_xio_system_socket_close(fd); continue; } break; } } /* addrinfo maybe a dangling pointer here, but I am only checking for * null, so we're safe */ if(!addrinfo) { if(result == GLOBUS_SUCCESS) { result = GlobusXIOTcpErrorNoAddrs(); } goto error_no_addrinfo; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_no_addrinfo: GlobusXIOTcpDebugExitWithError(); return result; } static globus_result_t globus_l_xio_tcp_connect( globus_xio_operation_t op, globus_l_handle_t * handle, const globus_l_attr_t * attr, const char * host, const char * port) { globus_result_t result; globus_addrinfo_t * addrinfo; globus_addrinfo_t addrinfo_hints; globus_l_connect_info_t * connect_info; GlobusXIOName(globus_l_xio_tcp_connect); GlobusXIOTcpDebugEnter(); /* setup hints for types of connectable sockets we want */ memset(&addrinfo_hints, 0, sizeof(globus_addrinfo_t)); addrinfo_hints.ai_flags = 0; addrinfo_hints.ai_family = attr->no_ipv6 ? PF_INET : PF_UNSPEC; addrinfo_hints.ai_socktype = SOCK_STREAM; addrinfo_hints.ai_protocol = 0; result = globus_libc_getaddrinfo(host, port, &addrinfo_hints, &addrinfo); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_libc_getaddrinfo", result); goto error_getaddrinfo; } connect_info = (globus_l_connect_info_t *) globus_malloc(sizeof(globus_l_connect_info_t)); if(!connect_info) { result = GlobusXIOErrorMemory("connect_info"); goto error_info; } connect_info->contact_string = globus_common_create_string("%s:%s", host, port); if(!connect_info->contact_string) { result = GlobusXIOErrorMemory("connect_info"); goto error_contact; } result = globus_l_xio_tcp_attr_copy( (void **) (void *) &connect_info->attr, (void *) attr); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_attr_copy", result); goto error_attr; } connect_info->op = op; connect_info->handle = handle; connect_info->save_addrinfo = addrinfo; connect_info->next_addrinfo = addrinfo; result = globus_l_xio_tcp_connect_next(connect_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_connect_next", result); goto error_connect_next; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_connect_next: globus_l_xio_tcp_attr_destroy(connect_info->attr); error_attr: globus_free(connect_info->contact_string); error_contact: globus_free(connect_info); error_info: globus_libc_freeaddrinfo(addrinfo); error_getaddrinfo: GlobusXIOTcpDebugExitWithError(); return result; } /* * open a tcp */ static globus_result_t globus_l_xio_tcp_open( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op) { globus_l_handle_t * handle; const globus_l_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_tcp_open); GlobusXIOTcpDebugEnter(); attr = (globus_l_attr_t *) (driver_attr ? driver_attr : &globus_l_xio_tcp_attr_default); result = globus_l_xio_tcp_handle_init(&handle); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_handle_init", result); goto error_handle; } handle->use_blocking_io = attr->use_blocking_io; if(!driver_link && attr->fd == GLOBUS_XIO_TCP_INVALID_HANDLE) { char * port; port = contact_info->port ? contact_info->port : contact_info->scheme; if(!(contact_info->host && port)) { result = GlobusXIOErrorContactString("missing host or port"); goto error_contact_string; } result = globus_l_xio_tcp_connect( op, handle, attr, contact_info->host, port); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailedWithMessage2(result, "Unable to connect to %s:%s", contact_info->host, port); goto error_connect; } } else { if(driver_link) { globus_l_accept_info_t * accept_info; accept_info = (globus_l_accept_info_t *) driver_link; handle->fd = accept_info->accepted_fd; /* prevent link destroy from closing this */ accept_info->accepted_fd = GLOBUS_XIO_TCP_INVALID_HANDLE; handle->converted = GLOBUS_FALSE; } else { handle->fd = attr->fd; handle->converted = GLOBUS_TRUE; } result = globus_l_xio_tcp_apply_handle_attrs( attr, handle->fd, GLOBUS_FALSE, GLOBUS_TRUE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_apply_handle_attrs", result); goto error_attrs; } result = globus_xio_system_socket_init( &handle->system, handle->fd, GLOBUS_XIO_SYSTEM_TCP); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_init", result); goto error_init; } globus_xio_driver_finished_open(handle, op, GLOBUS_SUCCESS); } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_init: error_attrs: error_connect: error_contact_string: globus_l_xio_tcp_handle_destroy(handle); error_handle: GlobusXIOTcpDebugExitWithError(); return result; } /* * close a tcp */ static globus_result_t globus_l_xio_tcp_close( void * driver_specific_handle, void * attr, globus_xio_operation_t op) { globus_l_handle_t * handle; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_tcp_close); GlobusXIOTcpDebugEnter(); handle = (globus_l_handle_t *) driver_specific_handle; globus_xio_system_socket_destroy(handle->system); if(!handle->converted) { result = globus_xio_system_socket_close(handle->fd); } globus_xio_driver_finished_close(op, result); globus_l_xio_tcp_handle_destroy(handle); GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; } static void globus_l_xio_tcp_finish_read( globus_l_handle_t * handle, globus_result_t result, globus_size_t nbytes) { globus_xio_operation_t op; GlobusXIOName(globus_l_xio_tcp_finish_read); GlobusXIOTcpDebugEnter(); globus_mutex_lock(&handle->lock); { op = handle->read_op; handle->read_op = NULL; if(result != GLOBUS_SUCCESS && !handle->connection_error && !globus_xio_error_is_canceled(result) && !globus_xio_error_is_eof(result)) { handle->connection_error = globus_object_copy(globus_error_peek(result)); if(handle->write_op) { globus_xio_driver_operation_cancel( globus_xio_operation_get_driver_self_handle( handle->write_op), handle->write_op); } } else if(handle->connection_error && globus_xio_error_is_canceled(result)) { /* it's likely I canceled this, replace error with original */ result = globus_error_put(globus_object_copy(handle->connection_error)); } } globus_mutex_unlock(&handle->lock); globus_xio_driver_finished_read(op, result, nbytes); GlobusXIOTcpDebugExit(); } static void globus_l_xio_tcp_system_read_cb( globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_l_handle_t * handle; GlobusXIOName(globus_l_xio_tcp_system_read_cb); GlobusXIOTcpDebugEnter(); handle = (globus_l_handle_t *) user_arg; globus_l_xio_tcp_finish_read(handle, result, nbytes); GlobusXIOTcpDebugExit(); } /* * read from a tcp */ static globus_result_t globus_l_xio_tcp_read( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_handle_t * handle; globus_size_t nbytes; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_tcp_read); GlobusXIOTcpDebugEnter(); handle = (globus_l_handle_t *) driver_specific_handle; globus_mutex_lock(&handle->lock); { if(handle->read_op) { result = GlobusXIOErrorAlreadyRegistered(); } else if(handle->connection_error) { result = globus_error_put(globus_object_copy(handle->connection_error)); } else { handle->read_op = op; } } globus_mutex_unlock(&handle->lock); if(result != GLOBUS_SUCCESS) { goto error_already; } /* if buflen and waitfor are both 0, we behave like register select */ if((globus_xio_operation_get_wait_for(op) == 0 && (iovec_count > 1 || iovec[0].iov_len > 0)) || (handle->use_blocking_io && globus_xio_driver_operation_is_blocking(op))) { result = globus_xio_system_socket_read( handle->system, iovec, iovec_count, globus_xio_operation_get_wait_for(op), 0, GLOBUS_NULL, &nbytes); globus_l_xio_tcp_finish_read(handle, result, nbytes); } else { result = globus_xio_system_socket_register_read( op, handle->system, iovec, iovec_count, globus_xio_operation_get_wait_for(op), 0, GLOBUS_NULL, globus_l_xio_tcp_system_read_cb, handle); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_register_read", result); goto error_register; } } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_register: globus_mutex_lock(&handle->lock); handle->read_op = NULL; globus_mutex_unlock(&handle->lock); error_already: GlobusXIOTcpDebugExitWithError(); return result; } static void globus_l_xio_tcp_finish_write( globus_l_handle_t * handle, globus_result_t result, globus_size_t nbytes) { globus_xio_operation_t op; GlobusXIOName(globus_l_xio_tcp_finish_write); GlobusXIOTcpDebugEnter(); globus_mutex_lock(&handle->lock); { op = handle->write_op; handle->write_op = NULL; if(result != GLOBUS_SUCCESS && !handle->connection_error && !globus_xio_error_is_canceled(result)) { handle->connection_error = globus_object_copy(globus_error_peek(result)); if(handle->read_op) { globus_xio_driver_operation_cancel( globus_xio_operation_get_driver_self_handle( handle->read_op), handle->read_op); } } else if(handle->connection_error && globus_xio_error_is_canceled(result)) { /* it's likely I canceled this, replace error with original */ result = globus_error_put(globus_object_copy(handle->connection_error)); } } globus_mutex_unlock(&handle->lock); globus_xio_driver_finished_write(op, result, nbytes); GlobusXIOTcpDebugExit(); } static void globus_l_xio_tcp_system_write_cb( globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_l_handle_t * handle; GlobusXIOName(globus_l_xio_tcp_system_write_cb); GlobusXIOTcpDebugEnter(); handle = (globus_l_handle_t *) user_arg; globus_l_xio_tcp_finish_write(handle, result, nbytes); GlobusXIOTcpDebugExit(); } /* * write to a tcp */ static globus_result_t globus_l_xio_tcp_write( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_handle_t * handle; globus_l_attr_t * attr; globus_size_t nbytes; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_tcp_write); GlobusXIOTcpDebugEnter(); GlobusXIOTcpDebugPrintf( GLOBUS_L_XIO_TCP_DEBUG_INFO, ("[%s] count=%d, 1st buflen=%d\n", _xio_name, iovec_count, (int) iovec[0].iov_len)); handle = (globus_l_handle_t *) driver_specific_handle; globus_mutex_lock(&handle->lock); { if(handle->write_op) { result = GlobusXIOErrorAlreadyRegistered(); } else if(handle->connection_error) { result = globus_error_put(globus_object_copy(handle->connection_error)); } else { handle->write_op = op; } } globus_mutex_unlock(&handle->lock); if(result != GLOBUS_SUCCESS) { goto error_already; } attr = (globus_l_attr_t *) globus_xio_operation_get_data_descriptor(op, GLOBUS_FALSE); /* if buflen and waitfor are both 0, we behave like register select */ if((globus_xio_operation_get_wait_for(op) == 0 && (iovec_count > 1 || iovec[0].iov_len > 0)) || (handle->use_blocking_io && globus_xio_driver_operation_is_blocking(op))) { result = globus_xio_system_socket_write( handle->system, iovec, iovec_count, globus_xio_operation_get_wait_for(op), attr ? attr->send_flags : 0, GLOBUS_NULL, &nbytes); globus_l_xio_tcp_finish_write(handle, result, nbytes); } else { result = globus_xio_system_socket_register_write( op, handle->system, iovec, iovec_count, globus_xio_operation_get_wait_for(op), attr ? attr->send_flags : 0, GLOBUS_NULL, globus_l_xio_tcp_system_write_cb, handle); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_register_write", result); goto error_register; } } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_register: globus_mutex_lock(&handle->lock); handle->write_op = NULL; globus_mutex_unlock(&handle->lock); error_already: GlobusXIOTcpDebugExitWithError(); return result; } static globus_result_t globus_l_xio_tcp_cntl( void * driver_specific_handle, int cmd, va_list ap) { globus_l_handle_t * handle; globus_result_t result; int * out_int; globus_bool_t in_bool; globus_bool_t * out_bool; int in_int; globus_xio_system_socket_t fd; globus_socklen_t len; char ** out_string; globus_xio_system_socket_t * out_fd; GlobusXIOName(globus_l_xio_tcp_cntl); GlobusXIOTcpDebugEnter(); handle = (globus_l_handle_t *) driver_specific_handle; fd = handle->fd; switch(cmd) { /* globus_xio_system_socket_t * fd_out */ case GLOBUS_XIO_TCP_GET_HANDLE: out_fd = va_arg(ap, globus_xio_system_socket_t *); *out_fd = fd; break; /* globus_bool_t keepalive */ case GLOBUS_XIO_TCP_SET_KEEPALIVE: in_bool = va_arg(ap, globus_bool_t); result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_KEEPALIVE, &in_bool, sizeof(in_bool)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* globus_bool_t * keepalive_out */ case GLOBUS_XIO_TCP_GET_KEEPALIVE: out_bool = va_arg(ap, globus_bool_t *); len = sizeof(globus_bool_t); result = globus_xio_system_socket_getsockopt( fd, SOL_SOCKET, SO_KEEPALIVE, out_bool, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* globus_bool_t linger */ /* int linger_time */ case GLOBUS_XIO_TCP_SET_LINGER: { struct linger linger; linger.l_onoff = va_arg(ap, globus_bool_t);; linger.l_linger = va_arg(ap, int); result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } break; /* globus_bool_t * linger_out */ /* int * linger_time_out */ case GLOBUS_XIO_TCP_GET_LINGER: { struct linger linger; len = sizeof(linger); result = globus_xio_system_socket_getsockopt( fd, SOL_SOCKET, SO_LINGER, &linger, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } out_bool = va_arg(ap, globus_bool_t *); out_int = va_arg(ap, int *); *out_bool = linger.l_onoff; *out_int = linger.l_linger; } break; /* globus_bool_t oobinline */ case GLOBUS_XIO_TCP_SET_OOBINLINE: in_bool = va_arg(ap, globus_bool_t); result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_OOBINLINE, &in_bool, sizeof(in_bool)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* globus_bool_t * oobinline_out */ case GLOBUS_XIO_TCP_GET_OOBINLINE: out_bool = va_arg(ap, globus_bool_t *); len = sizeof(globus_bool_t); result = globus_xio_system_socket_getsockopt( fd, SOL_SOCKET, SO_OOBINLINE, out_bool, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* int sndbuf */ case GLOBUS_XIO_TCP_SET_SNDBUF: in_int = va_arg(ap, int); result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_SNDBUF, &in_int, sizeof(in_int)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* int * sndbuf_out */ case GLOBUS_XIO_TCP_GET_SNDBUF: out_int = va_arg(ap, int *); len = sizeof(int); result = globus_xio_system_socket_getsockopt( fd, SOL_SOCKET, SO_SNDBUF, out_int, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* int rcvbuf */ case GLOBUS_XIO_TCP_SET_RCVBUF: in_int = va_arg(ap, int); result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_RCVBUF, &in_int, sizeof(in_int)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* int * rcvbuf_out */ case GLOBUS_XIO_TCP_GET_RCVBUF: out_int = va_arg(ap, int *); len = sizeof(int); result = globus_xio_system_socket_getsockopt( fd, SOL_SOCKET, SO_RCVBUF, out_int, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* globus_bool_t nodelay */ case GLOBUS_XIO_TCP_SET_NODELAY: in_bool = va_arg(ap, globus_bool_t); result = globus_xio_system_socket_setsockopt( fd, IPPROTO_TCP, TCP_NODELAY, &in_bool, sizeof(in_bool)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* globus_bool_t * nodelay_out */ case GLOBUS_XIO_TCP_GET_NODELAY: out_bool = va_arg(ap, globus_bool_t *); len = sizeof(globus_bool_t); result = globus_xio_system_socket_getsockopt( fd, IPPROTO_TCP, TCP_NODELAY, out_bool, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* char ** contact_string_out */ case GLOBUS_XIO_TCP_GET_LOCAL_NUMERIC_CONTACT: case GLOBUS_XIO_TCP_GET_LOCAL_CONTACT: case GLOBUS_XIO_TCP_GET_REMOTE_NUMERIC_CONTACT: case GLOBUS_XIO_TCP_GET_REMOTE_CONTACT: case GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT: case GLOBUS_XIO_GET_LOCAL_CONTACT: case GLOBUS_XIO_GET_REMOTE_NUMERIC_CONTACT: case GLOBUS_XIO_GET_REMOTE_CONTACT: out_string = va_arg(ap, char **); result = globus_l_xio_tcp_contact_string(fd, cmd, out_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_contact_string", result); goto error_contact; } break; /* globus_bool_t use_blocking_io */ case GLOBUS_XIO_TCP_SET_BLOCKING_IO: handle->use_blocking_io = va_arg(ap, globus_bool_t); break; /* globus_bool_t * use_blocking_io */ case GLOBUS_XIO_TCP_GET_BLOCKING_IO: out_bool = va_arg(ap, globus_bool_t *); *out_bool = handle->use_blocking_io; break; default: result = GlobusXIOErrorInvalidCommand(cmd); goto error_invalid; break; } GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_invalid: error_contact: error_sockopt: GlobusXIOTcpDebugExitWithError(); return result; } static globus_result_t globus_l_xio_tcp_init( globus_xio_driver_t * out_driver) { globus_xio_driver_t driver; globus_result_t result; GlobusXIOName(globus_l_xio_tcp_init); GlobusXIOTcpDebugEnter(); /* I dont support any driver options, so I'll ignore the ap */ result = globus_xio_driver_init(&driver, "tcp", GLOBUS_NULL); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_tcp_handle_init", result); goto error_init; } globus_xio_driver_set_transport( driver, globus_l_xio_tcp_open, globus_l_xio_tcp_close, globus_l_xio_tcp_read, globus_l_xio_tcp_write, globus_l_xio_tcp_cntl); globus_xio_driver_set_server( driver, globus_l_xio_tcp_server_init, globus_l_xio_tcp_server_accept, globus_l_xio_tcp_server_destroy, globus_l_xio_tcp_server_cntl, globus_l_xio_tcp_link_cntl, globus_l_xio_tcp_link_destroy); globus_xio_driver_set_attr( driver, globus_l_xio_tcp_attr_init, globus_l_xio_tcp_attr_copy, globus_l_xio_tcp_attr_cntl, globus_l_xio_tcp_attr_destroy); globus_xio_driver_string_cntl_set_table( driver, tcp_l_string_opts_table); *out_driver = driver; GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_init: GlobusXIOTcpDebugExitWithError(); return result; } static void globus_l_xio_tcp_destroy( globus_xio_driver_t driver) { GlobusXIOName(globus_l_xio_tcp_destroy); GlobusXIOTcpDebugEnter(); globus_xio_driver_destroy(driver); GlobusXIOTcpDebugExit(); } GlobusXIODefineDriver( tcp, globus_l_xio_tcp_init, globus_l_xio_tcp_destroy); static int globus_l_xio_tcp_activate(void) { int min; int max; int rc; GlobusXIOName(globus_l_xio_tcp_activate); GlobusDebugInit(GLOBUS_XIO_TCP, TRACE); GlobusXIOTcpDebugEnter(); globus_l_xio_tcp_port_range_state_file = -1; globus_mutex_init(&globus_l_xio_tcp_port_range_state_lock, NULL); if(globus_l_xio_tcp_get_env_pair( "GLOBUS_TCP_PORT_RANGE", &min, &max) && min <= max) { char * tmp; globus_l_xio_tcp_attr_default.listener_min_port = min; globus_l_xio_tcp_attr_default.listener_max_port = max; if((tmp = globus_module_getenv("GLOBUS_TCP_PORT_RANGE_STATE_FILE")) && *tmp) { globus_l_xio_tcp_file_open(tmp); } } if(globus_l_xio_tcp_get_env_pair( "GLOBUS_TCP_SOURCE_RANGE", &min, &max) && min <= max) { globus_l_xio_tcp_attr_default.connector_min_port = min; globus_l_xio_tcp_attr_default.connector_max_port = max; } rc = globus_module_activate(GLOBUS_XIO_SYSTEM_MODULE); if(rc != GLOBUS_SUCCESS) { goto error_activate; } GlobusXIORegisterDriver(tcp); GlobusXIOTcpDebugExit(); return GLOBUS_SUCCESS; error_activate: globus_l_xio_tcp_file_close(); globus_mutex_destroy(&globus_l_xio_tcp_port_range_state_lock); GlobusXIOTcpDebugExitWithError(); GlobusDebugDestroy(GLOBUS_XIO_TCP); return rc; } static int globus_l_xio_tcp_deactivate(void) { GlobusXIOName(globus_l_xio_tcp_deactivate); GlobusXIOTcpDebugEnter(); globus_l_xio_tcp_attr_default.listener_min_port = 0; globus_l_xio_tcp_attr_default.listener_max_port = 0; globus_l_xio_tcp_attr_default.connector_min_port = 0; globus_l_xio_tcp_attr_default.connector_max_port = 0; globus_l_xio_tcp_file_close(); globus_mutex_destroy(&globus_l_xio_tcp_port_range_state_lock); GlobusXIOUnRegisterDriver(tcp); globus_module_deactivate(GLOBUS_XIO_SYSTEM_MODULE); GlobusXIOTcpDebugExit(); GlobusDebugDestroy(GLOBUS_XIO_TCP); return GLOBUS_SUCCESS; } globus_xio-3.6/builtins/tcp/globus_xio_tcp_driver.h0000666000076400007640000006766710674774215017717 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_XIO_TCP_DRIVER_INCLUDE #define GLOBUS_XIO_TCP_DRIVER_INCLUDE /** * @file * Header file for XIO TCP Driver */ #include "globus_xio_system.h" /** * @defgroup tcp_driver Globus XIO TCP Driver * The IPV4/6 TCP socket driver. */ /** * @defgroup tcp_driver_instance Opening/Closing * @ingroup tcp_driver * * An XIO handle with the tcp driver can be created with either * @ref globus_xio_handle_create() or @ref globus_xio_server_register_accept(). * * If the handle is created with @ref globus_xio_server_register_accept(), * the @ref globus_xio_register_open() call does nothing more than initialize * the internal handle with the accepted socket. * * If the handle is created with @ref globus_xio_handle_create(), and * there is no handle set on the attr passed to the * @ref globus_xio_register_open() call, it performs the equivalent of an * asynchronous connect() call. In this case, the contact string must contain * a host name and service/port. Both the hostname and port number can be * numeric or symbolic (eg: some.webserver.com:80 or 214.123.12.1:http). * If the hostname is symbolic and it resolves to multiple ip addresses, each * one will be attempted in succession, until the connect is successful or * there are no more addresses. * * When the XIO handle is closed, the tcp driver will destroy its internal * resources and close the socket (unless this socket was set on an attr). * Any write data pending in system buffers will be sent unless the linger * option has been set. Any remaining data in recv buffers will be discarded * and (on some systems) a connection reset sent to the peer. */ /** * @defgroup tcp_driver_io Reading/Writing * @ingroup tcp_driver * * Both the @ref globus_xio_register_read() and * @ref globus_xio_register_write() calls follow similar semantics as described * below. * * If the waitforbytes parameter is greater than zero, the io will happen * asynchronously and be completed when at least waitforbytes has been * read/written. * * If the waitforbytes parameter is equal to zero, one of the following * alternative behaviors occur: * * If the length of the buffer is > 0 the read or write happens synchronously. * If the user is using one of the blocking xio calls, no internal callback * will occur. * * If the length of the buffer is also 0, the call behaves like an asynchronous * notification of data ready to be either read or written. ie, an * asynchronous select(). * * In any case, when an error or EOF occurs before the waitforbytes request * has been met, the outgoing nbytes is set to the amount of data actually * read/written before the error or EOF occurred. */ /** * @defgroup tcp_driver_server Server * @ingroup tcp_driver * * @ref globus_xio_server_create() causes a tcp listener socket to be created * and listened upon. @ref globus_xio_server_register_accept() performs an * asynchronous accept(). @ref globus_xio_server_register_close() cleans up * the internal resources associated with the tcp server and calls close() on * the listener socket (unless the socket was set on the server via the attr) * * All accepted handles inherit all tcp specific attributes set in the attr to * @ref globus_xio_server_create(), but can be overridden with the attr to * @ref globus_xio_register_open(). */ /** * @defgroup tcp_driver_envs Env Variables * @ingroup tcp_driver * * The tcp driver uses the following environment variables * - GLOBUS_HOSTNAME Used when setting the hostname in the contact string * - GLOBUS_TCP_PORT_RANGE Used to restrict anonymous listener ports * ex: GLOBUS_TCP_PORT_RANGE=4000,4100 * - GLOBUS_TCP_PORT_RANGE_STATE_FILE Used in conjunction with * GLOBUS_TCP_PORT_RANGE to maintain last used port among many * applications making use of the same port range. That last port + 1 * will be used as a starting point within the specified tcp port range * instead of always starting at the beginning. This is really only * necessary when a machine is behind a stateful firewall which is holding * a port in a different state than the application's machine. * See bugzilla.globus.org, bug 1851 for more info. * ex: GLOBUS_TCP_PORT_RANGE_STATE_FILE=/tmp/port_state * (file will be created if it does not exist) * - GLOBUS_TCP_SOURCE_RANGE Used to restrict local ports used in a connection * - GLOBUS_XIO_TCP_DEBUG Available if using a debug build. See globus_debug.h * for format. The TCP driver defines the levels TRACE for all function * call tracing and INFO for write buffer sizes * - GLOBUS_XIO_SYSTEM_DEBUG Available if using a debug build. See * globus_debug.h for format. The TCP driver uses globus_xio_system * (along with the File and UDP drivers) which defines the following * levels: TRACE for all function call tracing, DATA for data read and * written counts, INFO for some special events, and RAW which dumps the * raw buffers actually read or written. This can contain binary data, * so be careful when you enable it. */ /** * @defgroup tcp_driver_cntls Attributes and Cntls * @ingroup tcp_driver * * Tcp driver specific attrs and cntls. * * @see globus_xio_attr_cntl() * @see globus_xio_handle_cntl() * @see globus_xio_server_cntl() * @see globus_xio_data_descriptor_cntl() */ /** * @defgroup tcp_driver_types Types * @ingroup tcp_driver */ /** * @defgroup tcp_driver_errors Error Types * @ingroup tcp_driver * * The TCP driver is very close to the system code, so most errors * reported by it are converted from the system errno. A few of the exceptions * are GLOBUS_XIO_ERROR_EOF, GLOBUS_XIO_ERROR_COMMAND, * GLOBUS_XIO_ERROR_CONTACT_STRING, GLOBUS_XIO_ERROR_CANCELED, and * @ref GLOBUS_XIO_TCP_ERROR_NO_ADDRS * * @see globus_xio_driver_error_match() * @see globus_error_errno_match() */ /** * Invalid handle type * @ingroup tcp_driver_types * @hideinitializer * @see GLOBUS_XIO_TCP_SET_HANDLE */ #define GLOBUS_XIO_TCP_INVALID_HANDLE GLOBUS_XIO_SYSTEM_INVALID_SOCKET /** * TCP driver specific error types * @ingroup tcp_driver_errors */ typedef enum { /** * Indicates that no IPv4/6 compatible sockets could be resolved * for the specified hostname */ GLOBUS_XIO_TCP_ERROR_NO_ADDRS } globus_xio_tcp_error_type_t; /** doxygen varargs filter stuff * GlobusVarArgDefine( * attr, globus_result_t, globus_xio_attr_cntl, attr, driver) * GlobusVarArgDefine( * handle, globus_result_t, globus_xio_handle_cntl, handle, driver) * GlobusVarArgDefine( * server, globus_result_t, globus_xio_server_cntl, server, driver) * GlobusVarArgDefine( * dd, globus_result_t, globus_xio_data_descriptor_cntl, dd, driver) */ /** * TCP driver specific cntls * @ingroup tcp_driver_cntls */ typedef enum { /** GlobusVarArgEnum(attr) * Set the tcp service name to bind to. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create(). * * @param service_name * The service name to use when setting up the listener. If the * service name cannot be resolved, the port (if one is set) will * be used instead. * * string opt: port= */ /* const char * service_name */ GLOBUS_XIO_TCP_SET_SERVICE, /** GlobusVarArgEnum(attr) * Get the tcp service name to bind to. * @ingroup tcp_driver_cntls * * @param service_name_out * A pointer to the service name will be stored here If none is set, * NULL will be passed back. Otherwise, the name will be * duplicated with strdup() and the user should call free() on it. */ /* char ** service_name_out */ GLOBUS_XIO_TCP_GET_SERVICE, /** GlobusVarArgEnum(attr) * Set the tcp port number to bind to. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create(). The default * port number is 0 (system assigned) * * @param listener_port * The port number to use when setting up the listener. If the * service name is also set, this will only be used if that can't be * resolved. * * string opt: port= */ /* int listener_port */ GLOBUS_XIO_TCP_SET_PORT, /** GlobusVarArgEnum(attr) * Get the tcp port number to bind to. * @ingroup tcp_driver_cntls * * @param listener_port_out * The port will be stored here. */ /* int * listener_port_out */ GLOBUS_XIO_TCP_GET_PORT, /** GlobusVarArgEnum(attr) * Set the listener backlog on a server. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create(). The default * backlog is -1 (system maximum) * * @param listener_backlog * This indicates the maximum length of the system's queue of * pending connections. Any connection attempts when the queue is * full will fail. If backlog is equal to -1, then the system-specific * maximum queue length will be used. */ /* int listener_backlog */ GLOBUS_XIO_TCP_SET_BACKLOG, /** GlobusVarArgEnum(attr) * Get the listener backlog on an attr. * @ingroup tcp_driver_cntls * * @param listener_backlog_out * The backlog will be stored here. */ /* int * listener_backlog_out */ GLOBUS_XIO_TCP_GET_BACKLOG, /** GlobusVarArgEnum(attr) * Set the tcp port range to confine the server to. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create() where no * specific service or port has been set. It overrides the range set in * the GLOBUS_TCP_PORT_RANGE env variable. If 'restrict port' is true, * the server's listening port will be constrained to the range specified. * * @param listener_min_port * The lower bound on the listener port. (default 0 -- no bound) * * @param listener_max_port * The upper bound on the listener port. (default 0 -- no bound) * * @see GLOBUS_XIO_TCP_SET_RESTRICT_PORT * * string opt: listen_range=, */ /* int listener_min_port, * int listener_max_port */ GLOBUS_XIO_TCP_SET_LISTEN_RANGE, /** GlobusVarArgEnum(attr) * Get the tcp port range on an attr. * @ingroup tcp_driver_cntls * * @param listener_min_port_out * The lower bound will be stored here. * * @param listener_max_port_out * The upper bound will be stored here. */ /* int * listener_min_port_out, * int * listener_max_port_out */ GLOBUS_XIO_TCP_GET_LISTEN_RANGE, /** GlobusVarArgEnum(attr, handle, server) * Get the tcp socket handle on an attr, handle, or server. * @ingroup tcp_driver_cntls * * @param handle_out * The tcp socket will be stored here. If none is set, * GLOBUS_XIO_TCP_INVALID_HANDLE will be set. */ /* globus_xio_system_socket_t * handle_out */ GLOBUS_XIO_TCP_GET_HANDLE, /** GlobusVarArgEnum(attr) * Set the tcp socket to use for a handle or server. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create() or * @ref globus_xio_register_open(). * * @param handle * Use this handle (fd or SOCKET) for the listener or connection. * Note: close() will not be called on this handle. */ /* globus_xio_system_socket_t handle */ GLOBUS_XIO_TCP_SET_HANDLE, /** GlobusVarArgEnum(attr) * Set the interface to bind a listener or connection to. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create() or * @ref globus_xio_register_open. * * @param interface * The interface to use. Can be a hostname or numeric IP * * string opt: iface= */ /* const char * interface */ GLOBUS_XIO_TCP_SET_INTERFACE, /** GlobusVarArgEnum(attr) * Get the interface on the attr. * @ingroup tcp_driver_cntls * * @param interface_out * A pointer to the interface will be stored here If one is set, * NULL will be passed back. Otherwise, the interface will be * duplicated with strdup() and the user should call free() on it. */ /* char ** interface_out */ GLOBUS_XIO_TCP_GET_INTERFACE, /** GlobusVarArgEnum(attr) * Enable or disable the listener or connector range constraints. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create() or * @ref globus_xio_register_open(). This enables or ignores the port range * found in the attr or in then env. By default, those ranges are enabled. * * @param restrict_port * GLOBUS_TRUE to enable (default), GLOBUS_FALSE to disable. * * @see GLOBUS_XIO_TCP_SET_LISTEN_RANGE * @see GLOBUS_XIO_TCP_SET_CONNECT_RANGE */ /* globus_bool_t restrict_port */ GLOBUS_XIO_TCP_SET_RESTRICT_PORT, /** GlobusVarArgEnum(attr) * Get the restrict port flag. * @ingroup tcp_driver_cntls * * @param restrict_port_out * The restrict port flag will be stored here. */ /* globus_bool_t * restrict_port_out */ GLOBUS_XIO_TCP_GET_RESTRICT_PORT, /** GlobusVarArgEnum(attr) * Reuse addr when binding. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create() or * @ref globus_xio_register_open() to determine whether or not to allow * reuse of addresses when binding a socket to a port number. * * @param resuseaddr * GLOBUS_TRUE to allow, GLOBUS_FALSE to disallow (default) * * string opt: reuse= */ /* globus_bool_t resuseaddr */ GLOBUS_XIO_TCP_SET_REUSEADDR, /** GlobusVarArgEnum(attr) * Get the reuseaddr flag on an attr. * @ingroup tcp_driver_cntls * * @param resuseaddr_out * The reuseaddr flag will be stored here. */ /* globus_bool_t * resuseaddr_out */ GLOBUS_XIO_TCP_GET_REUSEADDR, /** GlobusVarArgEnum(attr) * Restrict to IPV4 only. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_server_create() or * @ref globus_xio_register_open(). Disallow IPV6 sockets from being used * (default is to use either ipv4 or ipv6) * * @param no_ipv6 * GLOBUS_TRUE to disallow ipv6, GLOBUS_FALSE to allow (default) * * string opt: noipv6= */ /* globus_bool_t no_ipv6 */ GLOBUS_XIO_TCP_SET_NO_IPV6, /** GlobusVarArgEnum(attr) * Get the no ipv6 flag on an attr. * @ingroup tcp_driver_cntls * * @param no_ipv6_out * The no ipv6 flag will be stored here. */ /* globus_bool_t * no_ipv6_out */ GLOBUS_XIO_TCP_GET_NO_IPV6, /** GlobusVarArgEnum(attr) * Set the tcp port range to confine the server to. * @ingroup tcp_driver_cntls * Used only on attrs for @ref globus_xio_register_open(). It overrides * the range set in the GLOBUS_TCP_SOURCE_RANGE env variable. If * 'restrict port' is true, the connecting socket's local port will be * constrained to the range specified. * * @param connector_min_port * The lower bound on the listener port. (default 0 -- no bound) * * @param connector_max_port * The upper bound on the listener port. (default 0 -- no bound) * * @see GLOBUS_XIO_TCP_SET_RESTRICT_PORT */ /* int connector_min_port, * int connector_max_port */ GLOBUS_XIO_TCP_SET_CONNECT_RANGE, /** GlobusVarArgEnum(attr) * Get the tcp source port range on an attr. * @ingroup tcp_driver_cntls * * @param connector_min_port_out * The lower bound will be stored here. * * @param connector_max_port_out * The upper bound will be stored here. */ /* int * connector_min_port_out, * int * connector_max_port_out */ GLOBUS_XIO_TCP_GET_CONNECT_RANGE, /** GlobusVarArgEnum(attr, handle) * Enable tcp keepalive. * @ingroup tcp_driver_cntls * Used on attrs for @ref globus_xio_server_create(), * @ref globus_xio_register_open() and with @ref globus_xio_handle_cntl() * to determine whether or not to periodically send "keepalive" messages * on a connected socket handle. This may enable earlier detection of * broken connections. * * @param keepalive * GLOBUS_TRUE to enable, GLOBUS_FALSE to disable (default) * * string opt: keepalive= */ /* globus_bool_t keepalive */ GLOBUS_XIO_TCP_SET_KEEPALIVE, /** GlobusVarArgEnum(attr, handle) * Get the tcp keepalive flag. * @ingroup tcp_driver_cntls * * @param keepalive_out * The tcp keepalive flag will be stored here. */ /* globus_bool_t * keepalive_out */ GLOBUS_XIO_TCP_GET_KEEPALIVE, /** GlobusVarArgEnum(attr, handle) * Set tcp linger. * @ingroup tcp_driver_cntls * Used on attrs for @ref globus_xio_server_create(), * @ref globus_xio_register_open() and with @ref globus_xio_handle_cntl() * to determine what to do when data is in the socket's buffer when the * socket is closed. If linger is set to true, then the close operation * will block until the socket buffers are empty, or the linger_time has * expired. If this is enabled, any data remaining after the linger time * has expired, will be discarded. If this is disabled, close finishes * immediately, but the OS will still attempt to transmit the remaining * data. * * @param linger * GLOBUS_TRUE to enable, GLOBUS_FALSE to disable (default) * * @param linger_time * The time (in seconds) to block at close time if linger is true * and data is queued in the socket buffer. */ /* globus_bool_t linger, * int linger_time */ GLOBUS_XIO_TCP_SET_LINGER, /** GlobusVarArgEnum(attr, handle) * Get the tcp linger flag and time. * @ingroup tcp_driver_cntls * * @param linger_out * The linger flag will be stored here. * * @param linger_time_out * The linger time will be set here. */ /* globus_bool_t * linger_out, * int * linger_time_out */ GLOBUS_XIO_TCP_GET_LINGER, /** GlobusVarArgEnum(attr, handle) * Receive out of band data (tcp urgent data) in normal stream. * @ingroup tcp_driver_cntls * Used on attrs for @ref globus_xio_server_create(), * @ref globus_xio_register_open() and with @ref globus_xio_handle_cntl() * to choose whether out-of-band data is received in the normal data * queue. (Currently, there is no other way to receive OOB data) * * @param oobinline * GLOBUS_TRUE to enable, GLOBUS_FALSE to disable (default) */ /* globus_bool_t oobinline */ GLOBUS_XIO_TCP_SET_OOBINLINE, /** GlobusVarArgEnum(attr, handle) * Get the oobinline flag. * @ingroup tcp_driver_cntls * * @param oobinline_out * The oobinline flag will be stored here. */ /* globus_bool_t * oobinline_out */ GLOBUS_XIO_TCP_GET_OOBINLINE, /** GlobusVarArgEnum(attr, handle) * Set the tcp socket send buffer size. * @ingroup tcp_driver_cntls * Used on attrs for @ref globus_xio_server_create(), * @ref globus_xio_register_open() and with @ref globus_xio_handle_cntl() * to set the size of the send buffer used on the socket. * * @param sndbuf * The send buffer size in bytes to use. (default is system specific) * * string opt: sndbuf= */ /* int sndbuf */ GLOBUS_XIO_TCP_SET_SNDBUF, /** GlobusVarArgEnum(attr, handle) * Get the tcp send buffer size on the attr or handle. * @ingroup tcp_driver_cntls * * @param sndbuf_out * The send buffer size will be stored here. */ /* int * sndbuf_out */ GLOBUS_XIO_TCP_GET_SNDBUF, /** GlobusVarArgEnum(attr, handle) * Set the tcp socket receive buffer size. * @ingroup tcp_driver_cntls * Used on attrs for @ref globus_xio_server_create(), * @ref globus_xio_register_open() and with @ref globus_xio_handle_cntl() * to set the size of the receive buffer used on the socket. The receive * buffer size is often used by the operating system to choose the * appropriate TCP window size. * * @param rcvbuf * The receive buffer size in bytes. (default is system specific) * * string opt: rcvbuf= */ /* int rcvbuf */ GLOBUS_XIO_TCP_SET_RCVBUF, /** GlobusVarArgEnum(attr, handle) * Get the tcp receive buffer size on the attr or handle. * @ingroup tcp_driver_cntls * * @param rcvbuf_out * The receive buffer size will be stored here. */ /* int * rcvbuf_out */ GLOBUS_XIO_TCP_GET_RCVBUF, /** GlobusVarArgEnum(attr, handle) * Disable Nagle's algorithm. * @ingroup tcp_driver_cntls * Used on attrs for @ref globus_xio_server_create(), * @ref globus_xio_register_open() and with @ref globus_xio_handle_cntl() * to determine whether or not to disable Nagle's algorithm. If set to * GLOBUS_TRUE, the socket will send packets as soon as possible with * no unnecessary delays introduced. * * @param nodelay * GLOBUS_TRUE to disable nagle, GLOBUS_FALSE to enable (default) * * string opt: nodelay= */ /* globus_bool_t nodelay */ GLOBUS_XIO_TCP_SET_NODELAY, /** GlobusVarArgEnum(attr, handle) * Get the tcp nodelay flag. * @ingroup tcp_driver_cntls * * @param nodelay_out * The no delay flag will be stored here. */ /* globus_bool_t * nodelay_out */ GLOBUS_XIO_TCP_GET_NODELAY, /**GlobusVarArgEnum(dd) * Set tcp send flags. * @ingroup tcp_driver_cntls * Used only for data descriptors to write calls. * * @param send_flags * The flags to use when sending data. * * @see globus_xio_tcp_send_flags_t */ /* int send_flags */ GLOBUS_XIO_TCP_SET_SEND_FLAGS, /**GlobusVarArgEnum(dd) * Get tcp send flags. * @ingroup tcp_driver_cntls * * @param send_flags_out * The flags to use will be stored here. */ /* int * send_flags_out */ GLOBUS_XIO_TCP_GET_SEND_FLAGS, /**GlobusVarArgEnum(handle, server) * Get local socket info. * @ingroup tcp_driver_cntls * * @param contact_string_out * A pointer to a contact string for the local end of a connected * socket or listener will be stored here. The user should free() it * when done with it. It will be in the format: \:\ * * @see globus_xio_server_get_contact_string() * @see GLOBUS_XIO_GET_LOCAL_CONTACT */ /* char ** contact_string_out */ GLOBUS_XIO_TCP_GET_LOCAL_CONTACT, /**GlobusVarArgEnum(handle, server) * Get local socket info. * @ingroup tcp_driver_cntls * * @param contact_string_out * A pointer to a contact string for the local end of a connected * socket or listener will be stored here. The user should free() it * when done with it. It will be in the format: \:\ * * @see GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT */ /* char ** contact_string_out */ GLOBUS_XIO_TCP_GET_LOCAL_NUMERIC_CONTACT, /**GlobusVarArgEnum(handle) * Get remote socket info. * @ingroup tcp_driver_cntls * * @param contact_string_out * A pointer to a contact string for the remote end of a connected * socket will be stored here. The user should free() it * when done with it. It will be in the format: \:\ * * @see GLOBUS_XIO_GET_REMOTE_CONTACT */ /* char ** contact_string_out */ GLOBUS_XIO_TCP_GET_REMOTE_CONTACT, /**GlobusVarArgEnum(handle) * Get remote socket info. * @ingroup tcp_driver_cntls * * @param contact_string_out * A pointer to a contact string for the remote end of a connected * socket will be stored here. The user should free() it * when done with it. It will be in the format: \:\ * * @see GLOBUS_XIO_GET_REMOTE_NUMERIC_CONTACT */ /* char ** contact_string_out */ GLOBUS_XIO_TCP_GET_REMOTE_NUMERIC_CONTACT, /**GlobusVarArgEnum(attr) * Change the default attr values. * @ingroup tcp_driver_cntls * * @param affect_global * If GLOBUS_TRUE, any future cntls on this attr will access * the global default attr (which all new attrs are initialized from) * The default is GLOBUS_FALSE. Note: this should only be used at * the application level and there should only be one. There is no * mutex protecting the global attr. This feature should not be * abused. There are some attrs that make no sense to change * globally. Attrs that do include the tcp port range stuff, socket * buffer sizes, etc. */ /* globus_bool_t affect_global */ GLOBUS_XIO_TCP_AFFECT_ATTR_DEFAULTS, /** GlobusVarArgEnum(attr, handle) * Enable true blocking io when making globus_xio_read/write() calls. * Note: use with caution. you can deadlock an entire app with this. * @ingroup tcp_driver_cntls * * @param use_blocking_io * If GLOBUS_TRUE, true blocking io will be enabled. * GLOBUS_FALSE will disable it (default); */ /* globus_bool_t use_blocking_io */ GLOBUS_XIO_TCP_SET_BLOCKING_IO, /** GlobusVarArgEnum(attr, handle) * Get the blocking io status in use or in attr. * @ingroup tcp_driver_cntls * * @param use_blocking_io_out * The flag will be set here. GLOBUS_TRUE for enabled. */ /* globus_bool_t * use_blocking_io_out */ GLOBUS_XIO_TCP_GET_BLOCKING_IO } globus_xio_tcp_cmd_t; /** * TCP driver specific types * @ingroup tcp_driver_types * @hideinitializer */ typedef enum { /** * Use this with @ref GLOBUS_XIO_TCP_SET_SEND_FLAGS to send a TCP message * out of band (Urgent data flag set) */ GLOBUS_XIO_TCP_SEND_OOB = MSG_OOB } globus_xio_tcp_send_flags_t; #endif globus_xio-3.6/builtins/tcp/Makefile.am0000666000076400007640000000065611462370273015160 00000000000000include $(top_srcdir)/globus_automake_pre Sources= \ globus_xio_tcp_driver.c include_HEADERS = \ globus_xio_tcp_driver.h noinst_LTLIBRARIES = libglobus_xio_tcp_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_tcp_driver_la_SOURCES = $(Sources) libglobus_xio_tcp_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_tcp_driver_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/tcp/Makefile.in0000664000076400007640000004374512225614604015172 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins/tcp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_tcp_driver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_tcp_driver.lo am_libglobus_xio_tcp_driver_la_OBJECTS = $(am__objects_1) libglobus_xio_tcp_driver_la_OBJECTS = \ $(am_libglobus_xio_tcp_driver_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_tcp_driver_la_SOURCES) DIST_SOURCES = $(libglobus_xio_tcp_driver_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies Sources = \ globus_xio_tcp_driver.c include_HEADERS = \ globus_xio_tcp_driver.h noinst_LTLIBRARIES = libglobus_xio_tcp_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_tcp_driver_la_SOURCES = $(Sources) libglobus_xio_tcp_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_tcp_driver_la_LIBADD = $(GPT_LIB_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/tcp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/tcp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio_tcp_driver.la: $(libglobus_xio_tcp_driver_la_OBJECTS) $(libglobus_xio_tcp_driver_la_DEPENDENCIES) $(LINK) $(libglobus_xio_tcp_driver_la_LDFLAGS) $(libglobus_xio_tcp_driver_la_OBJECTS) $(libglobus_xio_tcp_driver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-includeHEADERS : unlink: unlink-recursive unlink-includeHEADERS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS filelist: filelist-recursive filelist-includeHEADERS : link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/builtins/file/0000775000076400007640000000000012225614636013326 500000000000000globus_xio-3.6/builtins/file/globus_xio_file_driver.c0000666000076400007640000006650611725055764020162 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio_driver.h" #include "globus_xio_file_driver.h" #include "version.h" #include GlobusDebugDefine(GLOBUS_XIO_FILE); #define GlobusXIOFileDebugPrintf(level, message) \ GlobusDebugPrintf(GLOBUS_XIO_FILE, level, message) #define GlobusXIOFileDebugEnter() \ GlobusXIOFileDebugPrintf( \ GLOBUS_L_XIO_FILE_DEBUG_TRACE, \ (_XIOSL("[%s] Entering\n"), _xio_name)) #define GlobusXIOFileDebugExit() \ GlobusXIOFileDebugPrintf( \ GLOBUS_L_XIO_FILE_DEBUG_TRACE, \ (_XIOSL("[%s] Exiting\n"), _xio_name)) #define GlobusXIOFileDebugExitWithError() \ GlobusXIOFileDebugPrintf( \ GLOBUS_L_XIO_FILE_DEBUG_TRACE, \ (_XIOSL("[%s] Exiting with error\n"), _xio_name)) enum globus_l_xio_error_levels { GLOBUS_L_XIO_FILE_DEBUG_TRACE = 1, GLOBUS_L_XIO_FILE_DEBUG_INFO = 2 }; static int globus_l_xio_file_activate(void); static int globus_l_xio_file_deactivate(void); GlobusXIODefineModule(file) = { "globus_xio_file", globus_l_xio_file_activate, globus_l_xio_file_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; /* * attribute structure */ typedef struct { int mode; int flags; globus_off_t trunc_offset; globus_xio_system_file_t fd; globus_bool_t use_blocking_io; } globus_l_attr_t; /* default attr */ static const globus_l_attr_t globus_l_xio_file_attr_default = { GLOBUS_XIO_FILE_IRUSR | /* mode */ GLOBUS_XIO_FILE_IWUSR | GLOBUS_XIO_FILE_IRGRP | GLOBUS_XIO_FILE_IROTH, GLOBUS_XIO_FILE_CREAT | /* flags */ GLOBUS_XIO_FILE_RDWR | GLOBUS_XIO_FILE_BINARY, 0, /* trunc_offset */ GLOBUS_XIO_FILE_INVALID_HANDLE, /* handle */ GLOBUS_FALSE /* use_blocking_io */ }; /* * handle structure */ typedef struct { globus_xio_system_file_handle_t system; globus_xio_system_file_t fd; globus_bool_t converted; globus_bool_t use_blocking_io; globus_mutex_t lock; /* only used to protect below */ globus_off_t file_position; } globus_l_handle_t; #define GlobusXIOFileGetFilePosition(handle) \ globus_l_xio_file_update_position(handle, 0, SEEK_CUR) static globus_off_t globus_l_xio_file_update_position( globus_l_handle_t * handle, globus_off_t offset, int whence) { globus_mutex_lock(&handle->lock); { if(whence == SEEK_SET) { handle->file_position = offset; } else if(whence == SEEK_CUR) { handle->file_position += offset; } else if(whence == SEEK_END) { globus_off_t size; size = globus_xio_system_file_get_size(handle->fd); if(size != -1) { handle->file_position = size; } handle->file_position += offset; } offset = handle->file_position; } globus_mutex_unlock(&handle->lock); return offset; } /* * initialize a driver attribute */ static globus_result_t globus_l_xio_file_attr_init( void ** out_attr) { globus_l_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_file_attr_init); GlobusXIOFileDebugEnter(); /* * create a file attr structure and intialize its values */ attr = (globus_l_attr_t *) globus_malloc(sizeof(globus_l_attr_t)); if(!attr) { result = GlobusXIOErrorMemory("attr"); goto error_attr; } memcpy(attr, &globus_l_xio_file_attr_default, sizeof(globus_l_attr_t)); *out_attr = attr; GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; error_attr: GlobusXIOFileDebugExitWithError(); return result; } static globus_result_t globus_l_xio_file_string_cntl_mode( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { globus_result_t result; int mode = 0; int sc; int mode_i; int u; int g; int o; GlobusXIOName(globus_l_xio_file_string_cntl_mode); sc = sscanf(val, "%d", &mode_i); if(sc != 1) { result = GlobusXIOErrorParse(val); goto error; } u = mode_i / 100; mode_i -= u * 100; g = mode_i / 10; o = mode_i % 10; if(u & 1) { mode |= GLOBUS_XIO_FILE_IXUSR; } if(u & 2) { mode |= GLOBUS_XIO_FILE_IWUSR; } if(u & 3) { mode |= GLOBUS_XIO_FILE_IRUSR; } if(g & 1) { mode |= GLOBUS_XIO_FILE_IXGRP; } if(g & 2) { mode |= GLOBUS_XIO_FILE_IWGRP; } if(g & 3) { mode |= GLOBUS_XIO_FILE_IRGRP; } if(o & 1) { mode |= GLOBUS_XIO_FILE_IXOTH; } if(o & 2) { mode |= GLOBUS_XIO_FILE_IWOTH; } if(o & 3) { mode |= GLOBUS_XIO_FILE_IROTH; } result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, mode); return result; error: return result; } static globus_result_t globus_l_xio_file_string_cntl_flags( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { globus_result_t result; int flags = 0; if(strcmp(val, "r") == 0) { flags = GLOBUS_XIO_FILE_RDONLY; } else if(strcmp(val, "r+") == 0) { flags = GLOBUS_XIO_FILE_RDWR; } else if(strcmp(val, "w") == 0) { flags = GLOBUS_XIO_FILE_WRONLY | GLOBUS_XIO_FILE_CREAT | GLOBUS_XIO_FILE_TRUNC; } else if(strcmp(val, "w+") == 0) { flags = GLOBUS_XIO_FILE_RDWR | GLOBUS_XIO_FILE_CREAT; } else if(strcmp(val, "a") == 0) { flags = GLOBUS_XIO_FILE_CREAT | GLOBUS_XIO_FILE_WRONLY | GLOBUS_XIO_FILE_APPEND; } else if(strcmp(val, "a+") == 0) { flags = GLOBUS_XIO_FILE_CREAT | GLOBUS_XIO_FILE_RDWR | GLOBUS_XIO_FILE_APPEND; } result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, flags); return result; } static globus_xio_string_cntl_table_t file_l_string_opts_table[] = { {"flags", GLOBUS_XIO_FILE_SET_FLAGS, globus_l_xio_file_string_cntl_flags}, {"mode", GLOBUS_XIO_FILE_SET_MODE, globus_l_xio_file_string_cntl_mode}, {"blocking", GLOBUS_XIO_FILE_SET_BLOCKING_IO, globus_xio_string_cntl_bool}, {NULL, 0, NULL} }; /* nk* modify the attribute structure */ static globus_result_t globus_l_xio_file_attr_cntl( void * driver_attr, int cmd, va_list ap) { globus_l_attr_t * attr; int * out_int; globus_xio_system_file_t * out_fd; globus_off_t * out_offset; globus_bool_t * out_bool; GlobusXIOName(globus_l_xio_file_attr_cntl); GlobusXIOFileDebugEnter(); attr = (globus_l_attr_t *) driver_attr; switch(cmd) { /* int mode */ case GLOBUS_XIO_FILE_SET_MODE: attr->mode = va_arg(ap, int); break; /* int * mode_out */ case GLOBUS_XIO_FILE_GET_MODE: out_int = va_arg(ap, int *); *out_int = attr->mode; break; /* int mode */ case GLOBUS_XIO_FILE_SET_FLAGS: attr->flags = va_arg(ap, int); break; /* int * mode_out */ case GLOBUS_XIO_FILE_GET_FLAGS: out_int = va_arg(ap, int *); *out_int = attr->flags; break; /* globus_off_t offset */ case GLOBUS_XIO_FILE_SET_TRUNC_OFFSET: attr->trunc_offset = va_arg(ap, globus_off_t); break; /* globus_off_t * offset_out */ case GLOBUS_XIO_FILE_GET_TRUNC_OFFSET: out_offset = va_arg(ap, globus_off_t *); *out_offset = attr->trunc_offset; break; /* globus_xio_system_file_t fd */ case GLOBUS_XIO_FILE_SET_HANDLE: attr->fd = va_arg(ap, globus_xio_system_file_t); break; /* globus_xio_system_file_t * fd */ case GLOBUS_XIO_FILE_GET_HANDLE: out_fd = va_arg(ap, globus_xio_system_file_t *); *out_fd = attr->fd; break; /* globus_bool_t use_blocking_io */ case GLOBUS_XIO_FILE_SET_BLOCKING_IO: attr->use_blocking_io = va_arg(ap, globus_bool_t); break; /* globus_bool_t * use_blocking_io */ case GLOBUS_XIO_FILE_GET_BLOCKING_IO: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->use_blocking_io; break; default: GlobusXIOFileDebugExitWithError(); return GlobusXIOErrorInvalidCommand(cmd); break; } GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; } /* * copy an attribute structure */ static globus_result_t globus_l_xio_file_attr_copy( void ** dst, void * src) { globus_l_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_file_attr_copy); GlobusXIOFileDebugEnter(); attr = (globus_l_attr_t *) globus_malloc(sizeof(globus_l_attr_t)); if(!attr) { result = GlobusXIOErrorMemory("attr"); goto error_attr; } memcpy(attr, src, sizeof(globus_l_attr_t)); *dst = attr; GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; error_attr: GlobusXIOFileDebugExitWithError(); return result; } /* * destroy an attr structure */ static globus_result_t globus_l_xio_file_attr_destroy( void * driver_attr) { GlobusXIOName(globus_l_xio_file_attr_destroy); GlobusXIOFileDebugEnter(); globus_free(driver_attr); GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_file_handle_init( globus_l_handle_t ** handle) { globus_result_t result; GlobusXIOName(globus_l_xio_file_handle_init); GlobusXIOFileDebugEnter(); *handle = (globus_l_handle_t *) globus_calloc(1, sizeof(globus_l_handle_t)); if(!*handle) { result = GlobusXIOErrorMemory("handle"); goto error_handle; } globus_mutex_init(&(*handle)->lock, NULL); GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; error_handle: GlobusXIOFileDebugExitWithError(); return result; } static void globus_l_xio_file_handle_destroy( globus_l_handle_t * handle) { GlobusXIOName(globus_l_xio_file_handle_destroy); GlobusXIOFileDebugEnter(); globus_mutex_destroy(&handle->lock); globus_free(handle); GlobusXIOFileDebugExit(); } /* * open a file */ static globus_result_t globus_l_xio_file_open( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op) { globus_l_handle_t * handle; const globus_l_attr_t * attr; globus_result_t result; globus_xio_system_file_t converted_fd; globus_bool_t converted_std = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_file_open); GlobusXIOFileDebugEnter(); attr = (globus_l_attr_t *) driver_attr ? driver_attr : &globus_l_xio_file_attr_default; result = globus_l_xio_file_handle_init(&handle); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_file_handle_init", result); goto error_handle; } handle->use_blocking_io = attr->use_blocking_io; converted_fd = attr->fd; if(converted_fd == GLOBUS_XIO_FILE_INVALID_HANDLE && !contact_info->resource && contact_info->scheme) { converted_fd = globus_xio_system_convert_stdio(contact_info->scheme); if(converted_fd != GLOBUS_XIO_FILE_INVALID_HANDLE) { converted_std = GLOBUS_TRUE; } } if(converted_fd == GLOBUS_XIO_FILE_INVALID_HANDLE) { int flags; globus_off_t trunc_offset = 0; if(!contact_info->resource) { result = GlobusXIOErrorContactString("missing path"); goto error_pathname; } flags = attr->flags; if((attr->flags & GLOBUS_XIO_FILE_TRUNC) && attr->trunc_offset > 0) { flags = flags & ~GLOBUS_XIO_FILE_TRUNC; trunc_offset = attr->trunc_offset; } #ifdef O_LARGEFILE flags |= O_LARGEFILE; #endif result = globus_xio_system_file_open( &handle->fd, contact_info->resource, flags, attr->mode); if(result != GLOBUS_SUCCESS) { goto error_open; } if(trunc_offset > 0) { result = globus_xio_system_file_truncate( handle->fd, trunc_offset); if(result != GLOBUS_SUCCESS) { goto error_truncate; } } } else { handle->fd = converted_fd; handle->converted = GLOBUS_TRUE; if(!converted_std && attr->flags & GLOBUS_XIO_FILE_TRUNC) { result = globus_xio_system_file_truncate( handle->fd, attr->trunc_offset); if(result != GLOBUS_SUCCESS) { goto error_truncate; } } handle->file_position = globus_xio_system_file_get_position(handle->fd); } result = globus_xio_system_file_init(&handle->system, handle->fd); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_file_init", result); goto error_init; } globus_xio_driver_finished_open(handle, op, GLOBUS_SUCCESS); GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; error_init: error_truncate: if(!handle->converted) { globus_xio_system_file_close(handle->fd); } error_open: if(handle->converted) { result = GlobusXIOErrorWrapFailedWithMessage(result, "Unable to convert file handle %ld", (long) handle->fd); } else { result = GlobusXIOErrorWrapFailedWithMessage(result, "Unable to open file %s", contact_info->resource); } error_pathname: globus_l_xio_file_handle_destroy(handle); error_handle: GlobusXIOFileDebugExitWithError(); return result; } /* * close a file */ static globus_result_t globus_l_xio_file_close( void * driver_specific_handle, void * attr, globus_xio_operation_t op) { globus_l_handle_t * handle; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_file_close); GlobusXIOFileDebugEnter(); handle = (globus_l_handle_t *) driver_specific_handle; globus_xio_system_file_destroy(handle->system); if(!handle->converted) { res = globus_xio_system_file_close(handle->fd); } globus_xio_driver_finished_close(op, res); globus_l_xio_file_handle_destroy(handle); GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; } static void globus_l_xio_file_system_read_cb( globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_xio_operation_t op; GlobusXIOName(globus_l_xio_file_system_read_cb); GlobusXIOFileDebugEnter(); op = (globus_xio_operation_t) user_arg; globus_l_xio_file_update_position( (globus_l_handle_t *) globus_xio_operation_get_driver_specific(op), nbytes, SEEK_CUR); globus_xio_driver_finished_read(op, result, nbytes); GlobusXIOFileDebugExit(); } /* * read from a file */ static globus_result_t globus_l_xio_file_read( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_handle_t * handle; globus_size_t nbytes; globus_result_t result; globus_off_t offset; GlobusXIOName(globus_l_xio_file_read); GlobusXIOFileDebugEnter(); handle = (globus_l_handle_t *) driver_specific_handle; result = globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_GET_OFFSET, &offset); if(result != GLOBUS_SUCCESS || offset == -1) { offset = GlobusXIOFileGetFilePosition(handle); } else { globus_l_xio_file_update_position(handle, offset, SEEK_SET); } GlobusXIOFileDebugPrintf( GLOBUS_L_XIO_FILE_DEBUG_INFO, ("[%s] count=%d, 1st buflen=%d offset=%" GLOBUS_OFF_T_FORMAT "\n", _xio_name, iovec_count, (int) iovec[0].iov_len, offset)); /* if buflen and waitfor are both 0, we behave like register select */ if((globus_xio_operation_get_wait_for(op) == 0 && (iovec_count > 1 || iovec[0].iov_len > 0)) || (handle->use_blocking_io && globus_xio_driver_operation_is_blocking(op))) { result = globus_xio_system_file_read( handle->system, offset, iovec, iovec_count, globus_xio_operation_get_wait_for(op), &nbytes); globus_l_xio_file_update_position(handle, nbytes, SEEK_CUR); globus_xio_driver_finished_read(op, result, nbytes); result = GLOBUS_SUCCESS; } else { result = globus_xio_system_file_register_read( op, handle->system, offset, iovec, iovec_count, globus_xio_operation_get_wait_for(op), globus_l_xio_file_system_read_cb, op); } GlobusXIOFileDebugExit(); return result; } static void globus_l_xio_file_system_write_cb( globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_xio_operation_t op; GlobusXIOName(globus_l_xio_file_system_write_cb); GlobusXIOFileDebugEnter(); op = (globus_xio_operation_t) user_arg; globus_l_xio_file_update_position( (globus_l_handle_t *) globus_xio_operation_get_driver_specific(op), nbytes, SEEK_CUR); globus_xio_driver_finished_write(op, result, nbytes); GlobusXIOFileDebugExit(); } /* * write to a file */ static globus_result_t globus_l_xio_file_write( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_handle_t * handle; globus_size_t nbytes; globus_result_t result; globus_off_t offset; GlobusXIOName(globus_l_xio_file_write); GlobusXIOFileDebugEnter(); handle = (globus_l_handle_t *) driver_specific_handle; result = globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_GET_OFFSET, &offset); if(result != GLOBUS_SUCCESS || offset == -1) { offset = GlobusXIOFileGetFilePosition(handle); } else { globus_l_xio_file_update_position(handle, offset, SEEK_SET); } GlobusXIOFileDebugPrintf( GLOBUS_L_XIO_FILE_DEBUG_INFO, ("[%s] count=%d, 1st buflen=%d offset=%" GLOBUS_OFF_T_FORMAT "\n", _xio_name, iovec_count, (int) iovec[0].iov_len, offset)); /* if buflen and waitfor are both 0, we behave like register select */ if((globus_xio_operation_get_wait_for(op) == 0 && (iovec_count > 1 || iovec[0].iov_len > 0)) || (handle->use_blocking_io && globus_xio_driver_operation_is_blocking(op))) { result = globus_xio_system_file_write( handle->system, offset, iovec, iovec_count, globus_xio_operation_get_wait_for(op), &nbytes); globus_l_xio_file_update_position(handle, nbytes, SEEK_CUR); globus_xio_driver_finished_write(op, result, nbytes); result = GLOBUS_SUCCESS; } else { result = globus_xio_system_file_register_write( op, handle->system, offset, iovec, iovec_count, globus_xio_operation_get_wait_for(op), globus_l_xio_file_system_write_cb, op); } GlobusXIOFileDebugExit(); return result; } static globus_result_t globus_l_xio_file_cntl( void * driver_specific_handle, int cmd, va_list ap) { globus_result_t result = GLOBUS_SUCCESS; globus_l_handle_t * handle; globus_xio_system_file_t * out_fd; globus_off_t * offset; globus_off_t in_offset; int whence; globus_bool_t * out_bool; GlobusXIOName(globus_l_xio_file_cntl); GlobusXIOFileDebugEnter(); handle = (globus_l_handle_t *) driver_specific_handle; switch(cmd) { /* globus_off_t * in_out_offset */ /* globus_xio_file_whence_t whence */ case GLOBUS_XIO_FILE_SEEK: offset = va_arg(ap, globus_off_t *); whence = va_arg(ap, int); *offset = globus_l_xio_file_update_position(handle, *offset, whence); break; /* globus_off_t offset */ case GLOBUS_XIO_SEEK: in_offset = va_arg(ap, globus_off_t); globus_l_xio_file_update_position(handle, in_offset, SEEK_SET); break; /* globus_xio_system_file_t * handle */ case GLOBUS_XIO_FILE_GET_HANDLE: out_fd = va_arg(ap, globus_xio_system_file_t *); *out_fd = handle->fd; break; /* globus_bool_t use_blocking_io */ case GLOBUS_XIO_FILE_SET_BLOCKING_IO: handle->use_blocking_io = va_arg(ap, globus_bool_t); break; /* globus_bool_t * use_blocking_io */ case GLOBUS_XIO_FILE_GET_BLOCKING_IO: out_bool = va_arg(ap, globus_bool_t *); *out_bool = handle->use_blocking_io; break; default: result = GlobusXIOErrorInvalidCommand(cmd); break; } GlobusXIOFileDebugExit(); return result; } static globus_result_t globus_l_xio_file_init( globus_xio_driver_t * out_driver) { globus_xio_driver_t driver; globus_result_t result; GlobusXIOName(globus_l_xio_file_init); GlobusXIOFileDebugEnter(); /* I dont support any driver options, so I'll ignore the ap */ result = globus_xio_driver_init(&driver, "file", GLOBUS_NULL); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_file_handle_init", result); goto error_init; } globus_xio_driver_set_transport( driver, globus_l_xio_file_open, globus_l_xio_file_close, globus_l_xio_file_read, globus_l_xio_file_write, globus_l_xio_file_cntl); globus_xio_driver_set_attr( driver, globus_l_xio_file_attr_init, globus_l_xio_file_attr_copy, globus_l_xio_file_attr_cntl, globus_l_xio_file_attr_destroy); globus_xio_driver_string_cntl_set_table( driver, file_l_string_opts_table); *out_driver = driver; GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; error_init: GlobusXIOFileDebugExitWithError(); return result; } static void globus_l_xio_file_destroy( globus_xio_driver_t driver) { GlobusXIOName(globus_l_xio_file_destroy); GlobusXIOFileDebugEnter(); globus_xio_driver_destroy(driver); GlobusXIOFileDebugExit(); } GlobusXIODefineDriver( file, globus_l_xio_file_init, globus_l_xio_file_destroy); static int globus_l_xio_file_activate(void) { int rc; GlobusXIOName(globus_l_xio_file_activate); GlobusDebugInit(GLOBUS_XIO_FILE, TRACE INFO); GlobusXIOFileDebugEnter(); rc = globus_module_activate(GLOBUS_XIO_SYSTEM_MODULE); if(rc != GLOBUS_SUCCESS) { goto error_activate; } GlobusXIORegisterDriver(file); GlobusXIOFileDebugExit(); return GLOBUS_SUCCESS; error_activate: GlobusXIOFileDebugExitWithError(); GlobusDebugDestroy(GLOBUS_XIO_FILE); return rc; } static int globus_l_xio_file_deactivate(void) { GlobusXIOName(globus_l_xio_file_deactivate); GlobusXIOFileDebugEnter(); GlobusXIOUnRegisterDriver(file); globus_module_deactivate(GLOBUS_XIO_SYSTEM_MODULE); GlobusXIOFileDebugExit(); GlobusDebugDestroy(GLOBUS_XIO_FILE); return GLOBUS_SUCCESS; } globus_xio-3.6/builtins/file/globus_xio_file_driver.h0000666000076400007640000003075710754764037020167 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_XIO_FILE_DRIVER_INCLUDE #define GLOBUS_XIO_FILE_DRIVER_INCLUDE /** * @file * Header file for XIO File Driver */ #include "globus_xio_system.h" /** * @defgroup file_driver Globus XIO File Driver * The File I/O driver. */ /** * @defgroup file_driver_instance Opening/Closing * @ingroup file_driver * * An XIO handle with the file driver can be created with * @ref globus_xio_handle_create() * * If there is no handle set on the attr passed to the * @ref globus_xio_open() call, it performs the equivalent of an * open() call. In this case, the contact string must contain * either a pathname or one of stdin://, stdout://, or stderr://. If a * pathname is used, that path is opened. If one of the schemes are used * the corresponding stdio handle is used (retrieved with fileno()). * * In either of the above cases, it is most efficient to call the blocking * version of globus_xio_open(). It is also safe to call within a locked * critical section. * * When the XIO handle is closed, the file driver will destroy its internal * resources and close the fd (unless this fd was set on an attr or converted * from one of the stdio handles). */ /** * @defgroup file_driver_io Reading/Writing * @ingroup file_driver * * Both the @ref globus_xio_register_read() and * @ref globus_xio_register_write() calls follow similar semantics as described * below. * * If the waitforbytes parameter is greater than zero, the io will happen * asynchronously and be completed when at least waitforbytes has been * read/written. * * If the waitforbytes parameter is equal to zero, one of the following * alternative behaviors occur: * * If the length of the buffer is > 0 the read or write happens synchronously. * If the user is using one of the blocking xio calls, no internal callback * will occur. * * If the length of the buffer is also 0, the call behaves like an asynchronous * notification of data ready to be either read or written. ie, an * asynchronous select(). * * In any case, when an error or EOF occurs before the waitforbytes request * has been met, the outgoing nbytes is set to the amount of data actually * read/written before the error or EOF occurred. * * You may either use GLOBUS_XIO_FILE_SEEK or GLOBUS_XIO_SEEK to position the * file pointer before each read or write or you can specify the * desired offset on a data descriptor with the xio cmd, * GLOBUS_XIO_DD_SET_OFFSET. simultaneous reading and writing is only * predictable if the data descriptor method is used. */ /** * @defgroup file_driver_envs Env Variables * @ingroup file_driver * * The file driver uses the following environment variables * - GLOBUS_XIO_FILE_DEBUG Available if using a debug build. See globus_debug.h * for format. The File driver defines the levels TRACE for all function * call tracing and INFO for write buffer sizes * - GLOBUS_XIO_SYSTEM_DEBUG Available if using a debug build. * See globus_debug.h for format. The File driver uses globus_xio_system * (along with the TCP and UDP drivers) which defines the following * levels: TRACE for all function call tracing, DATA for data read and * written counts, INFO for some special events, and RAW which dumps the * raw buffers actually read or written. This can contain binary data, * so be careful when you enable it. */ /** * @defgroup file_driver_cntls Attributes and Cntls * @ingroup file_driver * * File driver specific attrs and cntls. * * @see globus_xio_attr_cntl() * @see globus_xio_handle_cntl() */ /** * @defgroup file_driver_types Types * @ingroup file_driver */ /** * @defgroup file_driver_errors Error Types * @ingroup file_driver * * The File driver is very close to the system code, so most errors * reported by it are converted from the system errno. A few of the exceptions * are GLOBUS_XIO_ERROR_EOF, GLOBUS_XIO_ERROR_COMMAND, * GLOBUS_XIO_ERROR_CONTACT_STRING, and GLOBUS_XIO_ERROR_CANCELED * * @see globus_error_errno_match() */ /** * Invalid handle type * @ingroup file_driver_types * @hideinitializer * @see GLOBUS_XIO_FILE_SET_HANDLE */ #define GLOBUS_XIO_FILE_INVALID_HANDLE GLOBUS_XIO_SYSTEM_INVALID_FILE /** doxygen varargs filter stuff * GlobusVarArgDefine( * attr, globus_result_t, globus_xio_attr_cntl, attr, driver) * GlobusVarArgDefine( * handle, globus_result_t, globus_xio_handle_cntl, handle, driver) */ /** * File driver specific cntls * @ingroup file_driver_cntls */ typedef enum { /** GlobusVarArgEnum(attr) * Set the file create mode. * @ingroup file_driver_cntls * Use this to set the permissions a non-existent file is created with, * The default mode is 0644. * * @param mode * A bitwise OR of all the modes desired * * @see globus_xio_file_mode_t * * string opt: mode= */ /* int mode */ GLOBUS_XIO_FILE_SET_MODE, /** GlobusVarArgEnum(attr) * Get the file create mode. * @ingroup file_driver_cntls * * @param mode_out * The current mode will be stored here. */ /* int * mode_out */ GLOBUS_XIO_FILE_GET_MODE, /** GlobusVarArgEnum(attr) * Set the file open flags. * @ingroup file_driver_cntls * The default flags specify to create the file if it doesn't exist, * open it for reading and writing, and interpret it as a binary file. * * @param flags * A bitwise OR of all the flags desired * * @see globus_xio_file_flag_t * * string opt: flags= */ /* int flags */ GLOBUS_XIO_FILE_SET_FLAGS, /** GlobusVarArgEnum(attr) * Get the file open flags. * @ingroup file_driver_cntls * * @param flags_out * The current flags will be stored here. */ /* int * flags_out */ GLOBUS_XIO_FILE_GET_FLAGS, /** GlobusVarArgEnum(attr) * Set the file truncate offset. * @ingroup file_driver_cntls * Use this in conjunction with the @ref GLOBUS_XIO_FILE_TRUNC flag * to truncate a file to a non-zero offset. If the file was larger * than offset bytes, the extra data is lost. If the file was shorter or * non-existent, it is extended and the extended part reads as zeros. * (default is 0) * * @param offset * The desired size of the file. */ /* globus_off_t offset */ GLOBUS_XIO_FILE_SET_TRUNC_OFFSET, /** GlobusVarArgEnum(attr) * Get the file truncate offset. * @ingroup file_driver_cntls * * @param offset_out * The offset will be stored here. */ /* globus_off_t * offset_out */ GLOBUS_XIO_FILE_GET_TRUNC_OFFSET, /** GlobusVarArgEnum(attr) * Set the file handle to use. * @ingroup file_driver_cntls * Do not open a new file, use this preopened handle instead. * * @param handle * Use this handle (fd or HANDLE) for the file. * Note: close() will not be called on this handle. */ /* globus_xio_system_file_t handle */ GLOBUS_XIO_FILE_SET_HANDLE, /** GlobusVarArgEnum(attr, handle) * Get the file handle in use or in attr. * @ingroup file_driver_cntls * * @param handle_out * The file handle (fd or HANDLE) will be stored here. If none is set, * GLOBUS_XIO_TCP_INVALID_HANDLE will be set. */ /* globus_xio_system_file_t * handle_out */ GLOBUS_XIO_FILE_GET_HANDLE, /** GlobusVarArgEnum(attr, handle) * Enable true blocking io when making globus_xio_read/write() calls. * Note: use with caution. you can deadlock an entire app with this. * @ingroup file_driver_cntls * * @param use_blocking_io * If GLOBUS_TRUE, true blocking io will be enabled. * GLOBUS_FALSE will disable it (default); */ /* globus_bool_t use_blocking_io */ GLOBUS_XIO_FILE_SET_BLOCKING_IO, /** GlobusVarArgEnum(attr, handle) * Get the blocking io status in use or in attr. * @ingroup file_driver_cntls * * @param use_blocking_io_out * The flag will be set here. GLOBUS_TRUE for enabled. * * string opt: blocking= */ /* globus_bool_t * use_blocking_io_out */ GLOBUS_XIO_FILE_GET_BLOCKING_IO, /** GlobusVarArgEnum(handle) * Reposition read/write file offset. * @ingroup file_driver_cntls * * @param in_out_offset * Specify the desired offset (according to whence). On success, * the actual file offset will be stored here. * * @param whence * Specify how offset should be interpreted. * * @see globus_xio_file_whence_t * @see GLOBUS_XIO_SEEK */ /* globus_off_t * in_out_offset, * globus_xio_file_whence_t whence */ GLOBUS_XIO_FILE_SEEK } globus_xio_file_attr_cmd_t; /** * File driver open flags * @ingroup file_driver_types * @hideinitializer * OR together all the flags you want * @see GLOBUS_XIO_FILE_SET_FLAGS */ typedef enum { /** Create a new file if it doesn't exist (default) */ GLOBUS_XIO_FILE_CREAT = O_CREAT, /** Fail if file already exists */ GLOBUS_XIO_FILE_EXCL = O_EXCL, /** Open for read only */ GLOBUS_XIO_FILE_RDONLY = O_RDONLY, /** Open for write only */ GLOBUS_XIO_FILE_WRONLY = O_WRONLY, /** Open for reading and writing (default) */ GLOBUS_XIO_FILE_RDWR = O_RDWR, /** Truncate file @see GLOBUS_XIO_FILE_SET_TRUNC_OFFSET */ GLOBUS_XIO_FILE_TRUNC = O_TRUNC, /** Open file for appending */ GLOBUS_XIO_FILE_APPEND = O_APPEND, #ifdef TARGET_ARCH_CYGWIN GLOBUS_XIO_FILE_BINARY = O_BINARY, GLOBUS_XIO_FILE_TEXT = O_TEXT #else /** File is binary (default) */ GLOBUS_XIO_FILE_BINARY = 0, /** File is text */ GLOBUS_XIO_FILE_TEXT = 0 #endif } globus_xio_file_flag_t; /** * File driver create mode * @ingroup file_driver_types * @hideinitializer * OR these modes together to get the mode you want. * @see GLOBUS_XIO_FILE_SET_MODE * * NOTE: for Win32, you only have a choice between read-only and read-write. * If the chosen mode does not specify writability, the file will be read only */ typedef enum { /** User read, write, and execute */ GLOBUS_XIO_FILE_IRWXU = S_IRWXU, /** User read */ GLOBUS_XIO_FILE_IRUSR = S_IRUSR, /** User write */ GLOBUS_XIO_FILE_IWUSR = S_IWUSR, /** User execute */ GLOBUS_XIO_FILE_IXUSR = S_IXUSR, /** Others read, write, and execute */ GLOBUS_XIO_FILE_IRWXO = S_IRWXO, /** Others read */ GLOBUS_XIO_FILE_IROTH = S_IROTH, /** Others write */ GLOBUS_XIO_FILE_IWOTH = S_IWOTH, /** Others execute */ GLOBUS_XIO_FILE_IXOTH = S_IXOTH, /** Group read, write, and execute */ GLOBUS_XIO_FILE_IRWXG = S_IRWXG, /** Group read */ GLOBUS_XIO_FILE_IRGRP = S_IRGRP, /** Group write */ GLOBUS_XIO_FILE_IWGRP = S_IWGRP, /** Group execute */ GLOBUS_XIO_FILE_IXGRP = S_IXGRP } globus_xio_file_mode_t; /** * File driver seek options * @ingroup file_driver_types * @hideinitializer * @see GLOBUS_XIO_FILE_SEEK */ typedef enum { /** set the file pointer at the specified offset */ GLOBUS_XIO_FILE_SEEK_SET = SEEK_SET, /** set the file pointer at current position + offset */ GLOBUS_XIO_FILE_SEEK_CUR = SEEK_CUR, /** set the file pointer at size of file + offest */ GLOBUS_XIO_FILE_SEEK_END = SEEK_END } globus_xio_file_whence_t; #endif globus_xio-3.6/builtins/file/Makefile.am0000666000076400007640000000066311462370271015305 00000000000000include $(top_srcdir)/globus_automake_pre Sources= \ globus_xio_file_driver.c include_HEADERS = \ globus_xio_file_driver.h noinst_LTLIBRARIES = libglobus_xio_file_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_file_driver_la_SOURCES = $(Sources) libglobus_xio_file_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_file_driver_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/file/Makefile.in0000664000076400007640000004377212225614604015323 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins/file ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_file_driver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_file_driver.lo am_libglobus_xio_file_driver_la_OBJECTS = $(am__objects_1) libglobus_xio_file_driver_la_OBJECTS = \ $(am_libglobus_xio_file_driver_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_file_driver_la_SOURCES) DIST_SOURCES = $(libglobus_xio_file_driver_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies Sources = \ globus_xio_file_driver.c include_HEADERS = \ globus_xio_file_driver.h noinst_LTLIBRARIES = libglobus_xio_file_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_file_driver_la_SOURCES = $(Sources) libglobus_xio_file_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_file_driver_la_LIBADD = $(GPT_LIB_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/file/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/file/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio_file_driver.la: $(libglobus_xio_file_driver_la_OBJECTS) $(libglobus_xio_file_driver_la_DEPENDENCIES) $(LINK) $(libglobus_xio_file_driver_la_LDFLAGS) $(libglobus_xio_file_driver_la_OBJECTS) $(libglobus_xio_file_driver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-includeHEADERS : unlink: unlink-recursive unlink-includeHEADERS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS filelist: filelist-recursive filelist-includeHEADERS : link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/builtins/telnet/0000775000076400007640000000000012225614640013675 500000000000000globus_xio-3.6/builtins/telnet/globus_xio_telnet.h0000666000076400007640000000154410363625133017521 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined GLOBUS_XIO_DRIVER_TELNET_H #define GLOBUS_XIO_DRIVER_TELNET_H 1 #include "globus_common.h" typedef enum globus_xio_telnet_attr_type_e { GLOBUS_XIO_TELNET_FORCE_SERVER, GLOBUS_XIO_TELNET_BUFFER } globus_xio_telnet_attr_type_t; #endif globus_xio-3.6/builtins/telnet/Makefile.am0000666000076400007640000000066011462370271015656 00000000000000include $(top_srcdir)/globus_automake_pre Sources= \ globus_xio_telnet.c include_HEADERS = \ globus_xio_telnet.h noinst_LTLIBRARIES = libglobus_xio_telnet_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_telnet_driver_la_SOURCES = $(Sources) libglobus_xio_telnet_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_telnet_driver_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/telnet/Makefile.in0000664000076400007640000004402012225614604015662 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins/telnet ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_telnet_driver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_telnet.lo am_libglobus_xio_telnet_driver_la_OBJECTS = $(am__objects_1) libglobus_xio_telnet_driver_la_OBJECTS = \ $(am_libglobus_xio_telnet_driver_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_telnet_driver_la_SOURCES) DIST_SOURCES = $(libglobus_xio_telnet_driver_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies Sources = \ globus_xio_telnet.c include_HEADERS = \ globus_xio_telnet.h noinst_LTLIBRARIES = libglobus_xio_telnet_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_telnet_driver_la_SOURCES = $(Sources) libglobus_xio_telnet_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_telnet_driver_la_LIBADD = $(GPT_LIB_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/telnet/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/telnet/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio_telnet_driver.la: $(libglobus_xio_telnet_driver_la_OBJECTS) $(libglobus_xio_telnet_driver_la_DEPENDENCIES) $(LINK) $(libglobus_xio_telnet_driver_la_LDFLAGS) $(libglobus_xio_telnet_driver_la_OBJECTS) $(libglobus_xio_telnet_driver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-includeHEADERS : unlink: unlink-recursive unlink-includeHEADERS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS filelist: filelist-recursive filelist-includeHEADERS : link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/builtins/telnet/globus_xio_telnet.c0000666000076400007640000006047511522621711017520 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio_driver.h" #include "globus_xio_load.h" #include "globus_common.h" #include "globus_xio_telnet.h" #include "globus_xio_util.h" #define GLOBUS_L_XIO_TELNET_DEFAULT_BUFFER_SIZE 1024 enum { GLOBUS_XIO_TELNET_NULL = 0, GLOBUS_XIO_TELNET_BELL = 7, GLOBUS_XIO_TELNET_BS = 8, GLOBUS_XIO_TELNET_HT = 9, GLOBUS_XIO_TELNET_LF = 10, GLOBUS_XIO_TELNET_VT = 11, GLOBUS_XIO_TELNET_FF = 12, GLOBUS_XIO_TELNET_CR = 13 }; enum { GLOBUS_XIO_TELNET_SE = 240, GLOBUS_XIO_TELNET_NOP = 241, GLOBUS_XIO_TELNET_DM = 242, GLOBUS_XIO_TELNET_BRK = 243, GLOBUS_XIO_TELNET_IP = 244, GLOBUS_XIO_TELNET_AO = 245, GLOBUS_XIO_TELNET_AYT = 246, GLOBUS_XIO_TELNET_EC = 247, GLOBUS_XIO_TELNET_EL = 248, GLOBUS_XIO_TELNET_GA = 249, GLOBUS_XIO_TELNET_SB = 250, GLOBUS_XIO_TELNET_WILL = 251, GLOBUS_XIO_TELNET_WONT = 252, GLOBUS_XIO_TELNET_DO = 253, GLOBUS_XIO_TELNET_DONT = 254, GLOBUS_XIO_TELNET_IAC = 255 }; typedef struct globus_l_xio_telnet_handle_s { globus_byte_t * write_buffer; globus_byte_t * read_buffer; globus_size_t read_buffer_length; globus_size_t read_buffer_ndx; globus_fifo_t write_q; globus_bool_t client; globus_size_t line_start_ndx; globus_bool_t create_buffer_mode; globus_mutex_t mutex; globus_xio_iovec_t * user_read_iovec; int user_read_iovec_count; globus_xio_iovec_t read_iovec; globus_xio_iovec_t write_iovec; unsigned char last_char; globus_bool_t finish; globus_result_t finish_res; globus_size_t finish_len; } globus_l_xio_telnet_handle_t; typedef struct { globus_bool_t create_buffer_mode; globus_bool_t force_server; } globus_l_xio_telnet_attr_t; typedef struct globus_l_xio_telnet_q_ent_s { globus_byte_t * start_buffer; globus_byte_t * buffer; globus_size_t length; } globus_l_xio_telnet_q_ent_t; /************************************************************************** * function prototypes * ------------------- *************************************************************************/ static int globus_l_xio_telnet_activate(); static int globus_l_xio_telnet_deactivate(); static void globus_l_xio_telnet_request_data( globus_l_xio_telnet_handle_t * handle, globus_xio_operation_t op); /************************************************************************** * global data * ----------- *************************************************************************/ #include "version.h" GlobusXIODefineModule(telnet) = { "globus_xio_telnet", globus_l_xio_telnet_activate, globus_l_xio_telnet_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; /************************************************************************ * utility functions * ------------------ * * A variety of operations use these function. ***********************************************************************/ /* * In coming buffer may shrink, if there are telnet commands in the * buffer write commands are added to the write queue. */ static globus_bool_t globus_l_xio_telnet_check_data( globus_l_xio_telnet_handle_t * handle, globus_size_t * length) { globus_bool_t done = GLOBUS_FALSE; globus_size_t len; int ndx; globus_byte_t * buffer; len = handle->read_buffer_ndx; buffer = handle->read_buffer; ndx = 0; while(ndx < len && !done) { if(handle->last_char == GLOBUS_XIO_TELNET_IAC) { switch(buffer[ndx]) { case GLOBUS_XIO_TELNET_WILL: handle->write_buffer = globus_malloc(3); handle->write_buffer[0] = GLOBUS_XIO_TELNET_IAC; handle->write_buffer[1] = GLOBUS_XIO_TELNET_DONT; break; case GLOBUS_XIO_TELNET_DO: handle->write_buffer = globus_malloc(3); handle->write_buffer[0] = GLOBUS_XIO_TELNET_IAC; handle->write_buffer[1] = GLOBUS_XIO_TELNET_WONT; break; /* 2 byte commands */ default: /* do not copy a byte */ break; } handle->last_char = buffer[ndx]; len--; if(ndx < len) { memmove(&buffer[ndx], &buffer[ndx + 1], len - ndx); } } else if(handle->last_char == GLOBUS_XIO_TELNET_WILL || handle->last_char == GLOBUS_XIO_TELNET_DO) { if(handle->write_buffer != NULL) { handle->write_buffer[2] = buffer[ndx]; globus_fifo_enqueue(&handle->write_q, handle->write_buffer); handle->write_buffer = NULL; } handle->last_char = buffer[ndx]; len--; if(ndx < len) { memmove(&buffer[ndx], &buffer[ndx + 1], len - ndx); } } else if(handle->last_char == GLOBUS_XIO_TELNET_WONT || handle->last_char == GLOBUS_XIO_TELNET_DO) { handle->last_char = buffer[ndx]; len--; if(ndx < len) { memmove(&buffer[ndx], &buffer[ndx + 1], len - ndx); } } else if((buffer[ndx] >= 32 && buffer[ndx] <= 126) || buffer[ndx] == GLOBUS_XIO_TELNET_NULL || buffer[ndx] == GLOBUS_XIO_TELNET_BELL || buffer[ndx] == GLOBUS_XIO_TELNET_BS || buffer[ndx] == GLOBUS_XIO_TELNET_HT || buffer[ndx] == GLOBUS_XIO_TELNET_CR || buffer[ndx] == GLOBUS_XIO_TELNET_VT || buffer[ndx] == GLOBUS_XIO_TELNET_FF) { handle->last_char = buffer[ndx]; ndx++; } else if(buffer[ndx] == GLOBUS_XIO_TELNET_LF && handle->last_char == GLOBUS_XIO_TELNET_CR) { if(handle->client) /* do special ftp checking here */ { if(ndx < handle->line_start_ndx + 5 || handle->read_buffer[handle->line_start_ndx+3] == ' ') { handle->line_start_ndx = 0; handle->last_char = '\0'; done = GLOBUS_TRUE; } else { handle->line_start_ndx = ndx+1; handle->last_char = buffer[ndx]; } } else { handle->last_char = '\0'; done = GLOBUS_TRUE; } ndx++; } else { handle->last_char = buffer[ndx]; len--; if(ndx < len) { memmove(&buffer[ndx], &buffer[ndx + 1], len - ndx); } } } handle->read_buffer_ndx = len; *length = ndx; return done; } static void globus_l_xio_telnet_cmd_write_cb( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_l_xio_telnet_handle_t * handle; handle = (globus_l_xio_telnet_handle_t *) user_arg; if(result != GLOBUS_SUCCESS) { globus_xio_driver_finished_read(op, result, 0); return; } globus_mutex_lock(&handle->mutex); { globus_free(handle->write_iovec.iov_base); globus_l_xio_telnet_request_data(handle, op); } globus_mutex_unlock(&handle->mutex); if(handle->finish) { handle->finish = GLOBUS_FALSE; globus_xio_driver_finished_read( op, handle->finish_res, handle->finish_len); } } static void globus_l_xio_telnet_read_cb( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_l_xio_telnet_handle_t * handle; handle = (globus_l_xio_telnet_handle_t *) user_arg; if(result != GLOBUS_SUCCESS) { globus_xio_driver_finished_read(op, result, nbytes); return; } globus_mutex_lock(&handle->mutex); { handle->read_buffer_ndx += nbytes; globus_l_xio_telnet_request_data(handle, op); } globus_mutex_unlock(&handle->mutex); if(handle->finish) { handle->finish = GLOBUS_FALSE; globus_xio_driver_finished_read( op, handle->finish_res, handle->finish_len); } } static void globus_l_xio_telnet_request_data( globus_l_xio_telnet_handle_t * handle, globus_xio_operation_t op) { globus_bool_t complete; globus_size_t end; globus_size_t len; globus_result_t res = GLOBUS_SUCCESS; globus_size_t remainder; globus_size_t diff; if(!globus_fifo_empty(&handle->write_q)) { handle->write_iovec.iov_base = globus_fifo_dequeue(&handle->write_q); handle->write_iovec.iov_len = 3; res = globus_xio_driver_pass_write( op, &handle->write_iovec, 1, 3, globus_l_xio_telnet_cmd_write_cb, handle); if(res != GLOBUS_SUCCESS) { goto err; } return; } /* is there a full command in there, updates read_buffer_ndx */ complete = globus_l_xio_telnet_check_data(handle, &end); if(complete) { remainder = handle->read_buffer_ndx - end; if(handle->create_buffer_mode) { len = end; handle->user_read_iovec->iov_base = globus_malloc(len); memcpy(handle->user_read_iovec->iov_base, handle->read_buffer, len); handle->user_read_iovec->iov_len = len; } else { if(handle->user_read_iovec->iov_len >= end) { len = end; } else { diff = end - handle->user_read_iovec->iov_len; len = handle->user_read_iovec->iov_len; end -= diff; remainder += diff; } memcpy(handle->user_read_iovec->iov_base, handle->read_buffer, len); } /* move remainder to the begining of the buffer */ if(remainder > 0) { memmove(handle->read_buffer, &handle->read_buffer[end], remainder); } handle->read_buffer_ndx = remainder; handle->finish = GLOBUS_TRUE; handle->finish_len = len; handle->finish_res = GLOBUS_SUCCESS; } else { if(handle->read_buffer_ndx + 1 >= handle->read_buffer_length) { handle->read_buffer_length *= 2; handle->read_buffer = globus_libc_realloc( handle->read_buffer, handle->read_buffer_length); } handle->read_iovec.iov_base = &handle->read_buffer[handle->read_buffer_ndx]; handle->read_iovec.iov_len = handle->read_buffer_length - handle->read_buffer_ndx; res = globus_xio_driver_pass_read( op, &handle->read_iovec, 1, 1, globus_l_xio_telnet_read_cb, handle); if(res != GLOBUS_SUCCESS) { goto err; } } return; err: handle->finish = GLOBUS_TRUE; handle->finish_len = 0; handle->finish_res = res; } static globus_result_t globus_l_xio_telnet_attr_init( void ** out_driver_attr) { globus_l_xio_telnet_attr_t * attr; globus_result_t res; GlobusXIOName(globus_l_xio_telnet_attr_init); attr = (globus_l_xio_telnet_attr_t *) globus_calloc(sizeof(globus_l_xio_telnet_attr_t), 1); if(!attr) { res = GlobusXIOErrorMemory("attr"); goto error; } *out_driver_attr = attr; return GLOBUS_SUCCESS; error: return res; } static globus_result_t globus_l_xio_telnet_attr_copy( void ** out_driver_attr, void * src_driver_attr) { globus_l_xio_telnet_attr_t * src_attr; globus_l_xio_telnet_attr_t * dest_attr; globus_result_t res; GlobusXIOName(globus_l_xio_telnet_attr_init); if(src_driver_attr == NULL) { *out_driver_attr = NULL; return GLOBUS_SUCCESS; } res = globus_l_xio_telnet_attr_init((void **) (void *) &dest_attr); if(res == GLOBUS_SUCCESS) { src_attr = (globus_l_xio_telnet_attr_t *) src_driver_attr; dest_attr->create_buffer_mode = src_attr->create_buffer_mode; dest_attr->force_server = src_attr->force_server; *out_driver_attr = dest_attr; } return res; } static globus_result_t globus_l_xio_telnet_attr_destroy( void * driver_attr) { globus_free(driver_attr); return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_telnet_attr_cntl( void * driver_attr, int cmd, va_list ap) { globus_l_xio_telnet_attr_t * attr; globus_result_t res; GlobusXIOName(globus_l_xio_telnet_attr_cntl); attr = (globus_l_xio_telnet_attr_t *) driver_attr; switch(cmd) { case GLOBUS_XIO_TELNET_BUFFER: attr->create_buffer_mode = va_arg(ap, globus_bool_t); break; case GLOBUS_XIO_TELNET_FORCE_SERVER: attr->force_server = va_arg(ap, globus_bool_t); break; default: res = GlobusXIOErrorInvalidCommand(cmd); return res; } return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_telnet_server_destroy( void * driver_server) { return globus_l_xio_telnet_attr_destroy(driver_server); } static globus_result_t globus_l_xio_telnet_server_init( void * driver_attr, const globus_xio_contact_t * contact_info, globus_xio_operation_t op) { globus_result_t res; globus_l_xio_telnet_attr_t * attr; GlobusXIOName(globus_l_xio_telnet_server_init); res = globus_l_xio_telnet_attr_copy((void **) (void *) &attr, driver_attr); if(res != GLOBUS_SUCCESS) { goto error; } res = globus_xio_driver_pass_server_init(op, contact_info, attr); if(res != GLOBUS_SUCCESS) { goto error_pass; } return GLOBUS_SUCCESS; error_pass: globus_l_xio_telnet_server_destroy(attr); error: return res; } static void globus_l_xio_telnet_accept_cb( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_xio_driver_finished_accept(op, user_arg, result); } static globus_result_t globus_l_xio_telnet_accept( void * driver_server, globus_xio_operation_t accept_op) { globus_result_t res; globus_l_xio_telnet_attr_t * attr; GlobusXIOName(globus_l_xio_telnet_accept); res = globus_l_xio_telnet_attr_copy((void **) (void *) &attr, driver_server); if(res != GLOBUS_SUCCESS) { goto error; } res = globus_xio_driver_pass_accept( accept_op, globus_l_xio_telnet_accept_cb, attr); if(res != GLOBUS_SUCCESS) { goto error_pass; } return GLOBUS_SUCCESS; error_pass: globus_l_xio_telnet_server_destroy(attr); error: return res; } static globus_result_t globus_l_xio_telnet_link_destroy( void * driver_link) { return globus_l_xio_telnet_server_destroy(driver_link); } /************************************************************************ * iface functions * --------------- * ***********************************************************************/ static void globus_l_xio_telnet_open_cb( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_l_xio_telnet_handle_t * handle; handle = (globus_l_xio_telnet_handle_t *) user_arg; if(result != GLOBUS_SUCCESS) { globus_fifo_destroy(&handle->write_q); globus_free(handle->read_buffer); globus_mutex_destroy(&handle->mutex); globus_free(handle); } globus_xio_driver_finished_open(handle, op, result); } static globus_result_t globus_l_xio_telnet_open( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op) { globus_result_t res; globus_l_xio_telnet_attr_t * attr; globus_l_xio_telnet_handle_t * handle; GlobusXIOName(globus_l_xio_telnet_open); /* decide what attr to use */ if(driver_attr != NULL) { attr = (globus_l_xio_telnet_attr_t *) driver_attr; } else if(driver_link != NULL) { attr = (globus_l_xio_telnet_attr_t *) driver_link; } else { /* default */ attr = NULL; } handle = (globus_l_xio_telnet_handle_t *) globus_calloc( sizeof(globus_l_xio_telnet_handle_t), 1); if(handle == NULL) { res = GlobusXIOErrorMemory("handle"); goto error_handle_alloc; } if(attr != NULL && attr->force_server) { handle->client = GLOBUS_FALSE; } else { handle->client = driver_link ? GLOBUS_FALSE : GLOBUS_TRUE; } handle->read_buffer_length = GLOBUS_L_XIO_TELNET_DEFAULT_BUFFER_SIZE; handle->read_buffer = globus_malloc(handle->read_buffer_length); if(handle->read_buffer == NULL) { res = GlobusXIOErrorMemory("buffer"); goto error_buffer_alloc; } globus_mutex_init(&handle->mutex, NULL); globus_fifo_init(&handle->write_q); handle->create_buffer_mode = attr ? attr->create_buffer_mode : GLOBUS_FALSE; res = globus_xio_driver_pass_open( op, contact_info, globus_l_xio_telnet_open_cb, handle); if(res != GLOBUS_SUCCESS) { goto error_pass; } return GLOBUS_SUCCESS; error_pass: globus_free(handle->read_buffer); globus_mutex_destroy(&handle->mutex); globus_fifo_destroy(&handle->write_q); error_buffer_alloc: globus_free(handle); error_handle_alloc: return res; } static void globus_l_xio_telnet_write_cb( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_xio_driver_finished_write(op, result, nbytes); } static globus_result_t globus_l_xio_telnet_write( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_result_t res; res = globus_xio_driver_pass_write( op, (globus_xio_iovec_t *)iovec, iovec_count, globus_xio_operation_get_wait_for(op), globus_l_xio_telnet_write_cb, NULL); return res; } static globus_result_t globus_l_xio_telnet_read( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_xio_telnet_handle_t * handle; handle = (globus_l_xio_telnet_handle_t *) driver_specific_handle; globus_mutex_lock(&handle->mutex); { handle->user_read_iovec = (globus_xio_iovec_t *) iovec; handle->user_read_iovec_count = iovec_count; globus_l_xio_telnet_request_data(handle, op); } globus_mutex_unlock(&handle->mutex); if(handle->finish) { handle->finish = GLOBUS_FALSE; globus_xio_driver_finished_read( op, handle->finish_res, handle->finish_len); } return GLOBUS_SUCCESS; } static void globus_l_xio_telnet_close_cb( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_l_xio_telnet_handle_t * handle; handle = (globus_l_xio_telnet_handle_t *) user_arg; globus_xio_driver_finished_close(op, result); globus_free(handle->read_buffer); globus_fifo_destroy(&handle->write_q); globus_mutex_destroy(&handle->mutex); globus_free(handle); } static globus_result_t globus_l_xio_telnet_close( void * driver_specific_handle, void * attr, globus_xio_operation_t op) { globus_result_t res; globus_l_xio_telnet_handle_t * handle; handle = (globus_l_xio_telnet_handle_t *) driver_specific_handle; res = globus_xio_driver_pass_close( op, globus_l_xio_telnet_close_cb, handle); return res; } static globus_result_t globus_l_xio_telnet_init( globus_xio_driver_t * out_driver) { globus_xio_driver_t driver; globus_result_t res; GlobusXIOName(globus_l_xio_telnet_init); res = globus_xio_driver_init(&driver, "telnet", NULL); if(res != GLOBUS_SUCCESS) { return res; } globus_xio_driver_set_transform( driver, globus_l_xio_telnet_open, globus_l_xio_telnet_close, globus_l_xio_telnet_read, globus_l_xio_telnet_write, NULL, NULL); globus_xio_driver_set_server( driver, globus_l_xio_telnet_server_init, globus_l_xio_telnet_accept, globus_l_xio_telnet_server_destroy, NULL, NULL, globus_l_xio_telnet_link_destroy); globus_xio_driver_set_attr( driver, globus_l_xio_telnet_attr_init, globus_l_xio_telnet_attr_copy, globus_l_xio_telnet_attr_cntl, globus_l_xio_telnet_attr_destroy); *out_driver = driver; return GLOBUS_SUCCESS; } static void globus_l_xio_telnet_destroy( globus_xio_driver_t driver) { GlobusXIOName(globus_l_xio_telnet_destroy); globus_xio_driver_destroy(driver); } GlobusXIODefineDriver( telnet, globus_l_xio_telnet_init, globus_l_xio_telnet_destroy); static int globus_l_xio_telnet_activate(void) { int rc; GlobusXIOName(globus_l_xio_telnet_activate); rc = globus_module_activate(GLOBUS_XIO_MODULE); if(rc == GLOBUS_SUCCESS) { GlobusXIORegisterDriver(telnet); } return rc; } static int globus_l_xio_telnet_deactivate(void) { GlobusXIOName(globus_l_xio_telnet_deactivate); GlobusXIOUnRegisterDriver(telnet); return globus_module_deactivate(GLOBUS_XIO_MODULE); } globus_xio-3.6/builtins/udp/0000775000076400007640000000000012225614640013172 500000000000000globus_xio-3.6/builtins/udp/globus_xio_udp_driver.c0000666000076400007640000013560110775566566017710 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio_driver.h" #include "globus_xio_udp_driver.h" #include "version.h" #ifndef WIN32 #include #endif #ifdef WIN32 #define ENOTSUP 95 #endif static int globus_l_xio_udp_activate(void); static int globus_l_xio_udp_deactivate(void); GlobusXIODefineModule(udp) = { "globus_xio_udp", globus_l_xio_udp_activate, globus_l_xio_udp_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; #define GlobusXIOUdpErrorNoAddrs() \ globus_error_put( \ globus_error_construct_error( \ GlobusXIOMyModule(udp), \ GLOBUS_NULL, \ GLOBUS_XIO_UDP_ERROR_NO_ADDRS, \ __FILE__, \ _xio_name, \ __LINE__, \ "No addrs for INET family")) #define GlobusXIOUdpErrorShortWrite() \ globus_error_put( \ globus_error_construct_error( \ GlobusXIOMyModule(udp), \ GLOBUS_NULL, \ GLOBUS_XIO_UDP_ERROR_SHORT_WRITE, \ __FILE__, \ _xio_name, \ __LINE__, \ "Unable to write full request")) /* * attribute structure */ typedef struct { /* handle attrs */ globus_xio_system_socket_t fd; char * listener_serv; int listener_port; int listener_min_port; int listener_max_port; char * bind_address; globus_bool_t restrict_port; globus_bool_t resuseaddr; globus_bool_t no_ipv6; int sndbuf; int rcvbuf; globus_bool_t join_multicast; globus_sockaddr_t multicast_addr; /* dd attrs */ globus_bool_t use_addr; globus_sockaddr_t addr; } globus_l_attr_t; /* default attr */ static globus_l_attr_t globus_l_xio_udp_attr_default = { GLOBUS_XIO_UDP_INVALID_HANDLE, /* fd */ GLOBUS_NULL, /* listener_serv */ 0, /* listener_port */ 0, /* listener_min_port */ 0, /* listener_max_port */ GLOBUS_NULL, /* bind_address */ GLOBUS_TRUE, /* restrict_port */ GLOBUS_FALSE, /* reuseaddr */ GLOBUS_FALSE, /* no_ipv6 */ 0, /* sndbuf (system default) */ 0, /* rcvbuf (system default) */ GLOBUS_FALSE, /* join_multicast */ {0}, /* multicast_addr */ GLOBUS_FALSE, /* use_addr */ {0} /* addr */ }; /* * handle structure */ typedef struct { globus_xio_system_socket_handle_t system; globus_xio_system_socket_t fd; int socket_sa_family; globus_bool_t connected; globus_bool_t converted; globus_bool_t no_ipv6; } globus_l_handle_t; static globus_bool_t globus_l_xio_udp_get_env_pair( const char * env_name, int * min, int * max) { char * min_max; GlobusXIOName(globus_l_xio_udp_get_env_pair); min_max = globus_module_getenv(env_name); if(min_max && sscanf(min_max, " %d , %d", min, max) == 2) { return GLOBUS_TRUE; } return GLOBUS_FALSE; } /* * initialize a driver attribute */ static globus_result_t globus_l_xio_udp_attr_init( void ** out_attr) { globus_l_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_udp_attr_init); /* * create a udp attr structure and intialize its values */ attr = (globus_l_attr_t *) globus_malloc(sizeof(globus_l_attr_t)); if(!attr) { result = GlobusXIOErrorMemory("attr"); goto error_attr; } memcpy(attr, &globus_l_xio_udp_attr_default, sizeof(globus_l_attr_t)); *out_attr = attr; return GLOBUS_SUCCESS; error_attr: return result; } static globus_result_t globus_l_xio_udp_get_addrinfo( const char * host, const char * port, globus_addrinfo_t ** addrinfo, globus_bool_t no_ipv6) { globus_result_t result; globus_addrinfo_t addrinfo_hints; GlobusXIOName(globus_l_xio_udp_get_addrinfo); /* setup hints for types of connectable sockets we want */ memset(&addrinfo_hints, 0, sizeof(globus_addrinfo_t)); addrinfo_hints.ai_flags = 0; addrinfo_hints.ai_family = no_ipv6 ? PF_INET : PF_UNSPEC; addrinfo_hints.ai_socktype = SOCK_DGRAM; addrinfo_hints.ai_protocol = 0; result = globus_libc_getaddrinfo( host, port, &addrinfo_hints, addrinfo); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_libc_getaddrinfo", result); goto error_getaddrinfo; } return GLOBUS_SUCCESS; error_getaddrinfo: return result; } /* * modify the attribute structure */ static globus_result_t globus_l_xio_udp_attr_cntl( void * driver_attr, int cmd, va_list ap) { globus_l_attr_t * attr; globus_xio_system_socket_t * out_fd; char ** out_string; int * out_int; globus_bool_t * out_bool; char * in_string; globus_result_t result; int flags; globus_addrinfo_t * addrinfo; globus_addrinfo_t * save_addrinfo; globus_xio_contact_t contact_info; GlobusXIOName(globus_l_xio_udp_attr_cntl); attr = (globus_l_attr_t *) driver_attr; flags = 0; switch(cmd) { /** * handle attrs */ /* globus_xio_system_socket_t fd */ case GLOBUS_XIO_UDP_SET_HANDLE: attr->fd = va_arg(ap, globus_xio_system_socket_t); break; /* globus_xio_system_socket_t * fd_out */ case GLOBUS_XIO_UDP_GET_HANDLE: out_fd = va_arg(ap, globus_xio_system_socket_t *); *out_fd = attr->fd; break; /* char * service_name */ case GLOBUS_XIO_UDP_SET_SERVICE: if(attr->listener_serv) { globus_free(attr->listener_serv); } attr->listener_serv = va_arg(ap, char *); if(attr->listener_serv) { attr->listener_serv = globus_libc_strdup(attr->listener_serv); if(!attr->listener_serv) { result = GlobusXIOErrorMemory("listener_serv"); goto error_memory; } } break; /* char ** service_name_out */ case GLOBUS_XIO_UDP_GET_SERVICE: out_string = va_arg(ap, char **); if(attr->listener_serv) { *out_string = globus_libc_strdup(attr->listener_serv); if(!*out_string) { result = GlobusXIOErrorMemory("listener_serv_out"); goto error_memory; } } else { *out_string = GLOBUS_NULL; } break; /* int listener_port */ case GLOBUS_XIO_UDP_SET_PORT: attr->listener_port = va_arg(ap, int); break; /* int * listener_port_out */ case GLOBUS_XIO_UDP_GET_PORT: out_int = va_arg(ap, int *); *out_int = attr->listener_port; break; /* int listener_min_port */ /* int listener_max_port */ case GLOBUS_XIO_UDP_SET_LISTEN_RANGE: attr->listener_min_port = va_arg(ap, int); attr->listener_max_port = va_arg(ap, int); break; /* int * listener_min_port_out */ /* int * listener_max_port_out */ case GLOBUS_XIO_UDP_GET_LISTEN_RANGE: out_int = va_arg(ap, int *); *out_int = attr->listener_min_port; out_int = va_arg(ap, int *); *out_int = attr->listener_max_port; break; /* char * interface */ case GLOBUS_XIO_UDP_SET_INTERFACE: if(attr->bind_address) { globus_free(attr->bind_address); } attr->bind_address = va_arg(ap, char *); if(attr->bind_address) { attr->bind_address = globus_libc_strdup(attr->bind_address); if(!attr->bind_address) { result = GlobusXIOErrorMemory("bind_address"); goto error_memory; } } break; /* char ** interface_out */ case GLOBUS_XIO_UDP_GET_INTERFACE: out_string = va_arg(ap, char **); if(attr->bind_address) { *out_string = globus_libc_strdup(attr->bind_address); if(!*out_string) { result = GlobusXIOErrorMemory("bind_address_out"); goto error_memory; } } else { *out_string = GLOBUS_NULL; } break; /* globus_bool_t restrict_port */ case GLOBUS_XIO_UDP_SET_RESTRICT_PORT: attr->restrict_port = va_arg(ap, globus_bool_t); break; /* globus_bool_t * restrict_port_out */ case GLOBUS_XIO_UDP_GET_RESTRICT_PORT: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->restrict_port; break; /* globus_bool_t resuseaddr */ case GLOBUS_XIO_UDP_SET_REUSEADDR: attr->resuseaddr = va_arg(ap, globus_bool_t); break; /* globus_bool_t * resuseaddr_out */ case GLOBUS_XIO_UDP_GET_REUSEADDR: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->resuseaddr; break; /* globus_bool_t no_ipv6 */ case GLOBUS_XIO_UDP_SET_NO_IPV6: attr->no_ipv6 = va_arg(ap, globus_bool_t); break; /* globus_bool_t * no_ipv6_out */ case GLOBUS_XIO_UDP_GET_NO_IPV6: out_bool = va_arg(ap, globus_bool_t *); *out_bool = attr->no_ipv6; break; /* int sndbuf */ case GLOBUS_XIO_UDP_SET_SNDBUF: attr->sndbuf = va_arg(ap, int); break; /* int * sndbuf_out */ case GLOBUS_XIO_UDP_GET_SNDBUF: out_int = va_arg(ap, int *); *out_int = attr->sndbuf; break; /* int rcvbuf */ case GLOBUS_XIO_UDP_SET_RCVBUF: attr->rcvbuf = va_arg(ap, int); break; /* int * rcvbuf_out */ case GLOBUS_XIO_UDP_GET_RCVBUF: out_int = va_arg(ap, int *); *out_int = attr->rcvbuf; break; /** * dd attrs */ /* char ** contact_string_out */ case GLOBUS_XIO_UDP_GET_NUMERIC_CONTACT: flags |= GLOBUS_LIBC_ADDR_NUMERIC; /* fall through */ /* char ** contact_string_out */ case GLOBUS_XIO_UDP_GET_CONTACT: if(attr->use_addr) { out_string = va_arg(ap, char **); result = globus_libc_addr_to_contact_string( &attr->addr, flags, out_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_libc_addr_to_contact_string", result); goto error_contact; } } else { result = GlobusXIOUdpErrorNoAddrs(); goto error_contact; } break; /* char * contact_string */ case GLOBUS_XIO_UDP_SET_CONTACT: case GLOBUS_XIO_UDP_SET_MULTICAST: in_string = va_arg(ap, char *); result = globus_xio_contact_parse(&contact_info, in_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_contact_parse", result); goto error_getaddrinfo; } save_addrinfo = GLOBUS_NULL; if(contact_info.host && contact_info.port) { result = globus_l_xio_udp_get_addrinfo( contact_info.host, contact_info.port, &save_addrinfo, attr->no_ipv6); globus_xio_contact_destroy(&contact_info); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_get_addrinfo", result); goto error_getaddrinfo; } } if(save_addrinfo) { for(addrinfo = save_addrinfo; addrinfo && !GlobusLibcProtocolFamilyIsIP(addrinfo->ai_family); addrinfo = addrinfo->ai_next) { } if(addrinfo) { if(cmd == GLOBUS_XIO_UDP_SET_CONTACT) { result = globus_libc_addr_convert_family( (globus_sockaddr_t *) addrinfo->ai_addr, &attr->addr, attr->no_ipv6 ? AF_INET : AF_INET6); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_libc_addr_convert_family", result); goto error_no_addrinfo; } attr->use_addr = GLOBUS_TRUE; } else { GlobusLibcSockaddrCopy(attr->multicast_addr, *addrinfo->ai_addr, addrinfo->ai_addrlen); attr->join_multicast = GLOBUS_TRUE; } } else { result = GlobusXIOUdpErrorNoAddrs(); goto error_no_addrinfo; } globus_libc_freeaddrinfo(save_addrinfo); } else { globus_xio_contact_destroy(&contact_info); if(cmd == GLOBUS_XIO_UDP_SET_CONTACT) { attr->use_addr = GLOBUS_FALSE; } else { attr->join_multicast = GLOBUS_FALSE; } } break; default: result = GlobusXIOErrorInvalidCommand(cmd); goto error_invalid; break; } return GLOBUS_SUCCESS; error_no_addrinfo: globus_libc_freeaddrinfo(save_addrinfo); error_getaddrinfo: error_memory: error_contact: error_invalid: return result; } /* * copy an attribute structure */ static globus_result_t globus_l_xio_udp_attr_copy( void ** dst, void * src) { globus_l_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_udp_attr_copy); attr = (globus_l_attr_t *) globus_malloc(sizeof(globus_l_attr_t)); if(!attr) { result = GlobusXIOErrorMemory("attr"); goto error_attr; } memcpy(attr, src, sizeof(globus_l_attr_t)); if(attr->bind_address) { attr->bind_address = globus_libc_strdup(attr->bind_address); if(!attr->bind_address) { result = GlobusXIOErrorMemory("bind_address"); goto error_bind_address; } } if(attr->listener_serv) { attr->listener_serv = globus_libc_strdup(attr->listener_serv); if(!attr->listener_serv) { result = GlobusXIOErrorMemory("listener_serv"); goto error_listener_serv; } } *dst = attr; return GLOBUS_SUCCESS; error_listener_serv: if(attr->bind_address) { globus_free(attr->bind_address); } error_bind_address: globus_free(attr); error_attr: return result; } /* * destroy an attr structure */ static globus_result_t globus_l_xio_udp_attr_destroy( void * driver_attr) { globus_l_attr_t * attr; GlobusXIOName(globus_l_xio_udp_attr_destroy); attr = (globus_l_attr_t *) driver_attr; if(attr->bind_address) { globus_free(attr->bind_address); } if(attr->listener_serv) { globus_free(attr->listener_serv); } globus_free(attr); return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_udp_apply_handle_attrs( const globus_l_attr_t * attr, globus_xio_system_socket_t fd, globus_bool_t converted) { globus_result_t result; int int_one = 1; GlobusXIOName(globus_l_xio_udp_apply_handle_attrs); if(attr->resuseaddr) { result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_REUSEADDR, &int_one, sizeof(int_one)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } if(attr->sndbuf) { result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_SNDBUF, &attr->sndbuf, sizeof(attr->sndbuf)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } if(attr->rcvbuf) { result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_RCVBUF, &attr->rcvbuf, sizeof(attr->rcvbuf)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } } return GLOBUS_SUCCESS; error_sockopt: return result; } static globus_result_t globus_l_xio_udp_bind( globus_xio_system_socket_t fd, const struct sockaddr * addr, int addr_len, int min_port, int max_port) { int port; globus_bool_t done; globus_sockaddr_t myaddr; globus_result_t result; GlobusXIOName(globus_l_xio_udp_bind); GlobusLibcSockaddrGetPort(*addr, port); if(port == 0) { port = min_port; } else { max_port = port; } done = GLOBUS_FALSE; do { GlobusLibcSockaddrCopy(myaddr, *addr, addr_len); GlobusLibcSockaddrSetPort(myaddr, port); result = globus_xio_system_socket_bind( fd, (struct sockaddr *) &myaddr, GlobusLibcSockaddrLen(&myaddr)); if(result != GLOBUS_SUCCESS) { if(++port > max_port) { goto error_bind; } } else { done = GLOBUS_TRUE; } } while(!done); return GLOBUS_SUCCESS; error_bind: return result; } static globus_result_t globus_l_xio_udp_join_multicast( globus_l_handle_t * handle, const globus_l_attr_t * attr) { globus_result_t result; globus_xio_system_socket_t fd; GlobusXIOName(globus_l_xio_udp_join_multicast); result = globus_xio_system_socket_create( &fd, GlobusLibcSockaddrGetFamily(attr->multicast_addr), SOCK_DGRAM, 0); if(result != GLOBUS_SUCCESS) { goto error_socket; } result = globus_l_xio_udp_apply_handle_attrs( attr, fd, GLOBUS_FALSE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_apply_handle_attrs", result); goto error_attrs; } result = globus_l_xio_udp_bind( fd, (struct sockaddr *) &attr->multicast_addr, GlobusLibcSockaddrLen(&attr->multicast_addr), 0, 0); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_bind", result); goto error_bind; } #ifdef IP_ADD_MEMBERSHIP if(GlobusLibcSockaddrGetFamily(attr->multicast_addr) == AF_INET) { struct in_addr inet_address; struct ip_mreq mreq; globus_addrinfo_t * addrinfo; globus_addrinfo_t addrinfo_hints; if(attr->bind_address) { memset(&addrinfo_hints, 0, sizeof(globus_addrinfo_t)); addrinfo_hints.ai_flags = GLOBUS_AI_PASSIVE; addrinfo_hints.ai_family = AF_INET; addrinfo_hints.ai_socktype = SOCK_DGRAM; addrinfo_hints.ai_protocol = 0; result = globus_libc_getaddrinfo(attr->bind_address, GLOBUS_NULL, &addrinfo_hints, &addrinfo); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_libc_getaddrinfo", result); goto error_join; } inet_address = ((struct sockaddr_in *) addrinfo->ai_addr)->sin_addr; globus_libc_freeaddrinfo(addrinfo); } else { inet_address.s_addr = htonl(INADDR_ANY); } mreq.imr_multiaddr = ((struct sockaddr_in *) &attr->multicast_addr)->sin_addr; mreq.imr_interface = inet_address; result = globus_xio_system_socket_setsockopt( fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if(result != GLOBUS_SUCCESS) { goto error_join; } } else #endif #ifdef IPV6_ADD_MEMBERSHIP if(GlobusLibcSockaddrGetFamily(attr->multicast_addr) == AF_INET6) { struct ipv6_mreq mreq; /** * XXX need to translate bind address into index */ mreq.ipv6mr_multiaddr = ((struct sockaddr_in6 *) &attr->multicast_addr)->sin6_addr; mreq.ipv6mr_interface = 0; result = globus_xio_system_socket_setsockopt( fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if(result != GLOBUS_SUCCESS) { goto error_join; } } else #endif { result = GlobusXIOErrorSystemError("multicast join", ENOTSUP); goto error_join; } return GLOBUS_SUCCESS; error_join: error_bind: error_attrs: globus_xio_system_socket_close(fd); error_socket: return result; } static globus_result_t globus_l_xio_udp_create_listener( globus_l_handle_t * handle, const globus_l_attr_t * attr) { globus_result_t result; globus_addrinfo_t * save_addrinfo; globus_addrinfo_t * addrinfo; globus_addrinfo_t addrinfo_hints; char portbuf[10]; char * port; globus_xio_system_socket_t fd; GlobusXIOName(globus_l_xio_udp_create_listener); if(attr->listener_serv) { port = attr->listener_serv; } else { snprintf(portbuf, sizeof(portbuf), "%d", attr->listener_port); port = portbuf; } /* setup hints for types of connectable sockets we want */ memset(&addrinfo_hints, 0, sizeof(globus_addrinfo_t)); addrinfo_hints.ai_flags = GLOBUS_AI_PASSIVE; addrinfo_hints.ai_family = handle->no_ipv6 ? PF_INET : PF_UNSPEC; addrinfo_hints.ai_socktype = SOCK_DGRAM; addrinfo_hints.ai_protocol = 0; result = globus_libc_getaddrinfo( attr->bind_address, port, &addrinfo_hints, &save_addrinfo); if(result != GLOBUS_SUCCESS && attr->listener_serv && attr->listener_port > 0) { /* it's possible the service name doesnt exist, since they also * specified a numeric port, lets try that one */ snprintf(portbuf, sizeof(portbuf), "%d", attr->listener_port); result = globus_libc_getaddrinfo( attr->bind_address, portbuf, &addrinfo_hints, &save_addrinfo); } if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed("globus_libc_getaddrinfo", result); goto error_getaddrinfo; } /* bind to the first one possible -- * its not possible to bind multiple interfaces (except on some openbsd) * so, if the system doesnt map its inet interfaces to inet6, we * may have a problem */ for(addrinfo = save_addrinfo; addrinfo; addrinfo = addrinfo->ai_next) { if(GlobusLibcProtocolFamilyIsIP(addrinfo->ai_family)) { result = globus_xio_system_socket_create( &fd, addrinfo->ai_family, addrinfo->ai_socktype, addrinfo->ai_protocol); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_create", result); continue; } result = globus_l_xio_udp_apply_handle_attrs( attr, fd, GLOBUS_FALSE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_apply_handle_attrs", result); globus_xio_system_socket_close(fd); continue; } result = globus_l_xio_udp_bind( fd, addrinfo->ai_addr, addrinfo->ai_addrlen, attr->restrict_port ? attr->listener_min_port : 0, attr->restrict_port ? attr->listener_max_port : 0); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_bind", result); globus_xio_system_socket_close(fd); continue; } break; } } if(!addrinfo) { if(result == GLOBUS_SUCCESS) { result = GlobusXIOUdpErrorNoAddrs(); } goto error_no_addrinfo; } handle->fd = fd; handle->socket_sa_family = addrinfo->ai_family; globus_libc_freeaddrinfo(save_addrinfo); return GLOBUS_SUCCESS; error_no_addrinfo: globus_libc_freeaddrinfo(save_addrinfo); error_getaddrinfo: return result; } static globus_result_t globus_l_xio_udp_handle_init( globus_l_handle_t ** handle, const globus_l_attr_t * attr) { globus_result_t result; GlobusXIOName(globus_l_xio_udp_handle_init); *handle = (globus_l_handle_t *) globus_malloc(sizeof(globus_l_handle_t)); if(!*handle) { result = GlobusXIOErrorMemory("handle"); goto error_handle; } (*handle)->connected = GLOBUS_FALSE; (*handle)->converted = GLOBUS_FALSE; (*handle)->no_ipv6 = attr->no_ipv6; return GLOBUS_SUCCESS; error_handle: return result; } static void globus_l_xio_udp_handle_destroy( globus_l_handle_t * handle) { GlobusXIOName(globus_l_xio_udp_handle_destroy); globus_free(handle); } static globus_result_t globus_l_xio_udp_connect( globus_l_handle_t * handle, const char * host, const char * port) { globus_result_t result; globus_addrinfo_t * addrinfo; globus_addrinfo_t * save_addrinfo; GlobusXIOName(globus_l_xio_udp_connect); result = globus_l_xio_udp_get_addrinfo( host, port, &save_addrinfo, handle->no_ipv6); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_get_addrinfo", result); goto error_getaddrinfo; } for(addrinfo = save_addrinfo; addrinfo; addrinfo = addrinfo->ai_next) { if(GlobusLibcProtocolFamilyIsIP(addrinfo->ai_family)) { result = globus_xio_system_socket_connect( handle->fd, addrinfo->ai_addr, addrinfo->ai_addrlen); if(result == GLOBUS_SUCCESS) { break; } } } if(!addrinfo) { if(result == GLOBUS_SUCCESS) { result = GlobusXIOUdpErrorNoAddrs(); } goto error_no_addrinfo; } globus_libc_freeaddrinfo(save_addrinfo); handle->connected = GLOBUS_TRUE; return GLOBUS_SUCCESS; error_no_addrinfo: globus_libc_freeaddrinfo(save_addrinfo); error_getaddrinfo: return result; } /* * open a udp */ static globus_result_t globus_l_xio_udp_open( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op) { globus_l_handle_t * handle; const globus_l_attr_t * attr; globus_result_t result; char * port; GlobusXIOName(globus_l_xio_udp_open); attr = (globus_l_attr_t *) (driver_attr ? driver_attr : &globus_l_xio_udp_attr_default); result = globus_l_xio_udp_handle_init(&handle, attr); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_handle_init", result); goto error_handle; } if(attr->fd == GLOBUS_XIO_UDP_INVALID_HANDLE) { if(attr->join_multicast) { result = globus_l_xio_udp_join_multicast(handle, attr); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_join_multicast", result); goto error_listen; } } else { /* setup the local side */ result = globus_l_xio_udp_create_listener(handle, attr); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_create_listener", result); goto error_listen; } } } else { handle->fd = attr->fd; handle->converted = GLOBUS_TRUE; result = globus_l_xio_udp_apply_handle_attrs( attr, handle->fd, GLOBUS_TRUE); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_udp_apply_handle_attrs", result); goto error_attrs; } } /* if a peer has been chosen, bind them */ /* XXX need to check into ipv4/6 mismatches between local and remote */ port = contact_info->port ? contact_info->port : contact_info->scheme; if(contact_info->host && port) { result = globus_l_xio_udp_connect( handle, contact_info->host, port); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailedWithMessage2(result, "Unable to connect to %s:%s", contact_info->host, port); goto error_connect; } } result = globus_xio_system_socket_init( &handle->system, handle->fd, GLOBUS_XIO_SYSTEM_UDP); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_init", result); goto error_init; } globus_xio_driver_finished_open(handle, op, GLOBUS_SUCCESS); return GLOBUS_SUCCESS; error_init: error_connect: if(!handle->converted) { globus_xio_system_socket_close(handle->fd); } error_listen: error_attrs: globus_l_xio_udp_handle_destroy(handle); error_handle: return result; } /* * close a udp */ static globus_result_t globus_l_xio_udp_close( void * driver_specific_handle, void * attr, globus_xio_operation_t op) { globus_l_handle_t * handle; GlobusXIOName(globus_l_xio_udp_close); handle = (globus_l_handle_t *) driver_specific_handle; globus_xio_system_socket_destroy(handle->system); if(!handle->converted) { globus_xio_system_socket_close(handle->fd); } globus_xio_driver_finished_close(op, GLOBUS_SUCCESS); globus_l_xio_udp_handle_destroy(handle); return GLOBUS_SUCCESS; } static void globus_l_xio_udp_system_read_cb( globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_xio_operation_t op; GlobusXIOName(globus_l_xio_udp_system_read_cb); op = (globus_xio_operation_t) user_arg; if(result != GLOBUS_SUCCESS && globus_xio_error_is_eof(result)) { /* eof not possible, zero byte packets allowed */ result = GLOBUS_SUCCESS; } globus_xio_driver_finished_read(op, result, nbytes); } /* * read from a udp */ static globus_result_t globus_l_xio_udp_read( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_handle_t * handle; globus_l_attr_t * attr; globus_sockaddr_t * addr; GlobusXIOName(globus_l_xio_udp_read); handle = (globus_l_handle_t *) driver_specific_handle; addr = GLOBUS_NULL; if(!handle->connected) { attr = (globus_l_attr_t *) globus_xio_operation_get_data_descriptor(op, GLOBUS_TRUE); if(attr) { addr = &attr->addr; attr->use_addr = GLOBUS_TRUE; } } /* if buflen and waitfor are both 0, we behave like register select */ if(globus_xio_operation_get_wait_for(op) == 0 && (iovec_count > 1 || iovec[0].iov_len > 0)) { globus_size_t nbytes; globus_result_t result; result = globus_xio_system_socket_read( handle->system, iovec, iovec_count, 0, 0, addr, &nbytes); if(result != GLOBUS_SUCCESS && globus_xio_error_is_eof(result)) { /* eof not possible, zero byte packets allowed */ result = GLOBUS_SUCCESS; } globus_xio_driver_finished_read(op, result, nbytes); return GLOBUS_SUCCESS; } else { return globus_xio_system_socket_register_read( op, handle->system, iovec, iovec_count, globus_xio_operation_get_wait_for(op), 0, addr, globus_l_xio_udp_system_read_cb, op); } } /* * write to a udp */ static globus_result_t globus_l_xio_udp_write( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_handle_t * handle; globus_l_attr_t * attr; globus_sockaddr_t * addr; globus_sockaddr_t tmp_addr; globus_size_t nbytes; globus_result_t result; int total; int i; GlobusXIOName(globus_l_xio_udp_write); handle = (globus_l_handle_t *) driver_specific_handle; addr = GLOBUS_NULL; if(!handle->connected) { attr = (globus_l_attr_t *) globus_xio_operation_get_data_descriptor(op, GLOBUS_FALSE); if(attr && attr->use_addr) { addr = &attr->addr; if(handle->socket_sa_family != GlobusLibcSockaddrGetFamily(addr)) { result = globus_libc_addr_convert_family( &attr->addr, &tmp_addr, handle->socket_sa_family); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_libc_addr_convert_family", result); /* continue */ } addr = &tmp_addr; } } } /* for UDP sockets, this is supposed to write the entire thing at all * times if it fits in buffer */ result = globus_xio_system_socket_write( handle->system, iovec, iovec_count, 0, 0, addr, &nbytes); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_system_socket_write", result); goto error_write; } total = 0; for(i = 0; i < iovec_count; i++) { total += iovec[i].iov_len; } if(nbytes != total) { result = GlobusXIOUdpErrorShortWrite(); } globus_xio_driver_finished_write(op, result, nbytes); /* Since I actually perform the write here and some bytes may be written * I have to 'finish' with any errors and return success for the request */ return GLOBUS_SUCCESS; error_write: return result; } static globus_result_t globus_l_xio_udp_cntl( void * driver_specific_handle, int cmd, va_list ap) { globus_l_handle_t * handle; globus_result_t result; int * out_int; int in_int; char * in_string; globus_sockaddr_t sock_name; globus_xio_system_socket_t fd; globus_size_t len; int flags; char ** out_string; globus_xio_system_socket_t * out_fd; globus_xio_contact_t contact_info; GlobusXIOName(globus_l_xio_udp_cntl); handle = (globus_l_handle_t *) driver_specific_handle; fd = handle->fd; flags = GLOBUS_LIBC_ADDR_LOCAL; switch(cmd) { /* globus_xio_system_socket_t * fd_out */ case GLOBUS_XIO_UDP_GET_HANDLE: out_fd = va_arg(ap, globus_xio_system_socket_t *); *out_fd = fd; break; /* int sndbuf */ case GLOBUS_XIO_UDP_SET_SNDBUF: in_int = va_arg(ap, int); result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_SNDBUF, &in_int, sizeof(in_int)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* int * sndbuf_out */ case GLOBUS_XIO_UDP_GET_SNDBUF: out_int = va_arg(ap, int *); len = sizeof(int); result = globus_xio_system_socket_getsockopt( fd, SOL_SOCKET, SO_SNDBUF, out_int, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* int rcvbuf */ case GLOBUS_XIO_UDP_SET_RCVBUF: in_int = va_arg(ap, int); result = globus_xio_system_socket_setsockopt( fd, SOL_SOCKET, SO_RCVBUF, &in_int, sizeof(in_int)); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* int * rcvbuf_out */ case GLOBUS_XIO_UDP_GET_RCVBUF: out_int = va_arg(ap, int *); len = sizeof(int); result = globus_xio_system_socket_getsockopt( fd, SOL_SOCKET, SO_RCVBUF, out_int, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } break; /* char ** contact_string_out */ case GLOBUS_XIO_UDP_GET_NUMERIC_CONTACT: case GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT: flags |= GLOBUS_LIBC_ADDR_NUMERIC; /* fall through */ /* char ** contact_string_out */ case GLOBUS_XIO_UDP_GET_CONTACT: case GLOBUS_XIO_GET_LOCAL_CONTACT: len = sizeof(globus_sockaddr_t); result = globus_xio_system_socket_getsockname( fd, (struct sockaddr *) &sock_name, &len); if(result != GLOBUS_SUCCESS) { goto error_sockopt; } out_string = va_arg(ap, char **); result = globus_libc_addr_to_contact_string( &sock_name, flags, out_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_libc_addr_to_contact_string", result); goto error_contact; } break; /* char * contact_string */ case GLOBUS_XIO_UDP_CONNECT: in_string = va_arg(ap, char *); result = globus_xio_contact_parse(&contact_info, in_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_contact_parse", result); goto error_connect; } in_string = contact_info.port ? contact_info.port : contact_info.scheme; if(contact_info.host && in_string) { result = globus_l_xio_udp_connect( handle, contact_info.host, in_string); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailedWithMessage2(result, "Unable to connect to %s:%s", contact_info.host, in_string); globus_xio_contact_destroy(&contact_info); goto error_connect; } globus_xio_contact_destroy(&contact_info); } else { /* attempt to 'disconnect' socket */ struct sockaddr_in addr; globus_xio_contact_destroy(&contact_info); memset(&addr, 0, sizeof(addr)); addr.sin_family = PF_UNSPEC; result = globus_xio_system_socket_connect( fd, (struct sockaddr *) &addr, sizeof(addr)); if(result != GLOBUS_SUCCESS) { goto error_connect; } handle->connected = GLOBUS_FALSE; } break; default: result = GlobusXIOErrorInvalidCommand(cmd); goto error_invalid; break; } return GLOBUS_SUCCESS; error_connect: error_contact: error_invalid: error_sockopt: return result; } static globus_result_t globus_l_xio_udp_init( globus_xio_driver_t * out_driver) { globus_xio_driver_t driver; globus_result_t result; GlobusXIOName(globus_l_xio_udp_init); /* I dont support any driver options, so I'll ignore the ap */ result = globus_xio_driver_init(&driver, "udp", GLOBUS_NULL); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_xio_driver_init", result); goto error_init; } globus_xio_driver_set_transport( driver, globus_l_xio_udp_open, globus_l_xio_udp_close, globus_l_xio_udp_read, globus_l_xio_udp_write, globus_l_xio_udp_cntl); globus_xio_driver_set_attr( driver, globus_l_xio_udp_attr_init, globus_l_xio_udp_attr_copy, globus_l_xio_udp_attr_cntl, globus_l_xio_udp_attr_destroy); *out_driver = driver; return GLOBUS_SUCCESS; error_init: return result; } static void globus_l_xio_udp_destroy( globus_xio_driver_t driver) { globus_xio_driver_destroy(driver); } GlobusXIODefineDriver( udp, globus_l_xio_udp_init, globus_l_xio_udp_destroy); static int globus_l_xio_udp_activate(void) { int min; int max; int rc; GlobusXIOName(globus_l_xio_udp_activate); if(globus_l_xio_udp_get_env_pair( "GLOBUS_UDP_PORT_RANGE", &min, &max) && min <= max) { globus_l_xio_udp_attr_default.listener_min_port = min; globus_l_xio_udp_attr_default.listener_max_port = max; } rc = globus_module_activate(GLOBUS_XIO_SYSTEM_MODULE); if(rc == GLOBUS_SUCCESS) { GlobusXIORegisterDriver(udp); } return rc; } static int globus_l_xio_udp_deactivate(void) { GlobusXIOName(globus_l_xio_udp_deactivate); globus_l_xio_udp_attr_default.listener_min_port = 0; globus_l_xio_udp_attr_default.listener_max_port = 0; GlobusXIOUnRegisterDriver(udp); return globus_module_deactivate(GLOBUS_XIO_SYSTEM_MODULE); } globus_xio-3.6/builtins/udp/globus_xio_udp_driver.h0000666000076400007640000004373110363625135017674 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_XIO_UDP_DRIVER_INCLUDE #define GLOBUS_XIO_UDP_DRIVER_INCLUDE /** * @file * Header file for XIO UDP Driver */ #include "globus_xio_system.h" /** * @defgroup udp_driver Globus XIO UDP Driver * The IPV4/6 UDP socket driver. */ /** * @defgroup udp_driver_instance Opening/Closing * @ingroup udp_driver * * An XIO handle with the udp driver can be created with * @ref globus_xio_handle_create(). * * The handle can be created in two modes: open server or connected client. * If the contact string does not have a host and port, the udp socket will * accept messages from any sender. If a host and port is specified, the udp * socket will be 'connected' immediately to that host:port. This blocks * packets from any sender other than the contact string. A handle that starts * out as an open server can later be 'connected' with * @ref GLOBUS_XIO_UDP_CONNECT (presumably after the first message is received * from a sender and his contact info is available). * * When the XIO handle is closed, the udp driver will destroy its internal * resources and close the socket (unless this socket was set on the attr to * @ref globus_xio_register_open()). */ /** * @defgroup udp_driver_io Reading/Writing * @ingroup udp_driver * * @ref globus_xio_register_read() semantics: * * If the waitforbytes parameter is greater than zero, the read will happen * asynchronously and be completed when at least waitforbytes has been * read/written. * * If the waitforbytes parameter is equal to zero, one of the following * alternative behaviors occur: * * If the length of the buffer is > 0 the read happens synchronously. If * the user is using one of the blocking xio calls, no internal callback will * occur. * * If the length of the buffer is also 0, the call behaves like an asynchronous * notification of data ready to be read. ie, an asynchronous select(). * * In any case, when an error occurs before the waitforbytes request * has been met, the outgoing nbytes is set to the amount of data actually * read before the error occurred. * * If the handle is not connected, the user should pass in a data descriptor. * After the read, this data_descriptor will contain the contact string of the * sender. The user can either get this contact string with * @ref GLOBUS_XIO_UDP_GET_CONTACT or pass the data descriptor directly to * @ref globus_xio_register_write() to send a message back to the sender. * * Also, if the handle is not connected, the waitforbytes should probably be * 1 to guarantee that only one packet is received and the sender contact isnt * overwritten by multiple packets from different senders. * * @ref globus_xio_register_write() semantics: * * When performing a write, exactly one UDP packet is sent of the entire * buffer length. The waitforbytes parameter is ignored. If the entire buffer * can not be written, a @ref GLOBUS_XIO_UDP_ERROR_SHORT_WRITE error will be * returned with nbytes set to the number of bytes actually sent. * * If the handle is not 'connected', a contact string must be set in the * data descriptor to @ref globus_xio_register_write(). This can either be * done explicitly with @ref GLOBUS_XIO_UDP_SET_CONTACT or implicitly by * passing in a data descriptor received from @ref globus_xio_register_read(). * * The udp write semantics are always synchronous. No blocking or internal * callback will occur when using @ref globus_xio_write(). */ /** * @defgroup udp_driver_envs Env Variables * @ingroup udp_driver * * The udp driver uses the following environment variables * - GLOBUS_HOSTNAME Used when setting the hostname in the contact string * - GLOBUS_UDP_PORT_RANGE Used to restrict the port the udp socket binds to * - GLOBUS_XIO_SYSTEM_DEBUG Available if using a debug build. See * globus_debug.h for format. The UDP driver uses globus_xio_system * (along with the File and TCP drivers) which defines the following * levels: TRACE for all function call tracing, DATA for data read and * written counts, INFO for some special events, and RAW which dumps the * raw buffers actually read or written. This can contain binary data, * so be careful when you enable it. */ /** * @defgroup udp_driver_cntls Attributes and Cntls * @ingroup udp_driver * * UDP driver specific attrs and cntls. * * @see globus_xio_attr_cntl() * @see globus_xio_handle_cntl() * @see globus_xio_data_descriptor_cntl() */ /** * @defgroup udp_driver_types Types * @ingroup udp_driver */ /** * @defgroup udp_driver_errors Error Types * @ingroup udp_driver * * The UDP driver is very close to the system code, so most errors * reported by it are converted from the system errno. A few of the exceptions * are GLOBUS_XIO_ERROR_COMMAND, GLOBUS_XIO_ERROR_CONTACT_STRING, * GLOBUS_XIO_ERROR_CANCELED, @ref GLOBUS_XIO_UDP_ERROR_NO_ADDRS, * and @ref GLOBUS_XIO_UDP_ERROR_SHORT_WRITE * * @see globus_xio_driver_error_match() * @see globus_error_errno_match() */ /** * Invalid handle type * @ingroup udp_driver_types * @hideinitializer * @see GLOBUS_XIO_UDP_SET_HANDLE */ #define GLOBUS_XIO_UDP_INVALID_HANDLE GLOBUS_XIO_SYSTEM_INVALID_SOCKET /** * UDP driver specific error types * @ingroup udp_driver_errors */ typedef enum { /** * Indicates that no IPv4/6 compatible sockets could be resolved * for the specified hostname */ GLOBUS_XIO_UDP_ERROR_NO_ADDRS, /** * Indicates that a write of the full buffer failed. Possibly need to * increase the send buffer size. */ GLOBUS_XIO_UDP_ERROR_SHORT_WRITE } globus_xio_udp_error_type_t; /** doxygen varargs filter stuff * GlobusVarArgDefine( * attr, globus_result_t, globus_xio_attr_cntl, attr, driver) * GlobusVarArgDefine( * handle, globus_result_t, globus_xio_handle_cntl, handle, driver) * GlobusVarArgDefine( * dd, globus_result_t, globus_xio_data_descriptor_cntl, dd, driver) */ /** * UDP driver specific cntls * @ingroup udp_driver_cntls */ typedef enum { /** GlobusVarArgEnum(attr) * Set the udp socket to use. * @ingroup udp_driver_cntls * * @param handle * Use this handle (fd or SOCKET). * Note: close() will not be called on this handle. */ /* globus_xio_system_socket_t handle */ GLOBUS_XIO_UDP_SET_HANDLE, /** GlobusVarArgEnum(attr) * Set the udp service name to listen on. * @ingroup udp_driver_cntls * * @param service_name * The service name to use when setting up the listener. If the * service name cannot be resolved, the port (if one is set) will * be used instead. */ /* const char * service_name */ GLOBUS_XIO_UDP_SET_SERVICE, /** GlobusVarArgEnum(attr) * Get the service name to listen on. * @ingroup udp_driver_cntls * * @param service_name_out * A pointer to the service name will be stored here If none is set, * NULL will be passed back. Otherwise, the name will be * duplicated with strdup() and the user should call free() on it. */ /* char ** service_name_out */ GLOBUS_XIO_UDP_GET_SERVICE, /** GlobusVarArgEnum(attr) * Set the port number to listen on. * @ingroup udp_driver_cntls * The default is 0 (system assigned) * * @param listener_port * The port number to use when setting up the listener. If the * service name is also set, this will only be used if that can't be * resolved. */ /* int listener_port */ GLOBUS_XIO_UDP_SET_PORT, /** GlobusVarArgEnum(attr) * the port number to listen on. * @ingroup udp_driver_cntls * * @param listener_port_out * The port will be stored here. */ /* int * listener_port_out */ GLOBUS_XIO_UDP_GET_PORT, /** GlobusVarArgEnum(attr) * Set the port range to confine the listener to. * @ingroup udp_driver_cntls * Used only where no specific service or port has been set. It overrides * the range set in the GLOBUS_UDP_PORT_RANGE env variable. If * 'restrict port' is true, the listening port will be constrained to the * range specified. * * @param listener_min_port * The lower bound on the listener port. (default 0 -- no bound) * * @param listener_max_port * The upper bound on the listener port. (default 0 -- no bound) * * @see GLOBUS_XIO_UDP_SET_RESTRICT_PORT */ /* int listener_min_port, * int listener_max_port */ GLOBUS_XIO_UDP_SET_LISTEN_RANGE, /** GlobusVarArgEnum(attr) * Get the udp port range on an attr. * @ingroup udp_driver_cntls * * @param listener_min_port_out * The lower bound will be stored here. * * @param listener_max_port_out * The upper bound will be stored here. */ /* int * listener_min_port_out, * int * listener_max_port_out */ GLOBUS_XIO_UDP_GET_LISTEN_RANGE, /** GlobusVarArgEnum(attr) * Set the interface to bind the socket to. * @ingroup udp_driver_cntls * * @param interface * The interface to use. Can be a hostname or numeric IP */ /* const char * interface */ GLOBUS_XIO_UDP_SET_INTERFACE, /** GlobusVarArgEnum(attr) * Get the interface on the attr. * @ingroup udp_driver_cntls * * @param interface_out * A pointer to the interface will be stored here If one is set, * NULL will be passed back. Otherwise, the interface will be * duplicated with strdup() and the user should call free() on it. */ /* char ** interface_out */ GLOBUS_XIO_UDP_GET_INTERFACE, /** GlobusVarArgEnum(attr) * Enable or disable the listener range constraints. * @ingroup udp_driver_cntls * This enables or ignores the port range found in the attr or in then env. * By default, those ranges are enabled. * * @param restrict_port * GLOBUS_TRUE to enable (default), GLOBUS_FALSE to disable. * * @see GLOBUS_XIO_UDP_SET_LISTEN_RANGE */ /* globus_bool_t restrict_port */ GLOBUS_XIO_UDP_SET_RESTRICT_PORT, /** GlobusVarArgEnum(attr) * Get the restrict port flag. * @ingroup udp_driver_cntls * * @param restrict_port_out * The restrict port flag will be stored here. */ /* globus_bool_t * restrict_port_out */ GLOBUS_XIO_UDP_GET_RESTRICT_PORT, /** GlobusVarArgEnum(attr) * Reuse addr when binding. * @ingroup udp_driver_cntls * Used to determine whether or not to allow reuse of addresses when * binding a socket to a port number. * * @param resuseaddr * GLOBUS_TRUE to allow, GLOBUS_FALSE to disallow (default) */ /* globus_bool_t resuseaddr */ GLOBUS_XIO_UDP_SET_REUSEADDR, /** GlobusVarArgEnum(attr) * Get the reuseaddr flag on an attr. * @ingroup udp_driver_cntls * * @param resuseaddr_out * The reuseaddr flag will be stored here. */ /* globus_bool_t * resuseaddr_out */ GLOBUS_XIO_UDP_GET_REUSEADDR, /** GlobusVarArgEnum(attr) * Restrict to IPV4 only. * @ingroup udp_driver_cntls * Disallow IPV6 sockets from being used * (default is to use either ipv4 or ipv6) * * @param no_ipv6 * GLOBUS_TRUE to disallow ipv6, GLOBUS_FALSE to allow (default) */ /* globus_bool_t no_ipv6 */ GLOBUS_XIO_UDP_SET_NO_IPV6, /** GlobusVarArgEnum(attr) * Get the no ipv6 flag on an attr. * @ingroup udp_driver_cntls * * @param no_ipv6_out * The no ipv6 flag will be stored here. */ /* globus_bool_t * no_ipv6_out */ GLOBUS_XIO_UDP_GET_NO_IPV6, /** GlobusVarArgEnum(attr, handle) * Get the socket handle on an attr or handle. * @ingroup udp_driver_cntls * * @param handle_out * The udp socket will be stored here. If none is set, * GLOBUS_XIO_UDP_INVALID_HANDLE will be set. */ /* globus_xio_system_socket_t * handle_out */ GLOBUS_XIO_UDP_GET_HANDLE, /** GlobusVarArgEnum(attr, handle) * Set the socket send buffer size. * @ingroup udp_driver_cntls * Used to set the size of the send buffer used on the socket. * * @param sndbuf * The send buffer size in bytes to use. (default is system specific) */ /* int sndbuf */ GLOBUS_XIO_UDP_SET_SNDBUF, /** GlobusVarArgEnum(attr, handle) * Get the send buffer size on the attr or handle. * @ingroup udp_driver_cntls * * @param sndbuf_out * The send buffer size will be stored here. */ /* int * sndbuf_out */ GLOBUS_XIO_UDP_GET_SNDBUF, /** GlobusVarArgEnum(attr, handle) * Set the socket receive buffer size. * @ingroup udp_driver_cntls * Used to set the size of the receive buffer used on the socket. * * @param rcvbuf * The receive buffer size in bytes. (default is system specific) */ /* int rcvbuf */ GLOBUS_XIO_UDP_SET_RCVBUF, /** GlobusVarArgEnum(attr, handle) * Get the receive buffer size on the attr or handle. * @ingroup udp_driver_cntls * * @param rcvbuf_out * The receive buffer size will be stored here. */ /* int * rcvbuf_out */ GLOBUS_XIO_UDP_GET_RCVBUF, /** GlobusVarArgEnum(handle, dd) * Get the contact string associated with a handle or data descriptor. * @ingroup udp_driver_cntls * Use with globus_xio_handle_cntl() to get a contact string for the udp * listener. Use with globus_xio_data_descriptor_cntl() to get the * sender's contact string from a data descriptor passed to * @ref globus_xio_register_read(). * * @param contact_string_out * A pointer to a contact string will be stored here. The user * should free() it when done with it. It will be in the * format: \:\ * * @see GLOBUS_XIO_GET_LOCAL_CONTACT */ /* char ** contact_string_out */ GLOBUS_XIO_UDP_GET_CONTACT, /** GlobusVarArgEnum(handle, dd) * Get the contact string associated with a handle or data descriptor. * @ingroup udp_driver_cntls * Use with globus_xio_handle_cntl() to get a contact string for the udp * listener. Use with globus_xio_data_descriptor_cntl() to get the * sender's contact string from a data descriptor passed to * @ref globus_xio_register_read(). * * @param contact_string_out * A pointer to a contact string will be stored here. The user * should free() it when done with it. It will be in the * format: \:\ * * @see GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT */ /* char ** contact_string_out */ GLOBUS_XIO_UDP_GET_NUMERIC_CONTACT, /** GlobusVarArgEnum(dd) * Set the destination contact. * @ingroup udp_driver_cntls * Use on a data descriptor passed to @ref globus_xio_register_write() to * specify the recipient of the data. This is necessary with unconnected * handles or to send to recipients other than the connected one. * * @param contact_string * A pointer to a contact string of the format * \:\ * * @see GLOBUS_XIO_UDP_CONNECT */ /* char * contact_string */ GLOBUS_XIO_UDP_SET_CONTACT, /** GlobusVarArgEnum(handle) * Set the default destination contact. * @ingroup udp_driver_cntls * Connecting a handle to a specific contact blocks packets from any other * contact. It also sets the default destination of all outgoing packets * so, using @ref GLOBUS_XIO_UDP_SET_CONTACT is unnecessary. * * @param contact_string * A pointer to a contact string of the format * \:\ */ /* char * contact_string */ GLOBUS_XIO_UDP_CONNECT, /** GlobusVarArgEnum(attr) * Join a multicast group. * @ingroup udp_driver_cntls * Specifiy a multicast group to join. All packets received will be * to the specified multicast address. Do not use * @ref GLOBUS_XIO_UDP_CONNECT, @ref GLOBUS_XIO_UDP_SET_PORT, or * pass a contact string on the open. Consider using * @ref GLOBUS_XIO_UDP_SET_REUSEADDR to allow other apps to join this * group. Use @ref GLOBUS_XIO_UDP_SET_INTERFACE to specify the * interface to use. Will not affect handles set with * @ref GLOBUS_XIO_UDP_SET_HANDLE. @ref GLOBUS_XIO_UDP_SET_RESTRICT_PORT * is ignored. * * @param contact_string * A pointer to a contact string of the multicast group to join with * the format: \:\ */ /* char * contact_string */ GLOBUS_XIO_UDP_SET_MULTICAST } globus_xio_udp_cmd_t; #endif globus_xio-3.6/builtins/udp/Makefile.am0000666000076400007640000000065611462370273015162 00000000000000include $(top_srcdir)/globus_automake_pre Sources= \ globus_xio_udp_driver.c include_HEADERS = \ globus_xio_udp_driver.h noinst_LTLIBRARIES = libglobus_xio_udp_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_udp_driver_la_SOURCES = $(Sources) libglobus_xio_udp_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_udp_driver_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/udp/Makefile.in0000664000076400007640000004374512225614604015174 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins/udp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_udp_driver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_udp_driver.lo am_libglobus_xio_udp_driver_la_OBJECTS = $(am__objects_1) libglobus_xio_udp_driver_la_OBJECTS = \ $(am_libglobus_xio_udp_driver_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_udp_driver_la_SOURCES) DIST_SOURCES = $(libglobus_xio_udp_driver_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies Sources = \ globus_xio_udp_driver.c include_HEADERS = \ globus_xio_udp_driver.h noinst_LTLIBRARIES = libglobus_xio_udp_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_udp_driver_la_SOURCES = $(Sources) libglobus_xio_udp_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_udp_driver_la_LIBADD = $(GPT_LIB_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/udp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/udp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio_udp_driver.la: $(libglobus_xio_udp_driver_la_OBJECTS) $(libglobus_xio_udp_driver_la_DEPENDENCIES) $(LINK) $(libglobus_xio_udp_driver_la_LDFLAGS) $(libglobus_xio_udp_driver_la_OBJECTS) $(libglobus_xio_udp_driver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-includeHEADERS : unlink: unlink-recursive unlink-includeHEADERS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS filelist: filelist-recursive filelist-includeHEADERS : link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/builtins/queue/0000775000076400007640000000000012225614637013534 500000000000000globus_xio-3.6/builtins/queue/globus_xio_queue.h0000666000076400007640000000132110363625131017172 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined GLOBUS_XIO_DRIVER_QUEUE_H #define GLOBUS_XIO_DRIVER_QUEUE_H 1 #include "globus_common.h" #endif globus_xio-3.6/builtins/queue/Makefile.am0000666000076400007640000000065211462370272015511 00000000000000include $(top_srcdir)/globus_automake_pre Sources= \ globus_xio_queue.c include_HEADERS = \ globus_xio_queue.h noinst_LTLIBRARIES = libglobus_xio_queue_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_queue_driver_la_SOURCES = $(Sources) libglobus_xio_queue_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_queue_driver_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/queue/globus_xio_queue.c0000666000076400007640000002357310363625131017202 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio_driver.h" #include "globus_xio_load.h" #include "globus_common.h" #include "globus_xio_queue.h" static int globus_l_xio_queue_activate(); static int globus_l_xio_queue_deactivate(); #include "version.h" GlobusXIODefineModule(queue) = { "globus_xio_queue", globus_l_xio_queue_activate, globus_l_xio_queue_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; typedef struct globus_xio_driver_queue_entry_s { globus_xio_iovec_t * iovec; int iovec_count; globus_xio_operation_t op; globus_size_t wait_for; struct globus_xio_driver_queue_handle_s * handle; globus_result_t res; } globus_xio_driver_queue_entry_t; typedef struct globus_xio_driver_queue_handle_s { int write_at_once; int outstanding_write; globus_fifo_t write_q; globus_mutex_t mutex; } globus_xio_driver_queue_handle_t; static globus_xio_driver_queue_handle_t * globus_l_xio_q_handle_create() { globus_xio_driver_queue_handle_t * handle; handle = (globus_xio_driver_queue_handle_t *) globus_malloc( sizeof(globus_xio_driver_queue_handle_t)); if(handle == NULL) { return NULL; } globus_fifo_init(&handle->write_q); globus_mutex_init(&handle->mutex, NULL); handle->outstanding_write = 0; handle->write_at_once = 1; return handle; } static void globus_l_xio_q_handle_destroy( globus_xio_driver_queue_handle_t * handle) { globus_fifo_destroy(&handle->write_q); globus_mutex_destroy(&handle->mutex); globus_free(handle); } /* * open */ void globus_l_xio_queue_open_cb( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_xio_driver_queue_handle_t * handle; handle = (globus_xio_driver_queue_handle_t *) user_arg; globus_xio_driver_finished_open(handle, op, result); if(result != GLOBUS_SUCCESS) { globus_l_xio_q_handle_destroy(handle); handle = NULL; } } static globus_result_t globus_l_xio_queue_open( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op) { globus_result_t res; globus_xio_driver_queue_handle_t * handle; handle = globus_l_xio_q_handle_create(); if(handle == NULL) { } res = globus_xio_driver_pass_open(op, contact_info, globus_l_xio_queue_open_cb, handle); return res; } static globus_result_t globus_l_xio_queue_close( void * driver_specific_handle, void * attr, globus_xio_operation_t op) { globus_result_t res; globus_xio_driver_queue_handle_t * handle; handle = (globus_xio_driver_queue_handle_t *) driver_specific_handle; globus_l_xio_q_handle_destroy(handle); res = globus_xio_driver_pass_close(op, NULL, NULL); return res; } /* * read */ void globus_l_xio_queue_read_cb( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_xio_driver_finished_read(op, result, nbytes); } static globus_result_t globus_l_xio_queue_read( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_size_t wait_for; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_queue_read); wait_for = globus_xio_operation_get_wait_for(op); res = globus_xio_driver_pass_read( op, (globus_xio_iovec_t *)iovec, iovec_count, wait_for, globus_l_xio_queue_read_cb, NULL); return res; } /* * write */ void globus_l_xio_queue_write_cb( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_xio_driver_queue_handle_t * handle; globus_bool_t done = GLOBUS_FALSE; globus_xio_driver_queue_entry_t * in_entry; globus_xio_driver_queue_entry_t * entry; globus_result_t res; globus_fifo_t q; globus_bool_t use_q = GLOBUS_FALSE; in_entry = (globus_xio_driver_queue_entry_t *) user_arg; handle = in_entry->handle; globus_mutex_lock(&handle->mutex); { handle->outstanding_write--; while(handle->outstanding_write < handle->write_at_once && !done) { if(globus_fifo_empty(&handle->write_q)) { done = GLOBUS_TRUE; } else { entry = (globus_xio_driver_queue_entry_t *) globus_fifo_dequeue(&handle->write_q); globus_assert(entry != NULL); res = globus_xio_driver_pass_write( entry->op, entry->iovec, entry->iovec_count, entry->wait_for, globus_l_xio_queue_write_cb, entry); if(res != GLOBUS_SUCCESS) { if(!use_q) { globus_fifo_init(&q); } use_q = GLOBUS_TRUE; entry->res = res; globus_fifo_enqueue(&q, entry); } else { handle->outstanding_write++; } } } } globus_mutex_unlock(&handle->mutex); globus_xio_driver_finished_write(in_entry->op, result, nbytes); globus_free(in_entry); if(use_q) { while(!globus_fifo_empty(&q)) { entry = (globus_xio_driver_queue_entry_t *) globus_fifo_dequeue(&q); globus_xio_driver_finished_write(entry->op, entry->res, 0); globus_free(entry); } globus_fifo_destroy(&q); } } static globus_result_t globus_l_xio_queue_write( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_result_t res = GLOBUS_SUCCESS; globus_xio_driver_queue_entry_t * entry; globus_size_t wait_for; globus_xio_driver_queue_handle_t * handle; GlobusXIOName(globus_l_xio_queue_write); handle = (globus_xio_driver_queue_handle_t *) driver_specific_handle; wait_for = globus_xio_operation_get_wait_for(op); entry = globus_malloc(sizeof(globus_xio_driver_queue_entry_t)); if(entry == NULL) { res = GlobusXIOErrorMemory("entry"); return res; } entry->wait_for = wait_for; entry->iovec = (globus_xio_iovec_t *)iovec; entry->iovec_count = iovec_count; entry->op = op; entry->handle = handle; entry->res = GLOBUS_SUCCESS; globus_mutex_lock(&handle->mutex); { if(handle->outstanding_write < handle->write_at_once) { res = globus_xio_driver_pass_write( op, (globus_xio_iovec_t *)iovec, iovec_count, wait_for, globus_l_xio_queue_write_cb, entry); if(res == GLOBUS_SUCCESS) { handle->outstanding_write++; } } else { res = GLOBUS_SUCCESS; globus_fifo_enqueue(&handle->write_q, entry); } } globus_mutex_unlock(&handle->mutex); return res; } static globus_result_t globus_l_xio_queue_init( globus_xio_driver_t * out_driver) { globus_xio_driver_t driver; globus_result_t res; res = globus_xio_driver_init(&driver, "queue", NULL); if(res != GLOBUS_SUCCESS) { return res; } globus_xio_driver_set_transform( driver, globus_l_xio_queue_open, globus_l_xio_queue_close, globus_l_xio_queue_read, globus_l_xio_queue_write, NULL, NULL); *out_driver = driver; return GLOBUS_SUCCESS; } static void globus_l_xio_queue_destroy( globus_xio_driver_t driver) { globus_xio_driver_destroy(driver); } GlobusXIODefineDriver( queue, globus_l_xio_queue_init, globus_l_xio_queue_destroy); static int globus_l_xio_queue_activate(void) { int rc; rc = globus_module_activate(GLOBUS_XIO_MODULE); if(rc == GLOBUS_SUCCESS) { GlobusXIORegisterDriver(queue); } return rc; } static int globus_l_xio_queue_deactivate(void) { GlobusXIOUnRegisterDriver(queue); return globus_module_deactivate(GLOBUS_XIO_MODULE); } globus_xio-3.6/builtins/queue/Makefile.in0000664000076400007640000004377212225614604015530 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins/queue ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_queue_driver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_queue.lo am_libglobus_xio_queue_driver_la_OBJECTS = $(am__objects_1) libglobus_xio_queue_driver_la_OBJECTS = \ $(am_libglobus_xio_queue_driver_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_queue_driver_la_SOURCES) DIST_SOURCES = $(libglobus_xio_queue_driver_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies Sources = \ globus_xio_queue.c include_HEADERS = \ globus_xio_queue.h noinst_LTLIBRARIES = libglobus_xio_queue_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_queue_driver_la_SOURCES = $(Sources) libglobus_xio_queue_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_queue_driver_la_LIBADD = $(GPT_LIB_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/queue/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/queue/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio_queue_driver.la: $(libglobus_xio_queue_driver_la_OBJECTS) $(libglobus_xio_queue_driver_la_DEPENDENCIES) $(LINK) $(libglobus_xio_queue_driver_la_LDFLAGS) $(libglobus_xio_queue_driver_la_OBJECTS) $(libglobus_xio_queue_driver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-includeHEADERS : unlink: unlink-recursive unlink-includeHEADERS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS filelist: filelist-recursive filelist-includeHEADERS : link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/builtins/mode_e/0000775000076400007640000000000012225614637013640 500000000000000globus_xio-3.6/builtins/mode_e/globus_xio_mode_e_driver.c0000666000076400007640000035145211522621707020770 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio_driver.h" #include "globus_xio_mode_e_driver.h" #include "version.h" GlobusDebugDefine(GLOBUS_XIO_MODE_E); GlobusXIODeclareDriver(mode_e); #define GlobusXIOModeEDebugPrintf(level, message) \ GlobusDebugPrintf(GLOBUS_XIO_MODE_E, level, message) #define GlobusXIOModeEDebugEnter() \ GlobusXIOModeEDebugPrintf( \ GLOBUS_L_XIO_MODE_E_DEBUG_TRACE, \ ("[%s] Entering\n", _xio_name)) #define GlobusXIOModeEDebugExit() \ GlobusXIOModeEDebugPrintf( \ GLOBUS_L_XIO_MODE_E_DEBUG_TRACE, \ ("[%s] Exiting\n", _xio_name)) #define GlobusXIOModeEDebugExitWithError() \ GlobusXIOModeEDebugPrintf( \ GLOBUS_L_XIO_MODE_E_DEBUG_TRACE, \ ("[%s] Exiting with error\n", _xio_name)) enum globus_l_xio_error_levels { GLOBUS_L_XIO_MODE_E_DEBUG_TRACE = 1, GLOBUS_L_XIO_MODE_E_DEBUG_INTERNAL_TRACE = 2 }; #define GLOBUS_XIO_MODE_E_IO_Q_SIZE 8 #define GLOBUS_XIO_MODE_E_HEADER_COUNT 8 #define GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE 8 #define GLOBUS_XIO_MODE_E_OFFSET_HT_SIZE 8 #define GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_CLOSE 0x04 #define GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD 0x08 #define GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF 0x40 typedef enum globus_i_xio_mode_e_state_s { GLOBUS_XIO_MODE_E_NONE, GLOBUS_XIO_MODE_E_OPEN, GLOBUS_XIO_MODE_E_OPENING, GLOBUS_XIO_MODE_E_SENDING_EOD, GLOBUS_XIO_MODE_E_EOF_RECEIVED, GLOBUS_XIO_MODE_E_EOF_DELIVERED, GLOBUS_XIO_MODE_E_CLOSING, GLOBUS_XIO_MODE_E_ERROR } globus_i_xio_mode_e_state_t; typedef globus_result_t (*globus_xio_mode_e_handle_cntl_callback_t)( globus_xio_handle_t xio_handle); typedef struct { globus_xio_stack_t stack; int max_connection_count; int eod_count; globus_xio_attr_t xio_attr; globus_bool_t send_eod; globus_bool_t manual_eodc; globus_off_t offset; globus_bool_t offset_reads; } globus_l_xio_mode_e_attr_t; static globus_l_xio_mode_e_attr_t globus_l_xio_mode_e_attr_default = { GLOBUS_NULL, 1, 0, GLOBUS_NULL, GLOBUS_FALSE, GLOBUS_FALSE, -1, GLOBUS_FALSE }; typedef struct { globus_byte_t descriptor; globus_byte_t count[8]; globus_byte_t offset[8]; } globus_l_xio_mode_e_header_t; typedef struct { globus_xio_server_t server; globus_xio_handle_t accepted_handle; globus_l_xio_mode_e_attr_t * attr; globus_i_xio_mode_e_state_t state; globus_memory_t requestor_memory; globus_memory_t header_memory; char * cs; globus_list_t * connection_list; globus_list_t * close_list; globus_list_t * eod_list; globus_fifo_t connection_q; globus_hashtable_t offset_ht; globus_fifo_t eod_q; int connection_count; int close_count; globus_off_t eod_count; globus_size_t eods_received; globus_size_t eods_sent; globus_bool_t eof_sent; globus_bool_t close_canceled; globus_fifo_t io_q; globus_mutex_t mutex; globus_off_t offset; globus_off_t eod_offset; globus_xio_operation_t outstanding_op; int ref_count; globus_xio_stack_t stack; globus_xio_driver_t driver; globus_object_t * error; } globus_l_xio_mode_e_handle_t; typedef struct { globus_xio_operation_t op; globus_xio_iovec_t * iovec; int iovec_count; globus_l_xio_mode_e_attr_t * dd; globus_l_xio_mode_e_handle_t * handle; globus_xio_handle_t xio_handle; } globus_i_xio_mode_e_requestor_t; typedef struct { globus_xio_handle_t xio_handle; globus_l_xio_mode_e_handle_t * mode_e_handle; globus_i_xio_mode_e_requestor_t * requestor; int iovec_index; globus_size_t iovec_index_len; globus_off_t outstanding_data_len; globus_off_t outstanding_data_offset; globus_bool_t eod; globus_bool_t close; } globus_l_xio_mode_e_connection_handle_t; static int globus_l_xio_mode_e_activate(void); static int globus_l_xio_mode_e_deactivate(void); static globus_result_t globus_l_xio_mode_e_handle_create( globus_l_xio_mode_e_handle_t ** out_handle, globus_l_xio_mode_e_attr_t * attr); static globus_result_t globus_l_xio_mode_e_handle_destroy( globus_l_xio_mode_e_handle_t * handle); static void globus_i_xio_mode_e_server_open_cb( globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg); static void globus_l_xio_mode_e_server_open_cb( globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg); static globus_result_t globus_i_xio_mode_e_register_read_header( globus_l_xio_mode_e_connection_handle_t * connection_handle); static globus_result_t globus_i_xio_mode_e_register_read( globus_l_xio_mode_e_connection_handle_t * connection_handle); static globus_result_t globus_i_xio_mode_e_register_write( globus_l_xio_mode_e_connection_handle_t * connection_handle); static globus_result_t globus_l_xio_mode_e_register_eod( globus_l_xio_mode_e_connection_handle_t * connection_handle, globus_byte_t descriptor); static void globus_l_xio_mode_e_close_cb( globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg); static globus_result_t globus_l_xio_mode_e_attr_init( void ** out_attr); static globus_result_t globus_l_xio_mode_e_attr_copy( void ** dst, void * src); static globus_result_t globus_l_xio_mode_e_attr_destroy( void * driver_attr); GlobusXIODefineModule(mode_e) = { "globus_xio_mode_e", globus_l_xio_mode_e_activate, globus_l_xio_mode_e_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; #define GlobusXIOModeEHeaderError(reason) \ globus_error_put( \ globus_error_construct_error( \ GlobusXIOMyModule(mode_e), \ GLOBUS_NULL, \ GLOBUS_XIO_MODE_E_HEADER_ERROR, \ __FILE__, \ _xio_name, \ __LINE__, \ "Header error: %s", (reason))) static globus_xio_string_cntl_table_t mode_e_l_string_opts_table[] = { {"streams", GLOBUS_XIO_MODE_E_SET_NUM_STREAMS, globus_xio_string_cntl_int}, {NULL, 0, NULL} }; static int globus_l_xio_mode_e_activate(void) { int rc; GlobusXIOName(globus_l_xio_mode_e_activate); GlobusDebugInit(GLOBUS_XIO_MODE_E, TRACE); GlobusXIOModeEDebugEnter(); rc = globus_module_activate(GLOBUS_XIO_MODULE); if (rc != GLOBUS_SUCCESS) { goto error_xio_system_activate; } GlobusXIORegisterDriver(mode_e); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_xio_system_activate: GlobusXIOModeEDebugExitWithError(); GlobusDebugDestroy(GLOBUS_XIO_MODE_E); return rc; } static int globus_l_xio_mode_e_deactivate(void) { int rc; GlobusXIOName(globus_l_xio_mode_e_deactivate); GlobusXIOModeEDebugEnter(); GlobusXIOUnRegisterDriver(mode_e); rc = globus_module_deactivate(GLOBUS_XIO_MODULE); if (rc != GLOBUS_SUCCESS) { goto error_deactivate; } GlobusXIOModeEDebugExit(); GlobusDebugDestroy(GLOBUS_XIO_MODE_E); return GLOBUS_SUCCESS; error_deactivate: GlobusXIOModeEDebugExitWithError(); GlobusDebugDestroy(GLOBUS_XIO_MODE_E); return rc; } int globus_l_xio_mode_e_hashtable_offset_hash( void * offsetp, int limit) { unsigned long h = 0; unsigned long g; char * key; int i; globus_size_t size; GlobusXIOName(globus_l_xio_mode_e_hashtable_offset_hash); GlobusXIOModeEDebugEnter(); key = (char *) offsetp; size = sizeof(globus_off_t); for (i = 0; i < size; i++) { h = (h << 4) + *key++; if ((g = (h & 0xF0UL))) { h ^= g >> 24; h ^= g; } } GlobusXIOModeEDebugExit(); return h % limit; } int globus_l_xio_mode_e_hashtable_offset_keyeq( void * offsetp1, void * offsetp2) { globus_size_t size; int rc = 0; GlobusXIOName(globus_l_xio_mode_e_hashtable_offset_keyeq); GlobusXIOModeEDebugEnter(); size = sizeof(globus_off_t); if(offsetp1 == offsetp2 || (offsetp1 && offsetp2 && strncmp(offsetp1, offsetp2, size) == 0)) { rc = 1; } GlobusXIOModeEDebugExit(); return rc; } static globus_result_t globus_l_xio_mode_e_handle_destroy( globus_l_xio_mode_e_handle_t * handle) { globus_result_t result; globus_bool_t stack = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_mode_e_handle_destroy); GlobusXIOModeEDebugEnter(); if (!handle->attr->stack) { stack = GLOBUS_TRUE; } result = globus_l_xio_mode_e_attr_destroy(handle->attr); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_mode_e_attr_destroy", result); goto error; } globus_object_free(handle->error); globus_fifo_destroy(&handle->connection_q); globus_fifo_destroy(&handle->eod_q); globus_fifo_destroy(&handle->io_q); globus_memory_destroy(&handle->requestor_memory); globus_memory_destroy(&handle->header_memory); globus_list_free(handle->connection_list); globus_list_free(handle->eod_list); globus_list_free(handle->close_list); globus_mutex_destroy(&handle->mutex); if (handle->server) { globus_xio_server_close(handle->server); } if (stack) { globus_xio_stack_destroy(handle->stack); } globus_free(handle); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error: GlobusXIOModeEDebugExitWithError(); return result; } static void globus_i_xio_mode_e_header_encode( globus_byte_t * buf, globus_off_t in_value) { globus_off_t x; int i; globus_size_t offset_size; GlobusXIOName(globus_i_xio_mode_e_header_encode); GlobusXIOModeEDebugEnter(); offset_size = sizeof(globus_off_t); /* * buf[0] contains most significant byte and buf[7] contains the * least significant byte */ globus_assert(GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE >= offset_size); for (i = GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE; i > offset_size; i--) { buf[GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE - i] = 0; } x = (globus_off_t)in_value; for (i = offset_size; i > 0; i--) { buf[GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE - i] = (x >> (i - 1) * 8) & 0xff; } GlobusXIOModeEDebugExit(); } static globus_result_t globus_i_xio_mode_e_header_decode( globus_byte_t * buf, globus_off_t * out_value) { globus_off_t x = 0; int i; globus_size_t offset_size; globus_result_t result; GlobusXIOName(globus_i_xio_mode_e_header_decode); GlobusXIOModeEDebugEnter(); offset_size = sizeof(globus_off_t); for (i = GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE; i > offset_size; i--) { /* * if offset_size < MAX_OFFSET_SIZE; then the most significant * (MAX_OFFSET_SIZE - offset_size) number of bytes should be zero; * otherwise there is an overflow */ if (buf[GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE - i] != 0) { result = GlobusXIOModeEHeaderError("offset overflow"); goto overflow; } } if (offset_size > GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE) { offset_size = GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE; } for (i = 0; i < offset_size; i++) { x += ((globus_off_t) buf[i]) << (offset_size - i - 1) * 8; } *out_value = (globus_off_t)x; GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; overflow: GlobusXIOModeEDebugExitWithError(); return result; } /* * allocate the memory for and initialize an internal handle */ static globus_result_t globus_l_xio_mode_e_handle_create( globus_l_xio_mode_e_handle_t ** out_handle, globus_l_xio_mode_e_attr_t * attr) { globus_l_xio_mode_e_handle_t * handle; globus_result_t result; int node_size; int node_count; GlobusXIOName(globus_l_xio_mode_e_handle_create); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) globus_malloc(sizeof(globus_l_xio_mode_e_handle_t)); if (handle == GLOBUS_NULL) { result = GlobusXIOErrorMemory("handle"); goto error_handle; } memset(handle, 0, sizeof(globus_l_xio_mode_e_handle_t)); if (!attr) { result = globus_l_xio_mode_e_attr_init((void**)(void*)&handle->attr); if (result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_mode_e_attr_init", result); goto error_attr; } } else { result = globus_l_xio_mode_e_attr_copy( (void**)(void*)&handle->attr, (void*)attr); if (result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_mode_e_attr_copy", result); goto error_attr; } } if (!handle->attr->stack) { result = globus_xio_driver_load("tcp", &handle->driver); if (result != GLOBUS_SUCCESS) { goto error_driver_load; } result = globus_xio_stack_init(&handle->stack, NULL); if (result != GLOBUS_SUCCESS) { goto error_stack_init; } result = globus_xio_stack_push_driver(handle->stack, handle->driver); if (result != GLOBUS_SUCCESS) { goto error_push_driver; } } else { handle->stack = handle->attr->stack; } result = globus_fifo_init(&handle->connection_q); if (result != GLOBUS_SUCCESS) { goto error_connection_q_init; } result = globus_fifo_init(&handle->eod_q); if (result != GLOBUS_SUCCESS) { goto error_eod_q_init; } result = globus_fifo_init(&handle->io_q); if (result != GLOBUS_SUCCESS) { goto error_io_q_init; } node_size = sizeof(globus_i_xio_mode_e_requestor_t); node_count = GLOBUS_XIO_MODE_E_IO_Q_SIZE; globus_memory_init(&handle->requestor_memory, node_size, node_count); node_size = sizeof(globus_l_xio_mode_e_header_t); node_count = GLOBUS_XIO_MODE_E_HEADER_COUNT; globus_memory_init(&handle->header_memory, node_size, node_count); globus_mutex_init(&handle->mutex, NULL); /* * As I did memset(handle, 0) in the beginning, here i initialize only the * fields that has to initialized with a non-zero value */ handle->eod_count = -1; handle->ref_count = 1; *out_handle = handle; GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_io_q_init: globus_fifo_destroy(&handle->eod_q); error_eod_q_init: globus_fifo_destroy(&handle->connection_q); error_connection_q_init: error_push_driver: if (!handle->attr->stack) { globus_xio_stack_destroy(handle->stack); } error_stack_init: if (!handle->attr->stack) { globus_xio_driver_unload(handle->driver); } error_driver_load: globus_l_xio_mode_e_attr_destroy(handle->attr); error_attr: globus_free(handle); error_handle: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_server_init( void * driver_attr, const globus_xio_contact_t * contact_info, globus_xio_operation_t op) { globus_l_xio_mode_e_handle_t * handle; globus_l_xio_mode_e_attr_t * attr; globus_xio_contact_t my_contact_info; char * cs; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_server_init); GlobusXIOModeEDebugEnter(); attr = (globus_l_xio_mode_e_attr_t *) driver_attr; result = globus_l_xio_mode_e_handle_create(&handle, attr); if (result != GLOBUS_SUCCESS) { goto error_handle_create; } if (!attr) { attr = handle->attr; } if(attr->xio_attr == NULL) { result = globus_xio_attr_init(&attr->xio_attr); if (result != GLOBUS_SUCCESS) { goto error_attr_init; } } result = globus_xio_server_create( &handle->server, attr->xio_attr, handle->stack); if (result != GLOBUS_SUCCESS) { goto error_server_create; } result = globus_xio_server_get_contact_string(handle->server, &cs); if (result != GLOBUS_SUCCESS) { goto error_get_cs; } result = globus_xio_contact_parse(&my_contact_info, cs); if (result != GLOBUS_SUCCESS) { goto error_parse_cs; } result = globus_xio_driver_pass_server_init(op, &my_contact_info, handle); if (result != GLOBUS_SUCCESS) { goto error_pass_server_init; } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_pass_server_init: error_parse_cs: error_get_cs: globus_xio_server_close(handle->server); error_server_create: globus_xio_attr_destroy(attr->xio_attr); error_attr_init: globus_l_xio_mode_e_handle_destroy(handle); error_handle_create: GlobusXIOModeEDebugExitWithError(); return result; } static void globus_l_xio_mode_e_save_error( globus_l_xio_mode_e_handle_t * handle, globus_result_t result) { GlobusXIOName(globus_l_xio_mode_e_save_error); GlobusXIOModeEDebugEnter(); handle->state = GLOBUS_XIO_MODE_E_ERROR; if (handle->error == GLOBUS_NULL) { handle->error = globus_object_copy(globus_error_peek(result)); } GlobusXIOModeEDebugExit(); } static void globus_l_xio_mode_e_server_accept_cb( globus_xio_server_t server, globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg) { globus_l_xio_mode_e_handle_t * handle; globus_xio_operation_t op; GlobusXIOName(globus_l_xio_mode_e_server_accept_cb); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *)user_arg; globus_xio_operation_disable_cancel(handle->outstanding_op); globus_mutex_lock(&handle->mutex); op = handle->outstanding_op; if (result == GLOBUS_SUCCESS) { ++handle->ref_count; handle->accepted_handle = xio_handle; } else { goto error_accept; } globus_mutex_unlock(&handle->mutex); globus_xio_driver_finished_accept(op, handle, result); GlobusXIOModeEDebugExit(); return; error_accept: globus_mutex_unlock(&handle->mutex); globus_xio_driver_finished_accept(op, handle, result); GlobusXIOModeEDebugExitWithError(); return; } /* * At any instance, there would be a globus_xio_server_register_accept * outstanding to accept any new incoming connection. For the very first * register accept (done in globus_l_xio_mode_e_server_accept), * globus_l_xio_mode_e_server_accept_cb is used. For the subsequent * register accpets, this function is used */ static void globus_i_xio_mode_e_server_accept_cb( globus_xio_server_t server, globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg) { globus_l_xio_mode_e_handle_t * handle; globus_result_t res; GlobusXIOName(globus_i_xio_mode_e_server_accept_cb); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *)user_arg; globus_mutex_lock(&handle->mutex); if (result != GLOBUS_SUCCESS) { res = result; goto error_accept; } switch (handle->state) { case GLOBUS_XIO_MODE_E_OPEN: { globus_result_t res; res = globus_xio_register_open( xio_handle, NULL, handle->attr->xio_attr, globus_i_xio_mode_e_server_open_cb, handle); if (res != GLOBUS_SUCCESS) { globus_xio_register_close( xio_handle, NULL, NULL, NULL); goto error_register_open; } res = globus_xio_server_register_accept( server, globus_i_xio_mode_e_server_accept_cb, handle); if (res != GLOBUS_SUCCESS) { goto error_register_accept; } break; } default: res = GlobusXIOErrorInvalidState(handle->state); goto error_invalid_state; } globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExit(); return; error_register_accept: error_register_open: error_invalid_state: error_accept: globus_l_xio_mode_e_save_error(handle, res); globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExitWithError(); return; } /* called locked */ static globus_result_t globus_i_xio_mode_e_cancel_operations( globus_l_xio_mode_e_handle_t * handle) { globus_xio_handle_t xio_handle; globus_result_t result; int mask; GlobusXIOName(globus_i_xio_mode_e_cancel_operations); GlobusXIOModeEDebugEnter(); /* * If user cancels close on the client side, both register_write (eods) * and register_close can be outstanding */ mask = GLOBUS_XIO_CANCEL_WRITE; while (!globus_list_empty(handle->eod_list)) { xio_handle = (globus_xio_handle_t) globus_list_remove(&handle->eod_list, handle->eod_list); result = globus_xio_handle_cancel_operations(xio_handle, mask); if (result != GLOBUS_SUCCESS) { goto error; } } mask = GLOBUS_XIO_CANCEL_CLOSE; while (!globus_list_empty(handle->close_list)) { xio_handle = (globus_xio_handle_t) globus_list_remove(&handle->close_list, handle->close_list); result = globus_xio_handle_cancel_operations(xio_handle, mask); if (result != GLOBUS_SUCCESS) { goto error; } } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error: GlobusXIOModeEDebugExitWithError(); return result; } static void globus_l_xio_mode_e_cancel_cb( globus_xio_operation_t op, void * user_arg, globus_xio_error_type_t reason) { globus_i_xio_mode_e_requestor_t * requestor; globus_l_xio_mode_e_handle_t * handle; int mask; globus_bool_t finish = GLOBUS_FALSE; globus_result_t result; globus_bool_t send_eod = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_mode_e_cancel_cb); GlobusXIOModeEDebugEnter(); requestor = (globus_i_xio_mode_e_requestor_t *) user_arg; handle = requestor->handle; globus_mutex_lock(&handle->mutex); switch (handle->state) { case GLOBUS_XIO_MODE_E_NONE: result = globus_xio_server_cancel_accept(handle->server); break; case GLOBUS_XIO_MODE_E_OPENING: result = globus_xio_handle_cancel_operations( requestor->xio_handle, GLOBUS_XIO_CANCEL_OPEN); if (result != GLOBUS_SUCCESS) { goto error; } break; case GLOBUS_XIO_MODE_E_OPEN: case GLOBUS_XIO_MODE_E_SENDING_EOD: if (handle->server) { mask = GLOBUS_XIO_CANCEL_READ; } else { mask = GLOBUS_XIO_CANCEL_WRITE; } if (requestor->dd) { send_eod = requestor->dd->send_eod; } if (globus_fifo_empty(&handle->io_q) || !globus_fifo_remove(&handle->io_q, requestor)) { /* * requestor->xio_handle would be NULL if cancel was called * after enable_cancel is called in read/write and before the * lock is required in read/write. In that case an xio * operation would not have been initiated. So I dont do * anything here. */ if (requestor->xio_handle) { result = globus_xio_handle_cancel_operations( requestor->xio_handle, mask); if (result != GLOBUS_SUCCESS) { goto error; } } } else { globus_memory_push_node( &handle->requestor_memory, (void*)requestor); finish = GLOBUS_TRUE; } if (send_eod) { result = globus_i_xio_mode_e_cancel_operations(handle); if (result != GLOBUS_SUCCESS) { goto error; } } break; case GLOBUS_XIO_MODE_E_CLOSING: result = globus_i_xio_mode_e_cancel_operations(handle); if (result != GLOBUS_SUCCESS) { goto error; } break; case GLOBUS_XIO_MODE_E_EOF_RECEIVED: case GLOBUS_XIO_MODE_E_EOF_DELIVERED: break; default: result = GlobusXIOErrorInvalidState(handle->state); goto error; } globus_mutex_unlock(&handle->mutex); if (finish) { if (mask == GLOBUS_XIO_CANCEL_READ) { globus_xio_driver_finished_read(op, GlobusXIOErrorCanceled(), 0); } else { globus_xio_driver_finished_write(op, GlobusXIOErrorCanceled(), 0); } } GlobusXIOModeEDebugExit(); return; error: globus_l_xio_mode_e_save_error(handle, result); globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExitWithError(); return; } static globus_result_t globus_l_xio_mode_e_server_accept( void * driver_server, globus_xio_operation_t op) { globus_l_xio_mode_e_handle_t * handle; globus_i_xio_mode_e_requestor_t * requestor; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_server_accept); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t*)driver_server; handle->outstanding_op = op; requestor = (globus_i_xio_mode_e_requestor_t *) globus_memory_pop_node(&handle->requestor_memory); requestor->handle = handle; requestor->op = op; if (globus_xio_operation_enable_cancel( op, globus_l_xio_mode_e_cancel_cb, requestor)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } globus_mutex_lock(&handle->mutex); if (globus_xio_operation_is_canceled(op)) { result = GlobusXIOErrorCanceled(); goto error_operation_canceled; } result = globus_xio_server_register_accept( handle->server, globus_l_xio_mode_e_server_accept_cb, handle); if (result != GLOBUS_SUCCESS) { goto error_register_accept; } globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_register_accept: error_operation_canceled: globus_mutex_unlock(&handle->mutex); globus_xio_operation_disable_cancel(op); error_cancel_enable: /* globus memory has its own lock and i can use it like malloc and free */ globus_memory_push_node(&handle->requestor_memory, (void*)requestor); GlobusXIOModeEDebugExitWithError(); return result; } globus_result_t globus_l_xio_mode_e_server_destroy( void * driver_server) { globus_l_xio_mode_e_handle_t * handle; GlobusXIOName(globus_l_xio_mode_e_server_destroy); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *)driver_server; globus_mutex_lock(&handle->mutex); --handle->ref_count; if (handle->ref_count == 0) { globus_mutex_unlock(&handle->mutex); globus_l_xio_mode_e_handle_destroy(handle); } else { globus_mutex_unlock(&handle->mutex); } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_l_xio_mode_e_server_cntl( void * driver_server, int cmd, va_list ap) { GlobusXIOName(globus_l_xio_mode_e_server_cntl); GlobusXIOModeEDebugEnter(); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_l_xio_mode_e_link_cntl( void * driver_link, int cmd, va_list ap) { GlobusXIOName(globus_l_xio_mode_e_link_cntl); GlobusXIOModeEDebugEnter(); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_l_xio_mode_e_link_destroy( void * driver_link) { globus_l_xio_mode_e_handle_t * handle; GlobusXIOName(globus_l_xio_mode_e_link_destroy); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) driver_link; globus_mutex_lock(&handle->mutex); --handle->ref_count; if (handle->ref_count == 0) { globus_mutex_unlock(&handle->mutex); globus_l_xio_mode_e_handle_destroy(handle); } else { globus_mutex_unlock(&handle->mutex); } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; } static void globus_l_xio_mode_e_server_connection_handle_init( globus_l_xio_mode_e_connection_handle_t * connection_handle) { GlobusXIOName(globus_l_xio_mode_e_server_connection_handle_init); GlobusXIOModeEDebugEnter(); connection_handle->requestor = GLOBUS_NULL; connection_handle->eod = GLOBUS_FALSE; connection_handle->close = GLOBUS_FALSE; connection_handle->outstanding_data_len = 0; connection_handle->iovec_index = -1; GlobusXIOModeEDebugExit(); } /* called locked */ static globus_result_t globus_l_xio_mode_e_process_header( globus_l_xio_mode_e_header_t * header, globus_l_xio_mode_e_connection_handle_t * connection_handle) { globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_process_header); GlobusXIOModeEDebugEnter(); if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD) { connection_handle->eod = GLOBUS_TRUE; } if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_CLOSE) { /* sending CLOSE before EOD is a protocol violation */ globus_assert(connection_handle->eod); connection_handle->close = GLOBUS_TRUE; } if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF) { connection_handle->outstanding_data_len = 0; connection_handle->outstanding_data_offset = 0; result = globus_i_xio_mode_e_header_decode( header->offset, &connection_handle->mode_e_handle->eod_count); if (result != GLOBUS_SUCCESS) { goto error; } } else { result = globus_i_xio_mode_e_header_decode( header->count, &connection_handle->outstanding_data_len); if (result != GLOBUS_SUCCESS) { goto error; } result = globus_i_xio_mode_e_header_decode( header->offset, &connection_handle->outstanding_data_offset); if (result != GLOBUS_SUCCESS) { goto error; } } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error: GlobusXIOModeEDebugExitWithError(); return result; } /* called locked */ static globus_i_xio_mode_e_requestor_t * globus_l_xio_mode_e_process_outstanding_data( globus_l_xio_mode_e_connection_handle_t * connection_handle) { globus_l_xio_mode_e_handle_t * handle; globus_i_xio_mode_e_requestor_t * requestor = GLOBUS_NULL; GlobusXIOName(globus_l_xio_mode_e_process_outstanding_data); GlobusXIOModeEDebugEnter(); handle = connection_handle->mode_e_handle; if (!globus_fifo_empty(&handle->io_q)) { requestor = (globus_i_xio_mode_e_requestor_t *) globus_fifo_dequeue(&handle->io_q); if (handle->attr->offset_reads) { /* wait_for of this requestor should be zero */ requestor->dd->offset = connection_handle->outstanding_data_offset; globus_hashtable_insert( &handle->offset_ht, (void *) &connection_handle->outstanding_data_offset, (void *) connection_handle); } else { connection_handle->requestor = requestor; requestor = GLOBUS_NULL; globus_i_xio_mode_e_register_read(connection_handle); } } else { globus_fifo_enqueue(&handle->connection_q, connection_handle); } GlobusXIOModeEDebugExit(); return requestor; } static globus_bool_t globus_l_xio_mode_e_process_eod( globus_l_xio_mode_e_connection_handle_t * connection_handle, globus_fifo_t * requestor_q) { globus_l_xio_mode_e_handle_t * handle; globus_i_xio_mode_e_requestor_t * requestor; globus_bool_t eof = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_mode_e_process_eod); GlobusXIOModeEDebugEnter(); handle = connection_handle->mode_e_handle; ++handle->eods_received; if (connection_handle->close) { globus_xio_register_close( connection_handle->xio_handle, NULL, globus_l_xio_mode_e_close_cb, handle); globus_list_remove(&handle->connection_list, globus_list_search(handle->connection_list, connection_handle)); globus_free(connection_handle); } else { globus_fifo_enqueue(&handle->eod_q, connection_handle); } if (handle->eod_count == handle->eods_received) { eof = GLOBUS_TRUE; while (!globus_fifo_empty(&handle->io_q)) { requestor = (globus_i_xio_mode_e_requestor_t*) globus_fifo_dequeue(&handle->io_q); globus_fifo_enqueue(requestor_q, requestor); } } GlobusXIOModeEDebugExit(); return eof; } static void globus_l_xio_mode_e_read_header_cb( globus_xio_handle_t xio_handle, globus_result_t result, globus_byte_t * buffer, globus_size_t len, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg) { globus_l_xio_mode_e_handle_t * handle; globus_l_xio_mode_e_header_t * header; globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_i_xio_mode_e_requestor_t * requestor = GLOBUS_NULL; globus_xio_operation_t op; globus_fifo_t requestor_q; globus_bool_t eof; globus_bool_t finish = GLOBUS_FALSE; globus_bool_t finish_close = GLOBUS_FALSE; globus_result_t res; globus_off_t offset; GlobusXIOName(globus_l_xio_mode_e_read_header_cb); GlobusXIOModeEDebugEnter(); globus_fifo_init(&requestor_q); connection_handle = (globus_l_xio_mode_e_connection_handle_t *) user_arg; handle = connection_handle->mode_e_handle; offset = connection_handle->outstanding_data_offset; globus_mutex_lock(&handle->mutex); if (result == GLOBUS_SUCCESS) { header = (globus_l_xio_mode_e_header_t *) buffer; result = globus_l_xio_mode_e_process_header(header, connection_handle); if (result != GLOBUS_SUCCESS) { goto error; } globus_memory_push_node(&handle->header_memory, (void*)buffer); if (connection_handle->outstanding_data_len > 0) { requestor = globus_l_xio_mode_e_process_outstanding_data( connection_handle); } /* * If EOF is set in header, data len will be zero. If EOD alone is * set, there can be data present. If EOD is set on header and also * there is data present, i process EOD in read_cb. If I process it * here and if it so happens that eods_received == eod_count, * process_eod will return true (eof) and the state would be set to * GLOBUS_XIO_MODE_E_EOF_RECEIVED or DELIVERED and there would be no * way for the user to read the data that had EOD set on the header. */ else if (connection_handle->eod) { eof = globus_l_xio_mode_e_process_eod( connection_handle, &requestor_q); if (eof) { if (globus_fifo_empty(&requestor_q)) { if (handle->state == GLOBUS_XIO_MODE_E_OPEN) { handle->state = GLOBUS_XIO_MODE_E_EOF_RECEIVED; } } else { requestor = (globus_i_xio_mode_e_requestor_t *) globus_fifo_peek(&requestor_q); globus_xio_driver_set_eof_received(requestor->op); /* * If this part of the code is executed, finished_read * happen only in if (finish) {} block below. The * finished_read in if (requestor) {} block below should * happen only if process_outstanding_data called above * returns a non NULL requestor value. Thats why requestor * is set to NULL here */ requestor = GLOBUS_NULL; finish = GLOBUS_TRUE; if (handle->state == GLOBUS_XIO_MODE_E_OPEN) { handle->state = GLOBUS_XIO_MODE_E_EOF_DELIVERED; } } } } else { result = globus_i_xio_mode_e_register_read_header( connection_handle); if (result != GLOBUS_SUCCESS) { goto error; } } } else if(globus_error_match( globus_error_peek(result), GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_CANCELED)) { /* * if there are outstanding header reads and user calls close, the * header reads are canceled in close */ if (!handle->close_canceled) { globus_xio_register_close( connection_handle->xio_handle, NULL, globus_l_xio_mode_e_close_cb, connection_handle->mode_e_handle); globus_list_insert( &handle->close_list, connection_handle->xio_handle); } else { ++handle->close_count; if (handle->close_count == handle->connection_count) { finish_close = GLOBUS_TRUE; op = handle->outstanding_op; } } globus_free(connection_handle); } else { while (!globus_fifo_empty(&handle->io_q)) { requestor = (globus_i_xio_mode_e_requestor_t*) globus_fifo_dequeue(&handle->io_q); globus_fifo_enqueue(&requestor_q, requestor); } goto error; } globus_mutex_unlock(&handle->mutex); if (requestor) { globus_xio_operation_disable_cancel(requestor->op); op = requestor->op; globus_memory_push_node(&handle->requestor_memory, (void*)requestor); globus_xio_driver_finished_read(op, GLOBUS_SUCCESS, 0); } if (finish) { while (!globus_fifo_empty(&requestor_q)) { requestor = (globus_i_xio_mode_e_requestor_t*) globus_fifo_dequeue( &requestor_q); globus_xio_operation_disable_cancel(requestor->op); op = requestor->op; /* * Earlier I had this push_node inside process_eod but then i moved * here to avoid a race. process_eod is called with lock held and * when lock is released above, sometimes cancel_cb gets called and * it tries to access the requestor which is no more. To get rid * of that, I moved the push_node to here after disable_cancel. * Since requestor is removed from the handle->io_q and put in * requestor_q by process_eod function, cancel_cb will not do * finished_read on requestor->op. Similar thing is done in read_cb * too */ globus_memory_push_node(&handle->requestor_memory, requestor); globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_SET_OFFSET, offset); res = GlobusXIOErrorEOF(); globus_xio_driver_finished_read(op, res, 0); } } globus_fifo_destroy(&requestor_q); if (finish_close) { globus_xio_operation_disable_cancel(op); globus_xio_driver_finished_close(op, result); } GlobusXIOModeEDebugExit(); return; error: globus_l_xio_mode_e_save_error(handle, result); globus_mutex_unlock(&handle->mutex); while (!globus_fifo_empty(&requestor_q)) { requestor = (globus_i_xio_mode_e_requestor_t*) globus_fifo_dequeue(&requestor_q); globus_xio_operation_disable_cancel(requestor->op); op = requestor->op; globus_memory_push_node(&handle->requestor_memory, (void*)requestor); globus_xio_driver_finished_read(op, result, 0); } GlobusXIOModeEDebugExitWithError(); return; } static void globus_l_xio_mode_e_open_cb( globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg) { globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_l_xio_mode_e_handle_t * handle; globus_xio_operation_t op; globus_result_t res = result; globus_size_t connection_handle_size; GlobusXIOName(globus_l_xio_mode_e_open_cb); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *)user_arg; globus_xio_operation_disable_cancel(handle->outstanding_op); globus_mutex_lock(&handle->mutex); op = handle->outstanding_op; if (res != GLOBUS_SUCCESS) { goto error; } connection_handle_size = sizeof(globus_l_xio_mode_e_connection_handle_t); connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_malloc(connection_handle_size); if (!connection_handle) { res = GlobusXIOErrorMemory("connection_handle"); goto error_connection_handle; } memset(connection_handle, 0, connection_handle_size); handle->state = GLOBUS_XIO_MODE_E_OPEN; connection_handle->xio_handle = xio_handle; connection_handle->mode_e_handle = handle; connection_handle->eod = GLOBUS_FALSE; globus_fifo_enqueue(&handle->connection_q, connection_handle); globus_mutex_unlock(&handle->mutex); globus_xio_driver_finished_open(handle, op, res); GlobusXIOModeEDebugExit(); return; error_connection_handle: globus_xio_register_close(xio_handle, NULL, NULL, NULL); /* attr_init is done before register_open in open_new_stream */ error: globus_xio_attr_destroy(handle->attr->xio_attr); if (--handle->ref_count == 0) { globus_mutex_unlock(&handle->mutex); globus_l_xio_mode_e_handle_destroy(handle); } else { globus_l_xio_mode_e_save_error(handle, res); globus_mutex_unlock(&handle->mutex); } globus_xio_driver_finished_open(handle, op, res); GlobusXIOModeEDebugExitWithError(); return; } static void globus_i_xio_mode_e_open_cb( globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg) { globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_l_xio_mode_e_handle_t * handle; globus_xio_operation_t write_op; globus_result_t res; globus_bool_t finish_write = GLOBUS_FALSE; GlobusXIOName(globus_i_xio_mode_e_open_cb); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *)user_arg; globus_mutex_lock(&handle->mutex); if (result == GLOBUS_SUCCESS) { globus_size_t connection_handle_size; connection_handle_size = sizeof(globus_l_xio_mode_e_connection_handle_t); connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_malloc(connection_handle_size); if (!connection_handle) { res = GlobusXIOErrorMemory("connection_handle"); goto error_connection_handle; } memset(connection_handle, 0, connection_handle_size); connection_handle->xio_handle = xio_handle; connection_handle->mode_e_handle = handle; connection_handle->eod = GLOBUS_FALSE; if (!globus_fifo_empty(&handle->io_q)) { globus_i_xio_mode_e_requestor_t * requestor; requestor = (globus_i_xio_mode_e_requestor_t *) globus_fifo_dequeue(&handle->io_q); connection_handle->requestor = requestor; res = globus_i_xio_mode_e_register_write(connection_handle); if (res != GLOBUS_SUCCESS) { write_op = requestor->op; finish_write = GLOBUS_TRUE; goto error_register_write; } } else { globus_fifo_enqueue(&handle->connection_q, connection_handle); } } else { res = result; goto error_open; } globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExit(); return; error_register_write: error_connection_handle: globus_xio_register_close(xio_handle, NULL, NULL, NULL); /* attr_init is done before register_open in open_new_stream */ globus_xio_attr_destroy(handle->attr->xio_attr); error_open: globus_l_xio_mode_e_save_error(handle, res); globus_mutex_unlock(&handle->mutex); if (finish_write) { globus_xio_driver_data_descriptor_cntl( write_op, NULL, GLOBUS_XIO_DD_SET_OFFSET, connection_handle->outstanding_data_offset); globus_xio_driver_finished_write(write_op, res, 0); } GlobusXIOModeEDebugExitWithError(); return; } static void globus_i_xio_mode_e_server_open_cb( globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg) { globus_l_xio_mode_e_handle_t * handle; globus_result_t res; GlobusXIOName(globus_i_xio_mode_e_server_open_cb); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) user_arg; globus_mutex_lock(&handle->mutex); if (result == GLOBUS_SUCCESS) { globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_result_t res; connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_malloc(sizeof( globus_l_xio_mode_e_connection_handle_t)); connection_handle->mode_e_handle = handle; connection_handle->xio_handle = xio_handle; globus_list_insert(&handle->connection_list, connection_handle); res = globus_i_xio_mode_e_register_read_header(connection_handle); if (res != GLOBUS_SUCCESS) { goto error; } ++handle->connection_count; } else { res = result; goto error; } globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExit(); return; error: globus_l_xio_mode_e_save_error(handle, res); globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExitWithError(); return; } static void globus_l_xio_mode_e_server_open_cb( globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg) { globus_l_xio_mode_e_handle_t * handle; globus_xio_operation_t op; GlobusXIOName(globus_l_xio_mode_e_server_open_cb); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) user_arg; globus_xio_operation_disable_cancel(handle->outstanding_op); globus_mutex_lock(&handle->mutex); op = handle->outstanding_op; if (result != GLOBUS_SUCCESS) { goto error; } handle->state = GLOBUS_XIO_MODE_E_OPEN; globus_mutex_unlock(&handle->mutex); globus_i_xio_mode_e_server_open_cb(xio_handle, result, user_arg); globus_xio_driver_finished_open(handle, op, result); GlobusXIOModeEDebugExit(); return; error: if (--handle->ref_count == 0) { globus_mutex_unlock(&handle->mutex); globus_l_xio_mode_e_handle_destroy(handle); } else { globus_l_xio_mode_e_save_error(handle, result); globus_mutex_unlock(&handle->mutex); } globus_xio_driver_finished_open(NULL, op, result); GlobusXIOModeEDebugExitWithError(); return; } /* called locked (if handle->state == GLOBUS_XIO_MODE_E_OPEN) */ static globus_result_t globus_l_xio_mode_e_open_new_stream( globus_l_xio_mode_e_handle_t * handle, globus_xio_callback_t open_cb) { globus_xio_handle_t xio_handle; globus_l_xio_mode_e_attr_t * attr; globus_i_xio_mode_e_requestor_t * requestor; globus_xio_operation_t op; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_open_new_stream); GlobusXIOModeEDebugEnter(); attr = handle->attr; if(attr->xio_attr == NULL) { result = globus_xio_attr_init(&attr->xio_attr); if (result != GLOBUS_SUCCESS) { goto error_attr_init; } } result = globus_xio_handle_create(&xio_handle, handle->stack); if (result != GLOBUS_SUCCESS) { goto error_handle_create; } if (handle->state == GLOBUS_XIO_MODE_E_OPENING) { requestor = (globus_i_xio_mode_e_requestor_t *) globus_memory_pop_node(&handle->requestor_memory); requestor->xio_handle = xio_handle; requestor->handle = handle; op = handle->outstanding_op; if (globus_xio_operation_enable_cancel( op, globus_l_xio_mode_e_cancel_cb, requestor)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } globus_mutex_lock(&handle->mutex); if (globus_xio_operation_is_canceled(handle->outstanding_op)) { result = GlobusXIOErrorCanceled(); goto error_operation_canceled; } } result = globus_xio_register_open( xio_handle, handle->cs, handle->attr->xio_attr, open_cb, handle); if (result != GLOBUS_SUCCESS) { goto error_open; } ++handle->connection_count; if (handle->state == GLOBUS_XIO_MODE_E_OPENING) { globus_mutex_unlock(&handle->mutex); } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_open: error_operation_canceled: if (handle->state == GLOBUS_XIO_MODE_E_OPENING) { globus_mutex_unlock(&handle->mutex); globus_xio_operation_disable_cancel(op); } error_cancel_enable: if (handle->state == GLOBUS_XIO_MODE_E_OPENING) { globus_memory_push_node(&handle->requestor_memory, (void*)requestor); } error_handle_create: globus_xio_register_close(xio_handle, NULL, NULL, NULL); globus_xio_attr_destroy(handle->attr->xio_attr); error_attr_init: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_server_open( globus_l_xio_mode_e_handle_t * handle, globus_xio_operation_t op) { globus_i_xio_mode_e_requestor_t * requestor; globus_result_t result; globus_bool_t destroy = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_mode_e_server_open); GlobusXIOModeEDebugEnter(); globus_mutex_lock(&handle->mutex); handle->outstanding_op = op; if (handle->attr->offset_reads) { result = globus_hashtable_init( &handle->offset_ht, GLOBUS_XIO_MODE_E_OFFSET_HT_SIZE, globus_l_xio_mode_e_hashtable_offset_hash, globus_l_xio_mode_e_hashtable_offset_keyeq); if (result != GLOBUS_SUCCESS) { goto error_hashtable_init; } } requestor = (globus_i_xio_mode_e_requestor_t *) globus_memory_pop_node(&handle->requestor_memory); requestor->xio_handle = handle->accepted_handle; requestor->handle = handle; globus_mutex_unlock(&handle->mutex); if (globus_xio_operation_enable_cancel( op, globus_l_xio_mode_e_cancel_cb, requestor)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } globus_mutex_lock(&handle->mutex); if (globus_xio_operation_is_canceled(op)) { result = GlobusXIOErrorCanceled(); goto error_operation_canceled; } result = globus_xio_register_open( handle->accepted_handle, NULL, handle->attr->xio_attr, globus_l_xio_mode_e_server_open_cb, handle); if (result != GLOBUS_SUCCESS) { if (handle->ref_count == 0) { destroy = GLOBUS_TRUE; } goto error_register_open; } ++handle->ref_count; result = globus_xio_server_register_accept( handle->server, globus_i_xio_mode_e_server_accept_cb, handle); if (result != GLOBUS_SUCCESS) { goto error_register_accept; } globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_register_accept: error_register_open: error_operation_canceled: globus_mutex_unlock(&handle->mutex); globus_xio_operation_disable_cancel(op); if (destroy) { globus_l_xio_mode_e_handle_destroy(handle); } error_cancel_enable: globus_memory_push_node(&handle->requestor_memory, (void*)requestor); error_hashtable_init: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_open( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op) { globus_l_xio_mode_e_handle_t * handle; globus_l_xio_mode_e_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_open); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) driver_link; attr = (globus_l_xio_mode_e_attr_t *) driver_attr; if (!handle) /* Client */ { result = globus_l_xio_mode_e_handle_create(&handle, attr); if (result != GLOBUS_SUCCESS) { goto error_handle_create; } handle->state = GLOBUS_XIO_MODE_E_OPENING; result = globus_xio_contact_info_to_string( contact_info, &handle->cs); if (result != GLOBUS_SUCCESS) { goto error_contact_info_to_string; } handle->outstanding_op = op; result = globus_l_xio_mode_e_open_new_stream( handle, globus_l_xio_mode_e_open_cb); if (result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_mode_e_open_new_stream", result); goto error_open_new_stream; } } else /* Server */ { handle->state = GLOBUS_XIO_MODE_E_OPENING; result = globus_l_xio_mode_e_server_open(handle, op); if (result != GLOBUS_SUCCESS) { globus_l_xio_mode_e_save_error(handle, result); goto error_server_open; } } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_open_new_stream: error_contact_info_to_string: globus_l_xio_mode_e_handle_destroy(handle); error_handle_create: error_server_open: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_i_xio_mode_e_register_read_header( globus_l_xio_mode_e_connection_handle_t * connection_handle) { globus_l_xio_mode_e_header_t * header; globus_size_t header_size; globus_result_t result; GlobusXIOName(globus_i_xio_mode_e_register_read_header); GlobusXIOModeEDebugEnter(); globus_l_xio_mode_e_server_connection_handle_init(connection_handle); header = (globus_l_xio_mode_e_header_t *) globus_memory_pop_node( &connection_handle->mode_e_handle->header_memory); header_size = sizeof(globus_l_xio_mode_e_header_t); result = globus_xio_register_read( connection_handle->xio_handle, (globus_byte_t*)header, header_size, header_size, NULL, /* data_desc */ globus_l_xio_mode_e_read_header_cb, connection_handle); GlobusXIOModeEDebugExit(); return result; } static void globus_l_xio_mode_e_read_cb( globus_xio_handle_t xio_handle, globus_result_t result, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg) { globus_result_t res = result; globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_l_xio_mode_e_handle_t * handle; globus_bool_t eof; globus_xio_operation_t op; globus_off_t offset; globus_fifo_t requestor_q; globus_i_xio_mode_e_requestor_t * requestor = GLOBUS_NULL; GlobusXIOName(globus_l_xio_mode_e_read_cb); GlobusXIOModeEDebugEnter(); connection_handle = (globus_l_xio_mode_e_connection_handle_t *) user_arg; op = connection_handle->requestor->op; globus_xio_operation_disable_cancel(op); handle = connection_handle->mode_e_handle; globus_fifo_init(&requestor_q); offset = connection_handle->outstanding_data_offset; if (connection_handle->iovec_index != -1) { iovec[connection_handle->iovec_index].iov_len = connection_handle->iovec_index_len; connection_handle->iovec_index = -1; } globus_mutex_lock(&handle->mutex); globus_memory_push_node( &handle->requestor_memory, (void*)connection_handle->requestor); if (result == GLOBUS_SUCCESS) { connection_handle->outstanding_data_len -= nbytes; if (connection_handle->outstanding_data_len > 0) { connection_handle->outstanding_data_offset += nbytes; requestor = globus_l_xio_mode_e_process_outstanding_data( connection_handle); } else if (connection_handle->eod) { eof = globus_l_xio_mode_e_process_eod( connection_handle, &requestor_q); if (eof) { globus_xio_driver_set_eof_received(op); res = GlobusXIOErrorEOF(); if (handle->state == GLOBUS_XIO_MODE_E_OPEN) { handle->state = GLOBUS_XIO_MODE_E_EOF_DELIVERED; } } } else { result = globus_i_xio_mode_e_register_read_header( connection_handle); if (result != GLOBUS_SUCCESS) { goto error; } } } else { while (!globus_fifo_empty(&handle->io_q)) { requestor = (globus_i_xio_mode_e_requestor_t*) globus_fifo_dequeue(&handle->io_q); globus_fifo_enqueue(&requestor_q, requestor); } goto error; } globus_mutex_unlock(&handle->mutex); globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_SET_OFFSET, offset); globus_xio_driver_finished_read(op, res, nbytes); if (requestor) { globus_xio_operation_disable_cancel(requestor->op); op = requestor->op; globus_memory_push_node(&handle->requestor_memory, (void*)requestor); globus_xio_driver_finished_read(op, GLOBUS_SUCCESS, 0); } while (!globus_fifo_empty(&requestor_q)) { requestor = (globus_i_xio_mode_e_requestor_t*) globus_fifo_dequeue(&requestor_q); globus_xio_operation_disable_cancel(requestor->op); op = requestor->op; globus_memory_push_node(&handle->requestor_memory, (void*)requestor); globus_xio_driver_finished_read(op, res, 0); } globus_fifo_destroy(&requestor_q); GlobusXIOModeEDebugExit(); return; error: globus_l_xio_mode_e_save_error(handle, result); globus_mutex_unlock(&handle->mutex); while (!globus_fifo_empty(&requestor_q)) { requestor = (globus_i_xio_mode_e_requestor_t*) globus_fifo_dequeue(&requestor_q); globus_xio_operation_disable_cancel(requestor->op); op = requestor->op; globus_memory_push_node(&handle->requestor_memory, (void*)requestor); globus_xio_driver_finished_read(op, result, 0); } GlobusXIOModeEDebugExitWithError(); return; } /* called locked */ static globus_result_t globus_i_xio_mode_e_register_read( globus_l_xio_mode_e_connection_handle_t * connection_handle) { globus_size_t iovec_len; globus_result_t result; globus_xio_iovec_t * iovec; int iovec_count; GlobusXIOName(globus_i_xio_mode_e_register_read); GlobusXIOModeEDebugEnter(); iovec = connection_handle->requestor->iovec; iovec_count = connection_handle->requestor->iovec_count; GlobusXIOUtilIovTotalLength(iovec_len, iovec, iovec_count); /* * Upto iovec_len amount of data would be read from the channel. If * iovec_len > outstanding_data_len, this read might possibly get the next * header that has arrived on this channel. So I modify iovec (and later * restore in the read_cb) such that the amount of data read would be * min(outstanding_data_len, iovec_len) */ if (connection_handle->outstanding_data_len < iovec_len) { globus_size_t size = 0; int i; iovec_len = connection_handle->outstanding_data_len; for (i = 0; i < iovec_count; i++) { size += iovec[i].iov_len; if (size > iovec_len) { connection_handle->iovec_index = i; iovec_count = i + 1; connection_handle->iovec_index_len = iovec[i].iov_len; iovec[i].iov_len -= (size - iovec_len); break; } } } result = globus_xio_register_readv( connection_handle->xio_handle, (globus_xio_iovec_t*)iovec, iovec_count, iovec_len, NULL, globus_l_xio_mode_e_read_cb, connection_handle); GlobusXIOModeEDebugExit(); return result; } /* called locked */ static void globus_l_xio_mode_e_reset_connections( globus_l_xio_mode_e_handle_t * handle) { globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_reset_connections); GlobusXIOModeEDebugEnter(); handle->eod_count = -1; handle->eods_received = 0; while (!globus_fifo_empty(&handle->eod_q)) { connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_fifo_dequeue(&handle->eod_q); result = globus_i_xio_mode_e_register_read_header(connection_handle); if (result != GLOBUS_SUCCESS) { goto error; } } handle->state = GLOBUS_XIO_MODE_E_OPEN; GlobusXIOModeEDebugExit(); return; error: globus_l_xio_mode_e_save_error(handle, result); GlobusXIOModeEDebugExitWithError(); return; } static globus_result_t globus_l_xio_mode_e_read( void * driver_specific_handle, const globus_xio_iovec_t* iovec, int iovec_count, globus_xio_operation_t op) { globus_l_xio_mode_e_handle_t * handle; globus_i_xio_mode_e_requestor_t * requestor; globus_l_xio_mode_e_attr_t * dd = GLOBUS_NULL; globus_result_t result; globus_size_t wait_for; globus_bool_t finish = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_mode_e_read); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) driver_specific_handle; wait_for = globus_xio_operation_get_wait_for(op); if (wait_for > 1) { result = GlobusXIOErrorParameter("Waitforbytes"); goto error_wait_for; } else if (wait_for == 0 && !handle->attr->offset_reads) { result = GlobusXIOErrorParameter( "Waitforbytes cant be zero. Offset reads not set on attr"); goto error_wait_for; } if (handle->attr->offset_reads) { dd = (globus_l_xio_mode_e_attr_t *) globus_xio_operation_get_data_descriptor(op, GLOBUS_FALSE); if (!dd) { result = GlobusXIOErrorParameter("data_descriptor"); goto error_dd; } } requestor = (globus_i_xio_mode_e_requestor_t *) globus_memory_pop_node(&handle->requestor_memory); requestor->op = op; requestor->iovec = (globus_xio_iovec_t*)iovec; requestor->iovec_count = iovec_count; requestor->dd = dd; requestor->handle = handle; requestor->xio_handle = GLOBUS_NULL; if (globus_xio_operation_enable_cancel( op, globus_l_xio_mode_e_cancel_cb, requestor)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } globus_mutex_lock(&handle->mutex); if (globus_xio_operation_is_canceled(op)) { result = GlobusXIOErrorCanceled(); goto error_operation_canceled; } switch (handle->state) { case GLOBUS_XIO_MODE_E_EOF_RECEIVED: globus_xio_driver_set_eof_received(op); handle->state = GLOBUS_XIO_MODE_E_EOF_DELIVERED; globus_memory_push_node( &handle->requestor_memory, (void*)requestor); result = GlobusXIOErrorEOF(); finish = GLOBUS_TRUE; break; case GLOBUS_XIO_MODE_E_EOF_DELIVERED: if (globus_xio_driver_eof_received(op) || handle->connection_count == 0) { globus_memory_push_node( &handle->requestor_memory, (void*)requestor); result = GlobusXIOErrorEOF(); finish = GLOBUS_TRUE; break; } else { globus_l_xio_mode_e_reset_connections(handle); /* * connection_q will be empty at this point. I let this * fall through to enqueue the request in the io_q */ } /* fall through */ case GLOBUS_XIO_MODE_E_OPEN: if (globus_fifo_empty(&handle->connection_q)) { globus_fifo_enqueue(&handle->io_q, requestor); } else { globus_l_xio_mode_e_connection_handle_t * connection_handle; if (wait_for == 0) { globus_memory_push_node( &handle->requestor_memory, (void*)requestor); connection_handle = (globus_l_xio_mode_e_connection_handle_t*) globus_fifo_dequeue(&handle->connection_q); globus_hashtable_insert( &handle->offset_ht, (void *)&connection_handle->outstanding_data_offset, (void *)connection_handle); dd->offset = connection_handle->outstanding_data_offset; result = GLOBUS_SUCCESS; finish = GLOBUS_TRUE; } else { if (handle->attr->offset_reads) { connection_handle = (globus_l_xio_mode_e_connection_handle_t*) globus_hashtable_remove( &handle->offset_ht, &dd->offset); if (!connection_handle) { result = GlobusXIOErrorParameter("Invalid offset"); goto error_offset; } } else { connection_handle = (globus_l_xio_mode_e_connection_handle_t*) globus_fifo_dequeue(&handle->connection_q); } connection_handle->requestor = requestor; requestor->xio_handle = connection_handle->xio_handle; globus_i_xio_mode_e_register_read(connection_handle); } } break; case GLOBUS_XIO_MODE_E_ERROR: result = globus_error_put(globus_object_copy(handle->error)); goto error_invalid_state; default: result = GlobusXIOErrorInvalidState(handle->state); goto error_invalid_state; } globus_mutex_unlock(&handle->mutex); if (finish) { globus_xio_operation_disable_cancel(op); globus_xio_driver_finished_read(op, result, 0); } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_invalid_state: error_offset: error_operation_canceled: globus_mutex_unlock(&handle->mutex); globus_xio_operation_disable_cancel(op); error_cancel_enable: globus_memory_push_node(&handle->requestor_memory, (void*)requestor); error_dd: error_wait_for: GlobusXIOModeEDebugExitWithError(); return result; } static void globus_l_xio_mode_e_write_cb( globus_xio_handle_t xio_handle, globus_result_t result, globus_xio_iovec_t * iovec, int count, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg) { globus_result_t requestor_result; globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_l_xio_mode_e_handle_t * handle; globus_xio_operation_t op; globus_xio_operation_t requestor_op; globus_off_t offset; globus_off_t requestor_offset; globus_bool_t finish = GLOBUS_TRUE; globus_bool_t finish_next = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_mode_e_write_cb); GlobusXIOModeEDebugEnter(); connection_handle = (globus_l_xio_mode_e_connection_handle_t *) user_arg; handle = connection_handle->mode_e_handle; op = connection_handle->requestor->op; /* push_node has its own lock. so need for lock before this call */ globus_memory_push_node( &handle->requestor_memory, (void*)connection_handle->requestor); offset = connection_handle->outstanding_data_offset; globus_mutex_lock(&handle->mutex); if (result != GLOBUS_SUCCESS) { requestor_result = result; goto error; } if (!globus_fifo_empty(&handle->io_q)) { globus_i_xio_mode_e_requestor_t * requestor; requestor = (globus_i_xio_mode_e_requestor_t *) globus_fifo_dequeue(&handle->io_q); connection_handle->requestor = requestor; requestor_result = globus_i_xio_mode_e_register_write( connection_handle); if (requestor_result != GLOBUS_SUCCESS) { requestor_op = requestor->op; requestor_offset = connection_handle->outstanding_data_offset; finish_next = GLOBUS_TRUE; globus_memory_push_node( &handle->requestor_memory, (void*)requestor); goto error_register_write; } } else { if (handle->state == GLOBUS_XIO_MODE_E_SENDING_EOD) { globus_byte_t descriptor; /* * I'll get this cb with eod_sent == TRUE for one connection alone * and I send EOF (if need be) on this connection alone. If I dont * need to send EOF and eods_sent == connection_count, I need to * finish the write (that had SEND_EOD set on dd) */ if (!connection_handle->eod) { descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD; requestor_result = globus_l_xio_mode_e_register_eod( connection_handle, descriptor); if (requestor_result != GLOBUS_SUCCESS) { goto error_register_eod; } } else { connection_handle->eod = GLOBUS_FALSE; if (handle->eod_count > -1) { descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF; requestor_result = globus_l_xio_mode_e_register_eod( connection_handle, descriptor); if (requestor_result != GLOBUS_SUCCESS) { goto error_register_eod; } } else { globus_fifo_enqueue( &handle->connection_q, connection_handle); if (handle->eods_sent < handle->connection_count) { finish = GLOBUS_FALSE; } } } } else { globus_fifo_enqueue(&handle->connection_q, connection_handle); } } globus_mutex_unlock(&handle->mutex); if (finish) { globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_SET_OFFSET, offset); globus_xio_driver_finished_write(op, result, nbytes); } GlobusXIOModeEDebugExit(); return; error_register_eod: error_register_write: error: globus_fifo_enqueue(&handle->connection_q, connection_handle); globus_l_xio_mode_e_save_error(handle, result); globus_mutex_unlock(&handle->mutex); if (finish_next) { globus_xio_driver_data_descriptor_cntl( requestor_op, NULL, GLOBUS_XIO_DD_SET_OFFSET, requestor_offset); globus_xio_driver_finished_write(requestor_op, requestor_result, 0); } globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_SET_OFFSET, offset); globus_xio_driver_finished_write(op, result, nbytes); GlobusXIOModeEDebugExitWithError(); return; } static void globus_l_xio_mode_e_write_header_cb( globus_xio_handle_t xio_handle, globus_result_t result, globus_byte_t * buffer, globus_size_t len, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg) { globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_l_xio_mode_e_handle_t * handle; globus_l_xio_mode_e_header_t * header; const globus_xio_iovec_t * iovec; int iovec_count; globus_size_t iovec_len; globus_xio_operation_t op; globus_off_t offset; globus_bool_t finish = GLOBUS_FALSE; globus_result_t res; GlobusXIOName(globus_l_xio_mode_e_write_header_cb); GlobusXIOModeEDebugEnter(); connection_handle = (globus_l_xio_mode_e_connection_handle_t *) user_arg; handle = connection_handle->mode_e_handle; header = (globus_l_xio_mode_e_header_t *) buffer; globus_xio_operation_disable_cancel(connection_handle->requestor->op); globus_mutex_lock(&handle->mutex); if (result == GLOBUS_SUCCESS) { /* * if handle->eod_count != -1, then register_eod will be called (either * in here or in write_cb) to send EOF and eods_sent will be * incremented in eod_cb */ if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD && handle->eod_count == -1) { ++handle->eods_sent; } globus_memory_push_node(&handle->header_memory, (void*)header); if (connection_handle->requestor->iovec) { iovec = connection_handle->requestor->iovec; iovec_count = connection_handle->requestor->iovec_count; GlobusXIOUtilIovTotalLength(iovec_len, iovec, iovec_count); res = globus_xio_register_writev( connection_handle->xio_handle, (globus_xio_iovec_t*)iovec, iovec_count, iovec_len, GLOBUS_NULL, globus_l_xio_mode_e_write_cb, connection_handle); if (res != GLOBUS_SUCCESS) { goto error; } } else if (handle->eod_count > -1) { globus_byte_t descriptor; /* * handle->iovec can be NULL only when the user sets SEND_EOD * on the dd. So I just wrote EOD on this channel and now i check * to see if i need to send EOF */ descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF; res = globus_l_xio_mode_e_register_eod( connection_handle, descriptor); if (res != GLOBUS_SUCCESS) { goto error; } } else { globus_fifo_enqueue(&handle->connection_q, connection_handle); if (handle->eods_sent == handle->connection_count) { /* * user is allowed to do a write with buffer = NULL and * SEND_EOD set on dd */ handle->state = GLOBUS_XIO_MODE_E_OPEN; handle->eod_count = -1; handle->attr->eod_count = -1; handle->offset = 0; finish = GLOBUS_TRUE; /* * handle->eod_offset also has same value. if i have to finish * in eod_cb, connection_handle->outstanding_data_offset cant * be used coz i dont know which connection_handle is * associated with the user_write (that had SEND_EOD set). */ offset = connection_handle->outstanding_data_offset; /* the op is stored in handle->outstanding_op too */ op = connection_handle->requestor->op; globus_memory_push_node( &handle->requestor_memory, (void*)connection_handle->requestor); } } } else { globus_memory_push_node(&handle->header_memory, (void*)header); res = result; goto error; } globus_mutex_unlock(&handle->mutex); if (finish) { globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_SET_OFFSET, offset); globus_xio_driver_finished_write(op, result, 0); } GlobusXIOModeEDebugExit(); return; error: globus_l_xio_mode_e_save_error(handle, res); op = connection_handle->requestor->op; globus_memory_push_node( &handle->requestor_memory, (void*)connection_handle->requestor); globus_fifo_enqueue(&handle->connection_q, connection_handle); globus_mutex_unlock(&handle->mutex); globus_xio_driver_finished_write(op, res, 0); GlobusXIOModeEDebugExitWithError(); return; } /* called locked */ static globus_result_t globus_i_xio_mode_e_register_write( globus_l_xio_mode_e_connection_handle_t * connection_handle) { globus_l_xio_mode_e_handle_t * handle; globus_off_t size; globus_off_t offset; globus_l_xio_mode_e_header_t * header; globus_size_t header_size; globus_result_t result; GlobusXIOName(globus_i_xio_mode_e_register_write); GlobusXIOModeEDebugEnter(); handle = connection_handle->mode_e_handle; header = (globus_l_xio_mode_e_header_t *) globus_memory_pop_node( &handle->header_memory); header_size = sizeof(globus_l_xio_mode_e_header_t); memset(header, 0, header_size); GlobusXIOUtilIovTotalLength( size, connection_handle->requestor->iovec, connection_handle->requestor->iovec_count); globus_i_xio_mode_e_header_encode(header->count, size); result = globus_xio_driver_data_descriptor_cntl( connection_handle->requestor->op, NULL, GLOBUS_XIO_DD_GET_OFFSET, &offset); if (result != GLOBUS_SUCCESS || offset == -1) { offset = handle->offset; } if (handle->state == GLOBUS_XIO_MODE_E_SENDING_EOD && globus_fifo_empty(&handle->io_q)) { header->descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD; handle->eod_offset = offset; } globus_i_xio_mode_e_header_encode(header->offset, offset); connection_handle->outstanding_data_offset = offset; offset += size; if (offset > handle->offset) { handle->offset = offset; } result = globus_xio_register_write( connection_handle->xio_handle, (globus_byte_t*)header, header_size, header_size, GLOBUS_NULL, globus_l_xio_mode_e_write_header_cb, connection_handle); if (result != GLOBUS_SUCCESS) { goto error; } if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD) { connection_handle->eod = GLOBUS_TRUE; } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_write( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_xio_mode_e_handle_t * handle; globus_i_xio_mode_e_requestor_t * requestor; globus_l_xio_mode_e_attr_t * dd; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_write); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) driver_specific_handle; /* * Mode E is unidirectional. Server can only read and client can only write */ globus_assert(handle->server == GLOBUS_NULL); dd = (globus_l_xio_mode_e_attr_t *) globus_xio_operation_get_data_descriptor(op, GLOBUS_FALSE); requestor = (globus_i_xio_mode_e_requestor_t *) globus_memory_pop_node(&handle->requestor_memory); requestor->op = op; requestor->iovec = (globus_xio_iovec_t*)iovec; requestor->iovec_count = iovec_count; requestor->dd = dd; requestor->handle = handle; requestor->xio_handle = GLOBUS_NULL; if (globus_xio_operation_enable_cancel( op, globus_l_xio_mode_e_cancel_cb, requestor)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } globus_mutex_lock(&handle->mutex); if (globus_xio_operation_is_canceled(op)) { result = GlobusXIOErrorCanceled(); goto error_operation_canceled; } switch (handle->state) { case GLOBUS_XIO_MODE_E_OPEN: /* * I reset eods_sent here (and not right after i send all the eods) * coz i use 'eods_sent == connection_count' in close to check if * eods have been sent or not */ if (handle->eods_sent == handle->connection_count) { handle->eods_sent = 0; } if (handle->eof_sent) { handle->eof_sent = GLOBUS_FALSE; } if (dd && dd->send_eod) { handle->state = GLOBUS_XIO_MODE_E_SENDING_EOD; handle->outstanding_op = op; if (!handle->attr->manual_eodc) { handle->eod_count = handle->connection_count; } else if (dd->eod_count > -1) { handle->eod_count = dd->eod_count; } } if (!globus_fifo_empty(&handle->connection_q)) { globus_l_xio_mode_e_connection_handle_t * connection_handle; connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_fifo_dequeue(&handle->connection_q); connection_handle->requestor = requestor; requestor->xio_handle = connection_handle->xio_handle; result = globus_i_xio_mode_e_register_write(connection_handle); if (result != GLOBUS_SUCCESS) { goto error_register_write; } if (handle->state == GLOBUS_XIO_MODE_E_SENDING_EOD) { globus_byte_t descriptor; descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD; while (!globus_fifo_empty(&handle->connection_q)) { connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_fifo_dequeue(&handle->connection_q); globus_l_xio_mode_e_register_eod( connection_handle, descriptor); } } } else { if (handle->connection_count < handle->attr->max_connection_count) { result = globus_l_xio_mode_e_open_new_stream( handle, globus_i_xio_mode_e_open_cb); if (result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_mode_e_open_new_stream", result); goto error_open_new_stream; } } globus_fifo_enqueue(&handle->io_q, requestor); } break; case GLOBUS_XIO_MODE_E_ERROR: result = globus_error_put(globus_object_copy(handle->error)); goto error_invalid_state; default: result = GlobusXIOErrorInvalidState(handle->state); goto error_invalid_state; } globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_invalid_state: error_open_new_stream: error_register_write: error_operation_canceled: globus_mutex_unlock(&handle->mutex); globus_xio_operation_disable_cancel(op); error_cancel_enable: globus_memory_push_node(&handle->requestor_memory, (void*)requestor); GlobusXIOModeEDebugExitWithError(); return result; } static void globus_l_xio_mode_e_close_cb( globus_xio_handle_t xio_handle, globus_result_t result, void * user_arg) { globus_l_xio_mode_e_handle_t * handle; globus_bool_t finish = GLOBUS_FALSE; globus_bool_t destroy = GLOBUS_FALSE; globus_xio_operation_t op; GlobusXIOName(globus_l_xio_mode_e_close_cb); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *)user_arg; globus_mutex_lock(&handle->mutex); if (result != GLOBUS_SUCCESS) { goto error; } if(globus_error_match( globus_error_peek(result), GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_CANCELED)) { ++handle->close_count; if (handle->close_count == handle->connection_count) { finish = GLOBUS_TRUE; handle->state = GLOBUS_XIO_MODE_E_NONE; op = handle->outstanding_op; } } else { if (!globus_list_empty(handle->close_list)) { globus_list_remove( &handle->close_list, globus_list_search(handle->close_list, xio_handle)); } } if (--handle->connection_count == 0) { switch (handle->state) { case GLOBUS_XIO_MODE_E_CLOSING: finish = GLOBUS_TRUE; handle->state = GLOBUS_XIO_MODE_E_NONE; op = handle->outstanding_op; if (--handle->ref_count == 0) { destroy = GLOBUS_TRUE; } break; case GLOBUS_XIO_MODE_E_EOF_RECEIVED: case GLOBUS_XIO_MODE_E_EOF_DELIVERED: break; default: globus_assert(0 && "Unexpected state in mode_e_close_cb"); } } globus_mutex_unlock(&handle->mutex); if (finish) { globus_xio_operation_disable_cancel(op); if (destroy) { globus_l_xio_mode_e_handle_destroy(handle); } globus_xio_driver_finished_close(op, result); } GlobusXIOModeEDebugExit(); return; error: globus_l_xio_mode_e_save_error(handle, result); globus_mutex_unlock(&handle->mutex); GlobusXIOModeEDebugExitWithError(); return; } static void globus_l_xio_mode_e_write_eod_cb( globus_xio_handle_t xio_handle, globus_result_t result, globus_byte_t * buffer, globus_size_t len, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void * user_arg) { globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_l_xio_mode_e_handle_t * handle; globus_l_xio_mode_e_header_t * header; globus_xio_operation_t op; globus_off_t offset; globus_bool_t finish = GLOBUS_FALSE; globus_bool_t finish_close = GLOBUS_FALSE; globus_result_t res; GlobusXIOName(globus_l_xio_mode_e_write_eod_cb); GlobusXIOModeEDebugEnter(); connection_handle = (globus_l_xio_mode_e_connection_handle_t *) user_arg; header = (globus_l_xio_mode_e_header_t *) buffer; handle = connection_handle->mode_e_handle; globus_mutex_lock(&handle->mutex); if (result != GLOBUS_SUCCESS) { res = result; goto error; } ++handle->eods_sent; /* * If CLOSE is set on header, then it implies that user has called * close and I allow users to cancel close until all the channels are * closed */ if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_CLOSE) { /* I dont register_close, if user has canceled the close already */ if (!globus_error_match( globus_error_peek(result), GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_CANCELED)) { res = globus_xio_register_close( connection_handle->xio_handle, handle->attr->xio_attr, globus_l_xio_mode_e_close_cb, handle); if (res != GLOBUS_SUCCESS) { goto error_close; } globus_list_insert( &handle->close_list, connection_handle->xio_handle); /* * If it was canceled, then the xio_handle would have been removed * from the eod_list before the canceling the write eod. So I do * not have to this removal in the else below. */ globus_list_remove( &handle->eod_list, globus_list_search( handle->eod_list, connection_handle->xio_handle)); } else { ++handle->close_count; if (handle->close_count == handle->connection_count) { finish_close = GLOBUS_TRUE; op = handle->outstanding_op; } } globus_free(connection_handle); } else { /* * getting here implies that register_eod (associated with this cb) is * called in response to the dd 'SEND_EOD' on write */ if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF) { handle->eof_sent = GLOBUS_TRUE; } globus_fifo_enqueue(&handle->connection_q, connection_handle); if (handle->eods_sent == handle->connection_count) { handle->state = GLOBUS_XIO_MODE_E_OPEN; handle->eod_count = -1; handle->attr->eod_count = -1; handle->offset = 0; op = handle->outstanding_op; offset = handle->eod_offset; finish = GLOBUS_TRUE; } if (!globus_error_match( globus_error_peek(result), GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_CANCELED)) { globus_list_remove( &handle->eod_list, globus_list_search( handle->eod_list, connection_handle->xio_handle)); } } globus_memory_push_node(&handle->header_memory, (void*)header); globus_mutex_unlock(&handle->mutex); if (finish) { globus_xio_operation_disable_cancel(op); globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_SET_OFFSET, offset); globus_xio_driver_finished_write(op, result, 0); } if (finish_close) { globus_xio_driver_finished_close(op, result); } GlobusXIOModeEDebugExit(); return; error_close: error: globus_l_xio_mode_e_save_error(handle, res); globus_mutex_unlock(&handle->mutex); globus_memory_push_node(&handle->header_memory, (void*)header); GlobusXIOModeEDebugExitWithError(); return; } /* called locked */ static globus_result_t globus_l_xio_mode_e_register_eod( globus_l_xio_mode_e_connection_handle_t * connection_handle, globus_byte_t descriptor) { globus_l_xio_mode_e_handle_t * handle; globus_l_xio_mode_e_header_t * header; globus_size_t header_size; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_register_eod); GlobusXIOModeEDebugEnter(); handle = connection_handle->mode_e_handle; header = (globus_l_xio_mode_e_header_t *) globus_memory_pop_node(&handle->header_memory); header_size = sizeof(globus_l_xio_mode_e_header_t); memset(header, 0, header_size); header->descriptor = descriptor; if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF) { globus_i_xio_mode_e_header_encode( header->offset, handle->eod_count); } result = globus_xio_register_write( connection_handle->xio_handle, (globus_byte_t*)header, header_size, header_size, GLOBUS_NULL, globus_l_xio_mode_e_write_eod_cb, connection_handle); if (result != GLOBUS_SUCCESS) { goto error; } /* this is eod_list is for canceling the eod writes */ globus_list_insert(&handle->eod_list, connection_handle->xio_handle); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error: globus_memory_push_node(&handle->header_memory, (void*)header); GlobusXIOModeEDebugExitWithError(); return result; } static void globus_l_xio_mode_e_close_connections( globus_l_xio_mode_e_handle_t * handle) { globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_l_xio_mode_e_connection_handle_t * idle_connection_handle; GlobusXIOName(globus_l_xio_mode_e_close_connections); GlobusXIOModeEDebugEnter(); /* * handle->connection_list contains all the connections whereas the q's * (connection_q, eod_q contain only those connections that are free (idle) */ while (!globus_list_empty(handle->connection_list)) { connection_handle = globus_list_remove( &handle->connection_list, handle->connection_list); idle_connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_fifo_remove(&handle->connection_q, connection_handle); if (!idle_connection_handle) { idle_connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_fifo_remove(&handle->eod_q, connection_handle); } if (idle_connection_handle) { /* connection_handle and idle_connection_handle are same here */ globus_xio_register_close( connection_handle->xio_handle, NULL, globus_l_xio_mode_e_close_cb, connection_handle->mode_e_handle); globus_list_insert( &handle->close_list, connection_handle->xio_handle); globus_free(connection_handle); } else { globus_xio_handle_cancel_operations( connection_handle->xio_handle, GLOBUS_XIO_CANCEL_READ); } } GlobusXIOModeEDebugExit(); } static globus_result_t globus_l_xio_mode_e_close( void * driver_specific_handle, void * driver_attr, globus_xio_operation_t op) { globus_l_xio_mode_e_handle_t * handle; globus_l_xio_mode_e_connection_handle_t * connection_handle; globus_i_xio_mode_e_requestor_t * requestor; globus_l_xio_mode_e_attr_t * attr; globus_result_t result; globus_bool_t finish = GLOBUS_FALSE; globus_bool_t destroy = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_mode_e_close); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) driver_specific_handle; attr = (globus_l_xio_mode_e_attr_t *) driver_attr ? driver_attr : handle->attr; requestor = (globus_i_xio_mode_e_requestor_t *) globus_memory_pop_node(&handle->requestor_memory); requestor->handle = handle; requestor->op = op; if (globus_xio_operation_enable_cancel( op, globus_l_xio_mode_e_cancel_cb, requestor)) { result = GlobusXIOErrorCanceled(); goto error_cancel_enable; } globus_mutex_lock(&handle->mutex); if (globus_xio_operation_is_canceled(op)) { result = GlobusXIOErrorCanceled(); goto error_operation_canceled; } handle->outstanding_op = op; if (!handle->server) { globus_byte_t descriptor; descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_CLOSE; handle->state = GLOBUS_XIO_MODE_E_CLOSING; /* this implies eods are not sent yet */ if (handle->eods_sent != handle->connection_count) { descriptor |= GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD; } if (!handle->attr->manual_eodc) { handle->eod_count = handle->connection_count; } else if (attr->eod_count > -1) { handle->eod_count = attr->eod_count; } if (!handle->eof_sent && handle->eod_count > -1) { connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_fifo_dequeue(&handle->connection_q); descriptor |= GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF; result = globus_l_xio_mode_e_register_eod( connection_handle, descriptor); if (result != GLOBUS_SUCCESS) { goto error_register_eod; } descriptor &= ~GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF; } while (!globus_fifo_empty(&handle->connection_q)) { connection_handle = (globus_l_xio_mode_e_connection_handle_t *) globus_fifo_dequeue(&handle->connection_q); result = globus_l_xio_mode_e_register_eod( connection_handle, descriptor); if (result != GLOBUS_SUCCESS) { goto error_register_eod; } } } else { if (handle->connection_count == 0) { finish = GLOBUS_TRUE; if (--handle->ref_count == 0) { destroy = GLOBUS_TRUE; } } else { globus_l_xio_mode_e_close_connections(handle); handle->state = GLOBUS_XIO_MODE_E_CLOSING; } } globus_mutex_unlock(&handle->mutex); if (finish) { if (destroy) { globus_l_xio_mode_e_handle_destroy(handle); } globus_xio_driver_finished_close(op, GLOBUS_SUCCESS); } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_register_eod: error_operation_canceled: globus_mutex_unlock(&handle->mutex); globus_xio_operation_disable_cancel(op); error_cancel_enable: globus_memory_push_node(&handle->requestor_memory, (void*)requestor); GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_cntl( void * driver_specific_handle, int cmd, va_list ap) { globus_l_xio_mode_e_handle_t * handle; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_cntl); GlobusXIOModeEDebugEnter(); handle = (globus_l_xio_mode_e_handle_t *) driver_specific_handle; switch(cmd) { case GLOBUS_XIO_MODE_E_SET_EODC: if (handle->attr->manual_eodc) { if (handle->state == GLOBUS_XIO_MODE_E_OPEN) { handle->eod_count = va_arg(ap, int); } else { result = GlobusXIOErrorInvalidState(handle->state); goto error; } } else { result = GlobusXIOErrorInvalidCommand(cmd); } break; case GLOBUS_XIO_MODE_E_ERROR: result = globus_error_put(globus_object_copy(handle->error)); goto error; default: result = GlobusXIOErrorInvalidCommand(cmd); goto error; } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_attr_init( void ** out_attr) { globus_l_xio_mode_e_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_attr_init); GlobusXIOModeEDebugEnter(); /* * create a mode_e attr structure and intialize its values */ attr = (globus_l_xio_mode_e_attr_t *) globus_malloc(sizeof(globus_l_xio_mode_e_attr_t)); if(!attr) { result = GlobusXIOErrorMemory("attr"); goto error_attr; } memcpy(attr, &globus_l_xio_mode_e_attr_default, sizeof(globus_l_xio_mode_e_attr_t)); *out_attr = attr; GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_attr: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_attr_cntl( void * driver_attr, int cmd, va_list ap) { globus_result_t result; globus_l_xio_mode_e_attr_t * attr; GlobusXIOName(globus_l_xio_mode_e_attr_cntl); GlobusXIOModeEDebugEnter(); attr = (globus_l_xio_mode_e_attr_t *) driver_attr; switch(cmd) { case GLOBUS_XIO_MODE_E_SET_STACK: { /* globus_xio_stack_t is a pointer to a struct */ globus_xio_stack_t stack; stack = va_arg(ap, globus_xio_stack_t); globus_xio_stack_copy(&attr->stack, stack); break; } case GLOBUS_XIO_MODE_E_GET_STACK: { globus_xio_stack_t * stack_out = va_arg(ap, globus_xio_stack_t *); *stack_out = attr->stack; break; } case GLOBUS_XIO_MODE_E_SET_NUM_STREAMS: attr->max_connection_count = va_arg(ap, int); break; case GLOBUS_XIO_MODE_E_GET_NUM_STREAMS: { int * max_connection_count_out = va_arg(ap, int*); *max_connection_count_out = attr->max_connection_count; break; } case GLOBUS_XIO_MODE_E_SET_OFFSET_READS: attr->offset_reads = va_arg(ap, globus_bool_t); break; case GLOBUS_XIO_MODE_E_GET_OFFSET_READS: { globus_bool_t * offset_reads_out = va_arg(ap, globus_bool_t*); *offset_reads_out = attr->offset_reads; break; } case GLOBUS_XIO_MODE_E_SET_MANUAL_EODC: attr->manual_eodc = va_arg(ap, globus_bool_t); break; case GLOBUS_XIO_MODE_E_GET_MANUAL_EODC: { globus_bool_t * manual_eodc_out = va_arg(ap, globus_bool_t*); *manual_eodc_out = attr->manual_eodc; break; } case GLOBUS_XIO_MODE_E_SEND_EOD: attr->send_eod = va_arg(ap, globus_bool_t); break; case GLOBUS_XIO_MODE_E_SET_EODC: attr->eod_count = va_arg(ap, int); break; case GLOBUS_XIO_MODE_E_DD_GET_OFFSET: { globus_off_t * offset_out = va_arg(ap, globus_off_t *); *offset_out = attr->offset; break; } case GLOBUS_XIO_MODE_E_SET_STACK_ATTR: { globus_xio_attr_t in_attr; in_attr = va_arg(ap, globus_xio_attr_t); if(attr->xio_attr != NULL) { globus_xio_attr_destroy(attr->xio_attr); } globus_xio_attr_copy(&attr->xio_attr, in_attr); break; } case GLOBUS_XIO_MODE_E_GET_STACK_ATTR: { globus_xio_attr_t * out_attr; out_attr = va_arg(ap, globus_xio_attr_t *); if(out_attr != NULL) /* jsut in case user is dumb */ { *out_attr = attr->xio_attr; } break; } default: result = GlobusXIOErrorInvalidCommand(cmd); goto error; } GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_attr_copy( void ** dst, void * src) { globus_l_xio_mode_e_attr_t * src_attr; globus_l_xio_mode_e_attr_t * dst_attr; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_attr_copy); GlobusXIOModeEDebugEnter(); dst_attr = (globus_l_xio_mode_e_attr_t *) globus_malloc(sizeof(globus_l_xio_mode_e_attr_t)); if(!dst_attr) { result = GlobusXIOErrorMemory("attr"); goto error_dst_attr; } src_attr = (globus_l_xio_mode_e_attr_t *) src; memcpy(dst_attr, src_attr, sizeof(globus_l_xio_mode_e_attr_t)); if(src_attr->stack != NULL) { globus_xio_stack_copy(&dst_attr->stack, src_attr->stack); } if(src_attr->xio_attr != NULL) { globus_xio_attr_copy(&dst_attr->xio_attr, src_attr->xio_attr); } /* * if there is any ptr in the attr structure do attr->xptr = * globus_libc_strdup(attr->xptr) and do if (!attr->xptr) { result = * GlobusXIOErrorMemory("xptr"); goto error_xptr; } */ *dst = dst_attr; GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_dst_attr: GlobusXIOModeEDebugExitWithError(); return result; } static globus_result_t globus_l_xio_mode_e_attr_destroy( void * driver_attr) { globus_l_xio_mode_e_attr_t * attr; GlobusXIOName(globus_l_xio_mode_e_attr_destroy); GlobusXIOModeEDebugEnter(); attr = (globus_l_xio_mode_e_attr_t *) driver_attr; globus_free(attr); GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_mode_e_init( globus_xio_driver_t * out_driver) { globus_xio_driver_t driver; globus_result_t result; GlobusXIOName(globus_l_xio_mode_e_init); GlobusXIOModeEDebugEnter(); result = globus_xio_driver_init(&driver, "mode_e", GLOBUS_NULL); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_driver_init", result); goto error_init; } globus_xio_driver_set_transport( driver, globus_l_xio_mode_e_open, globus_l_xio_mode_e_close, globus_l_xio_mode_e_read, globus_l_xio_mode_e_write, globus_l_xio_mode_e_cntl); globus_xio_driver_set_server( driver, globus_l_xio_mode_e_server_init, globus_l_xio_mode_e_server_accept, globus_l_xio_mode_e_server_destroy, globus_l_xio_mode_e_server_cntl, globus_l_xio_mode_e_link_cntl, globus_l_xio_mode_e_link_destroy); globus_xio_driver_set_attr( driver, globus_l_xio_mode_e_attr_init, globus_l_xio_mode_e_attr_copy, globus_l_xio_mode_e_attr_cntl, globus_l_xio_mode_e_attr_destroy); globus_xio_driver_string_cntl_set_table( driver, mode_e_l_string_opts_table); *out_driver = driver; GlobusXIOModeEDebugExit(); return GLOBUS_SUCCESS; error_init: GlobusXIOModeEDebugExitWithError(); return result; } static void globus_l_xio_mode_e_destroy( globus_xio_driver_t driver) { globus_xio_driver_destroy(driver); } GlobusXIODefineDriver( mode_e, globus_l_xio_mode_e_init, globus_l_xio_mode_e_destroy); globus_xio-3.6/builtins/mode_e/globus_xio_mode_e_driver.h0000666000076400007640000002222711522621710020762 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_XIO_MODE_E_DRIVER_INCLUDE #define GLOBUS_XIO_MODE_E_DRIVER_INCLUDE /** * @file * Header file for XIO MODE_E Driver */ #include "globus_common.h" /** * @defgroup mode_e_driver Globus XIO MODE_E Driver */ /** * @defgroup mode_e_driver_instance Opening/Closing * @ingroup mode_e_driver * * An XIO handle with the mode_e driver can be created with either * @ref globus_xio_handle_create() or @ref globus_xio_server_register_accept(). * * If the handle is created with @ref globus_xio_handle_create(), the contact * string passed to ref globus_xio_register_open() call must contain * a host name and service/port. The number of streams required can be * specified on the attr using @ref GLOBUS_XIO_MODE_E_SET_NUM_STREAMS (default * is one stream). The stack of drivers to be used on the streams can be * specified on the attr using @ref GLOBUS_XIO_MODE_E_SET_STACK (default is * a stack containing TCP driver). * * When the XIO handle is closed, the mode_e driver will destroy its internal * resources and close the stream(s). */ /** * @defgroup mode_e_driver_io Reading/Writing * @ingroup mode_e_driver * Mode E is unidirectional. Clients can only write and the server can only * read. * The @ref globus_xio_register_read() enforce that the waitforbytes parameter * should be one. When multiple transport streams are used between the client * and the server, data might not be delivered in order. * @ref globus_xio_data_descriptor_cntl() can be used to get the offset of the * data. * * @ref globus_xio_register_write() does not enforce any restriction on the * waitforbytes parameter. * * In any case, when an error or EOF occurs before the waitforbytes request * has been met, the outgoing nbytes is set to the amount of data actually * read/written before the error or EOF occurred. */ /** * @defgroup mode_e_driver_server Server * @ingroup mode_e_driver * * @ref globus_xio_server_create() causes a mode_e listener to be created * and listened upon. @ref globus_xio_server_register_accept() performs an * asynchronous accept(). @ref globus_xio_server_register_close() cleans up * the internal resources associated with the mode_e server. * * All accepted handles inherit all mode_e specific attributes set in the attr * to @ref globus_xio_server_create() */ /** * @defgroup mode_e_driver_envs Env Variables * @ingroup mode_e_driver * * The mode_e driver uses the following environment variable * - GLOBUS_XIO_MODE_E_DEBUG Available if using a debug build. See * globus_debug.h for format. */ /** * @defgroup mode_e_driver_cntls Attributes and Cntls * @ingroup mode_e_driver * * Mode_e driver specific attrs and cntls. * * @see globus_xio_attr_cntl() * @see globus_xio_handle_cntl() * @see globus_xio_server_cntl() * @see globus_xio_data_descriptor_cntl() */ /** * @defgroup mode_e_driver_types Types * @ingroup mode_e_driver */ /** * @defgroup mode_e_driver_errors Error Types * @ingroup mode_e_driver * * The errors reported by MODE_E driver include * GLOBUS_XIO_ERROR_COMMAND, GLOBUS_XIO_ERROR_MEMORY, GLOBUS_XIO_ERROR_STATE, * GLOBUS_XIO_ERROR_PARAMETER, GLOBUS_XIO_ERROR_EOF, * GLOBUS_XIO_ERROR_CANCELED, @ref GLOBUS_XIO_MODE_E_HEADER_ERROR * * @see globus_xio_driver_error_match() * @see globus_error_errno_match() */ /** * MODE_E driver specific error types * @ingroup mode_e_driver_errors */ typedef enum { /** * Indicates that the mode_e header is erroneous */ GLOBUS_XIO_MODE_E_HEADER_ERROR } globus_xio_mode_e_error_type_t; /** doxygen varargs filter stuff * GlobusVarArgDefine( * attr, globus_result_t, globus_xio_attr_cntl, attr, driver) * GlobusVarArgDefine( * handle, globus_result_t, globus_xio_handle_cntl, handle, driver) * GlobusVarArgDefine( * dd, globus_result_t, globus_xio_data_descriptor_cntl, dd, driver) */ /** * MODE_E driver specific cntls * @ingroup mode_e_driver_cntls */ typedef enum { /** GlobusVarArgEnum(attr) * Set the stack (of xio drivers) to be used for the connection(s). * @ingroup mode_e_driver_cntls * Do not create a new ftp client handle, use this handle instead. * * @param stack * Specifies the stack to use for the connection(s). * Note: this stack will not be destroyed. */ /* globus_xio_stack_t stack */ GLOBUS_XIO_MODE_E_SET_STACK, /** GlobusVarArgEnum(attr) * Get the stack on the attr. * @ingroup mode_e_driver_cntls * * @param stack_out * The stack will be stored here. If none is set, GLOBUS_NULL will be * set. */ /* globus_xio_stack_t * stack_out */ GLOBUS_XIO_MODE_E_GET_STACK, /** GlobusVarArgEnum(attr) * Set the number of streams to be used between the client and the * server. * @ingroup mode_e_driver_cntls * * @param num_streams * Specifies the number of streams to use. */ /* int num_streams */ GLOBUS_XIO_MODE_E_SET_NUM_STREAMS, /** GlobusVarArgEnum(attr) * Get the number of streams on the attr. * @ingroup mode_e_driver_cntls * * @param num_streams_out * The stream count will be stored here. */ /* int * num_streams_out */ GLOBUS_XIO_MODE_E_GET_NUM_STREAMS, /** GlobusVarArgEnum(attr) * Set flag to indicate whether the data read from user would always be * preceded by an offset read or not. The user can do a read with * wait_for_bytes set to zero, to find the offset of the data that he is * going to get in his next read operation * @ingroup mode_e_driver_cntls * * @param offset_reads * GLOBUS_TRUE to enable offset reads, GLOBUS_FALSE to disable * offset reads (default). */ /* globus_bool_t offset_reads */ GLOBUS_XIO_MODE_E_SET_OFFSET_READS, /** GlobusVarArgEnum(attr) * Get OFFSET_READS flag on the attr. * @ingroup mode_e_driver_cntls * * @param offset_reads_out * The OFFSET_READS flag will be stored here. */ /* globus_bool_t * offset_reads_out */ GLOBUS_XIO_MODE_E_GET_OFFSET_READS, /** GlobusVarArgEnum(attr) * Set flag to indicate whether EODC will be set manually by the user on * a data_desc or the driver has to calculate the EODC * @ingroup mode_e_driver_cntls * * @param manual_eodc * GLOBUS_TRUE to set EODC manually, GLOBUS_FALSE to not set EODC * manually (default). */ /* globus_bool_t manual_eodc */ GLOBUS_XIO_MODE_E_SET_MANUAL_EODC, /** GlobusVarArgEnum(attr) * Get MANUAL_EODC flag on the attr. * @ingroup mode_e_driver_cntls * * @param manual_eodc_out * The MANUAL_EODC flag will be stored here. */ /* globus_bool_t * manual_eodc_out */ GLOBUS_XIO_MODE_E_GET_MANUAL_EODC, /** GlobusVarArgEnum(dd) * Set SEND_EOD flag * @ingroup mode_e_driver_cntls * Used only for data descriptors to write calls. * * @param send_eod * GLOBUS_TRUE to send EOD, GLOBUS_FALSE to not send EOD (default). */ /* globus_bool_t send_eod */ GLOBUS_XIO_MODE_E_SEND_EOD, /** GlobusVarArgEnum(handle) * Set EOD count * @ingroup mode_e_driver_cntls * Used only if MANUAL_EODC flag is set to GLOBUS_TRUE. * * @param eod_count * specifies the eod count */ /* int eod_count */ GLOBUS_XIO_MODE_E_SET_EODC, /** GlobusVarArgEnum(dd) * Get offset of the next available data * @ingroup mode_e_driver_cntls * Used only if OFFSET_READS is enabled. * * @param offset_out * offset will be stored here */ /* globus_off_t * offset_out */ GLOBUS_XIO_MODE_E_DD_GET_OFFSET, /** GlobusVarArgEnum(attr) * Set the attr to be used with the stack set from * GLOBUS_XIO_MODE_E_SET_STACK. * @ingroup mode_e_driver_cntls * Do not create a new ftp client handle, use this handle instead. * * @param stack * Specifies the stack to use for the connection(s). * Note: this stack will not be destroyed. */ /* globus_xio_stack_t stack */ GLOBUS_XIO_MODE_E_SET_STACK_ATTR, /** GlobusVarArgEnum(attr) * Get the attr that will be used with the stack. This is intended for * use with GLOBUS_XIO_MODE_E_SET_STACK. * @ingroup mode_e_driver_cntls * * @param stack_out * The stack will be stored here. If none is set, GLOBUS_NULL will be * set. */ /* globus_xio_attr_t * stack_out */ GLOBUS_XIO_MODE_E_GET_STACK_ATTR } globus_xio_mode_e_cmd_t; #endif globus_xio-3.6/builtins/mode_e/Makefile.am0000666000076400007640000000077511462370274015625 00000000000000include $(top_srcdir)/globus_automake_pre Sources= \ globus_xio_mode_e_driver.c include_HEADERS = \ globus_xio_mode_e_driver.h noinst_LTLIBRARIES = libglobus_xio_mode_e_driver.la INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/builtins/udp \ -I$(top_srcdir)/builtins/tcp $(GPT_INCLUDES) libglobus_xio_mode_e_driver_la_SOURCES = $(Sources) libglobus_xio_mode_e_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_mode_e_driver_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/mode_e/Makefile.in0000664000076400007640000004414612225614604015630 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins/mode_e ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_mode_e_driver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_mode_e_driver.lo am_libglobus_xio_mode_e_driver_la_OBJECTS = $(am__objects_1) libglobus_xio_mode_e_driver_la_OBJECTS = \ $(am_libglobus_xio_mode_e_driver_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_mode_e_driver_la_SOURCES) DIST_SOURCES = $(libglobus_xio_mode_e_driver_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies Sources = \ globus_xio_mode_e_driver.c include_HEADERS = \ globus_xio_mode_e_driver.h noinst_LTLIBRARIES = libglobus_xio_mode_e_driver.la INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/builtins/udp \ -I$(top_srcdir)/builtins/tcp $(GPT_INCLUDES) libglobus_xio_mode_e_driver_la_SOURCES = $(Sources) libglobus_xio_mode_e_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_mode_e_driver_la_LIBADD = $(GPT_LIB_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/mode_e/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/mode_e/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio_mode_e_driver.la: $(libglobus_xio_mode_e_driver_la_OBJECTS) $(libglobus_xio_mode_e_driver_la_DEPENDENCIES) $(LINK) $(libglobus_xio_mode_e_driver_la_LDFLAGS) $(libglobus_xio_mode_e_driver_la_OBJECTS) $(libglobus_xio_mode_e_driver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-includeHEADERS : unlink: unlink-recursive unlink-includeHEADERS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS filelist: filelist-recursive filelist-includeHEADERS : link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/builtins/Makefile.am0000666000076400007640000000017207753147406014373 00000000000000include $(top_srcdir)/globus_automake_pre SUBDIRS=\ $(XIO_BUILTIN_DIRS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/http/0000775000076400007640000000000012225614636013366 500000000000000globus_xio-3.6/builtins/http/globus_i_xio_http_responses.h0000666000076400007640000000351210363625124021277 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ static const char * globus_l_http_descriptions[] = { "100", "Continue", "101", "Switching Protocols", "200", "OK", "201", "Created", "202", "Accepted", "203", "Non-Authoritative Information", "204", "No Content", "205", "Reset Content", "206", "Partial Content", "300", "Multiple Choices", "301", "Moved Permanently", "302", "Found", "303", "See Other", "304", "Not Modified", "305", "Use Proxy", "307", "Temporary Redirect", "400", "Bad Request", "401", "Unauthorized", "402", "Payment Required", "403", "Forbidden", "404", "Not Found", "405", "Method Not Allowed", "406", "Not Acceptable", "407", "Proxy Authentication Required", "408", "Request Time-out", "409", "Conflict", "410", "Gone", "411", "Length Required", "412", "Precondition Failed", "413", "Request Entity Too Large", "414", "Request-URI Too Large", "415", "Unsupported Media Type", "416", "Requested range not satisfiable", "417", "Expectation Failed", "500", "Internal Server Error", "501", "Not Implemented", "502", "Bad Gateway", "503", "Service Unavailable", "504", "Gateway Time-out", "505", "HTTP Version not supported" }; globus_xio-3.6/builtins/http/globus_xio_http_handle.c0000666000076400007640000003774011005676003020202 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_handle Internal Handle Implementation */ #endif static void globus_l_xio_http_write_eof_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); /** * Allocate and initialize an HTTP handle * @ingroup globus_i_xio_http_handle * * Creates a new handle with values derived from the attr and target. This * is called internally by the HTTP driver's open implementation. * * @param http_handle * Pointer to an uninitialized handle. * @param attr * HTTP attributes associated with open operation. * @param target * Target which is being opened. * * This function may return GLOBUS_SUCCESS, or an error generated by * globus_i_xio_http_response_init(), globus_i_xio_http_request_copy(), * or globus_i_xio_http_target_copy(). */ globus_result_t globus_i_xio_http_handle_init( globus_i_xio_http_handle_t * http_handle, globus_i_xio_http_attr_t * attr, globus_i_xio_http_target_t * target) { globus_result_t result; int rc; GlobusXIOName(globus_i_xio_http_handle_init); rc = globus_mutex_init(&http_handle->mutex, NULL); if (rc != 0) { result = GlobusXIOErrorMemory("mutex"); goto error_exit; } if (target->is_client && attr != NULL) { result = globus_i_xio_http_request_copy( &http_handle->request_info, &attr->request); } else { result = globus_i_xio_http_request_init(&http_handle->request_info); } if (target->is_client) { http_handle->parse_state = GLOBUS_XIO_HTTP_STATUS_LINE; http_handle->send_state = GLOBUS_XIO_HTTP_PRE_REQUEST_LINE; } else { http_handle->parse_state = GLOBUS_XIO_HTTP_PRE_REQUEST_LINE; http_handle->send_state = GLOBUS_XIO_HTTP_STATUS_LINE; } if (result != GLOBUS_SUCCESS) { goto free_mutex_exit; } result = globus_i_xio_http_response_init(&http_handle->response_info); if (result != GLOBUS_SUCCESS) { goto free_request_exit; } result = globus_i_xio_http_target_copy(&http_handle->target_info, target); if (result != GLOBUS_SUCCESS) { goto free_response_exit; } http_handle->header_iovec = NULL; http_handle->header_iovcnt = 0; http_handle->read_buffer.iov_base = NULL; http_handle->read_buffer.iov_len = 0; http_handle->close_operation = NULL; http_handle->response_read_operation = NULL; http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; http_handle->write_operation.iov = NULL; http_handle->write_operation.iovcnt = 0; http_handle->write_operation.operation = NULL; http_handle->write_operation.driver_handle = NULL; http_handle->write_operation.nbytes = 0; http_handle->user_close = GLOBUS_FALSE; http_handle->read_response = GLOBUS_FALSE; return GLOBUS_SUCCESS; free_response_exit: globus_i_xio_http_response_destroy(&http_handle->response_info); free_request_exit: globus_i_xio_http_request_destroy(&http_handle->request_info); free_mutex_exit: globus_mutex_destroy(&http_handle->mutex); error_exit: return result; } /* globus_i_xio_http_handle_init() */ globus_result_t globus_i_xio_http_handle_reinit( globus_i_xio_http_handle_t * http_handle, globus_i_xio_http_attr_t * http_attr, globus_i_xio_http_target_t * http_target) { globus_result_t result; GlobusXIOName(globus_i_xio_http_handle_reinit); if (http_target && http_target->is_client && http_attr != NULL) { globus_i_xio_http_request_destroy(&http_handle->request_info); result = globus_i_xio_http_request_copy( &http_handle->request_info, &http_attr->request); } else { globus_i_xio_http_request_destroy(&http_handle->request_info); result = globus_i_xio_http_request_init(&http_handle->request_info); } if (http_target && http_target->is_client) { http_handle->send_state = GLOBUS_XIO_HTTP_PRE_REQUEST_LINE; } else { http_handle->send_state = GLOBUS_XIO_HTTP_STATUS_LINE; } if (result != GLOBUS_SUCCESS) { goto free_mutex_exit; } globus_i_xio_http_response_destroy(&http_handle->response_info); result = globus_i_xio_http_response_init(&http_handle->response_info); if (result != GLOBUS_SUCCESS) { goto free_request_exit; } globus_i_xio_http_target_destroy_internal(&http_handle->target_info); if (http_target) { result = globus_i_xio_http_target_copy( &http_handle->target_info, http_target); if (result != GLOBUS_SUCCESS) { goto free_response_exit; } } http_handle->header_iovec = NULL; http_handle->header_iovcnt = 0; http_handle->close_operation = NULL; http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; http_handle->write_operation.iov = NULL; http_handle->write_operation.iovcnt = 0; http_handle->write_operation.operation = NULL; http_handle->write_operation.driver_handle = NULL; http_handle->write_operation.nbytes = 0; http_handle->user_close = GLOBUS_FALSE; http_handle->read_response = GLOBUS_FALSE; return GLOBUS_SUCCESS; free_response_exit: globus_i_xio_http_response_destroy(&http_handle->response_info); free_request_exit: globus_i_xio_http_request_destroy(&http_handle->request_info); free_mutex_exit: globus_mutex_destroy(&http_handle->mutex); return result; } /** * Destroy an HTTP handle * @ingroup globus_i_xio_http_handle * * Frees all storage associated with an HTTP handle. The handle must * not be used after this function returns. * * @param http_handle * Handle to be destroyed. * * @return void */ void globus_i_xio_http_handle_destroy( globus_i_xio_http_handle_t * http_handle) { int i; globus_mutex_destroy(&http_handle->mutex); globus_i_xio_http_request_destroy(&http_handle->request_info); globus_i_xio_http_response_destroy(&http_handle->response_info); globus_i_xio_http_target_destroy_internal(&http_handle->target_info); if (http_handle->header_iovec != NULL) { for (i = 0; i < http_handle->header_iovcnt; i++) { globus_libc_free(http_handle->header_iovec[i].iov_base); } globus_libc_free(http_handle->header_iovec); } if (http_handle->read_buffer.iov_base != NULL) { globus_libc_free(http_handle->read_buffer.iov_base); } if (http_handle->close_operation != NULL) { globus_xio_driver_operation_destroy(http_handle->close_operation); } } /* globus_i_xio_http_handle_destroy() */ /** * Modify the state of an HTTP handle * @ingroup globus_i_xio_http_handle * * Modify the state of an HTTP handle. This is called by the XIO driver via * globus_xio_handle_cntl(). * * @param handle * Void pointer to a #globus_i_xio_http_handle_t structure containing * information an HTTP request/response transaction. * @param cmd * Integer value indicating what command will be executed on the handle. * Valid command values are in the set defined by * #globus_xio_http_handle_cmd_t. * @param ap * Variable-length argument list containing any cmd-specific parameters. * * @retval GLOBUS_SUCCESS * The command was sucessfully executed. * @retval GLOBUS_XIO_ERROR_MEMORY * The command failed due to memory constraints. * @retval GLOBUS_XIO_ERROR_PARAMETER * Invalid @a cmd parameter or invlaid value of cmd-specific parameters * in @a ap */ globus_result_t globus_i_xio_http_handle_cntl( void * handle, int cmd, va_list ap) { char * in_header_name; char * in_header_value; globus_result_t result = GLOBUS_SUCCESS; globus_i_xio_http_handle_t * http_handle = handle; char * in_str; char * in_str2; char * save_str; int in_int; GlobusXIOName(globus_i_xio_http_handle_cntl); globus_mutex_lock(&http_handle->mutex); switch (cmd) { case GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HEADER: if (http_handle->target_info.is_client) { result = GlobusXIOErrorParameter("handle"); break; } if (http_handle->send_state != GLOBUS_XIO_HTTP_STATUS_LINE) { result = GlobusXIOErrorParameter("handle"); break; } in_str = va_arg(ap, char *); in_str2 = va_arg(ap, char *); result = globus_i_xio_http_header_info_set_header( &http_handle->response_info.headers, in_str, in_str2); break; case GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_STATUS_CODE: if (http_handle->target_info.is_client) { result = GlobusXIOErrorParameter("handle"); break; } if (http_handle->send_state != GLOBUS_XIO_HTTP_STATUS_LINE) { result = GlobusXIOErrorParameter("handle"); break; } in_int = va_arg(ap, int); if (in_int < 100 || in_int > 599) { result = GlobusXIOErrorParameter("status_code"); break; } http_handle->response_info.status_code = in_int; break; case GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_REASON_PHRASE: if (http_handle->target_info.is_client) { result = GlobusXIOErrorParameter("handle"); break; } if (http_handle->send_state != GLOBUS_XIO_HTTP_STATUS_LINE) { result = GlobusXIOErrorParameter("handle"); break; } in_str = va_arg(ap, char *); if (in_str == NULL) { result = GlobusXIOErrorParameter("reason_phrase"); } save_str = http_handle->response_info.reason_phrase; http_handle->response_info.reason_phrase = globus_libc_strdup(in_str); if (http_handle->response_info.reason_phrase == NULL) { result = GlobusXIOErrorMemory("reason_phrase"); break; } if (save_str) { globus_libc_free(save_str); } break; case GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HTTP_VERSION: if (http_handle->target_info.is_client) { result = GlobusXIOErrorParameter("handle"); break; } if (http_handle->send_state != GLOBUS_XIO_HTTP_STATUS_LINE) { result = GlobusXIOErrorParameter("handle"); break; } http_handle->response_info.http_version = va_arg(ap, globus_xio_http_version_t); break; case GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY: result = globus_i_xio_http_set_end_of_entity(http_handle); break; case GLOBUS_XIO_HTTP_HANDLE_SET_REQUEST_HEADER: in_header_name = va_arg(ap, char *); if (in_header_name == NULL) { result = GlobusXIOErrorParameter("name"); break; } in_header_value = va_arg(ap, char *); if (in_header_value == NULL) { result = GlobusXIOErrorParameter("value"); break; } result = globus_i_xio_http_header_info_set_header( &http_handle->request_info.headers, in_header_name, in_header_value); break; default: result = GlobusXIOErrorParameter("cmd"); break; } globus_mutex_unlock(&http_handle->mutex); return result; } /* globus_i_xio_http_handle_cntl() */ /** * Called with mutex locked */ globus_result_t globus_i_xio_http_set_end_of_entity( globus_i_xio_http_handle_t * http_handle) { globus_result_t result = GLOBUS_SUCCESS; globus_i_xio_http_header_info_t * headers; static globus_xio_iovec_t end_of_body_iovec = { "0\r\n\r\n", 5 }; GlobusXIOName(globus_i_xio_http_set_end_of_entity); if (http_handle->write_operation.operation != NULL) { result = GlobusXIOErrorAlreadyRegistered(); goto error_exit; } else if (http_handle->target_info.is_client) { headers = &http_handle->request_info.headers; } else { headers = &http_handle->response_info.headers; } if (http_handle->send_state == GLOBUS_XIO_HTTP_STATUS_LINE) { /* To send an empty response from server */ result = globus_i_xio_http_server_write_response( http_handle, NULL, 0, NULL); } else if (http_handle->send_state == GLOBUS_XIO_HTTP_CHUNK_BODY) { result = globus_xio_driver_operation_create( &http_handle->write_operation.operation, http_handle->handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } result = globus_xio_driver_pass_write( http_handle->write_operation.operation, &end_of_body_iovec, 1, 5, globus_l_xio_http_write_eof_callback, http_handle); if (result != GLOBUS_SUCCESS) { globus_xio_driver_operation_destroy( http_handle->write_operation.operation); } else { http_handle->send_state = GLOBUS_XIO_HTTP_EOF; } } error_exit: return result; } static void globus_l_xio_http_write_eof_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_mutex_lock(&http_handle->mutex); /* How should error be handled here? */ globus_xio_driver_operation_destroy(op); http_handle->write_operation.operation = NULL; http_handle->write_operation.driver_handle = NULL; if (http_handle->close_operation != NULL) { result = globus_i_xio_http_close_internal(http_handle); } globus_mutex_unlock(&http_handle->mutex); return; } /* globus_l_xio_http_write_eof_callback() */ globus_xio-3.6/builtins/http/globus_xio_http_header_info.c0000666000076400007640000002107411522621706021207 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_header_info Internal Header Information Implementation */ #endif /** * Initialize an HTTP header info structure * @ingroup globus_i_xio_http_header_info * * All fields of the @a header_info structure will be initialized to their * default values. If this function returns a failre, the header_info * should be considered uninitialized. * * @param header_info * Header information structure to initialize. * * @retval GLOBUS_SUCCESS * Header initialized successfully. * @retval GLOBUS_XIO_ERROR_MEMORY * Initialization failed due to memory constraints. */ globus_result_t globus_i_xio_http_header_info_init( globus_i_xio_http_header_info_t * header_info) { int rc; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_i_xio_http_header_info_init); memset(header_info, '\0', sizeof(globus_i_xio_http_header_info_t)); rc = globus_hashtable_init( &header_info->headers, 16, globus_hashtable_string_hash, globus_hashtable_string_keyeq); if (rc != GLOBUS_SUCCESS) { result = GlobusXIOErrorMemory("hashtable"); } return result; } /* globus_i_xio_http_header_info_init() */ /** * Destroy a header info structure * @ingroup globus_i_xio_http_header_info * * All fields of this header information structure will be freed. * * @param header_info * Header information structure to destroy. * * @return void */ void globus_i_xio_http_header_info_destroy( globus_i_xio_http_header_info_t * header_info) { globus_hashtable_destroy_all( &header_info->headers, globus_i_xio_http_header_destroy); } /* globus_i_xio_http_header_info_destroy() */ /** * Copy the contents of a header information structure. * @ingroup globus_i_xio_http_header_info * * All values associated with the @a src header information structure will * be copied to the @a dest one. If this function returns a failure, then the * @a dest structure should be considered uninitialized. * * @param dest * Header information structure to initialize. This should not be * initialized before this function is called, or memory may be leaked. * @param src * Header information structure containing valid values. * * @retval GLOBUS_SUCCESS * Structure successfully copied. * @retval GLOBUS_XIO_ERROR_MEMORY * Copy failed due to memory constraints. */ globus_result_t globus_i_xio_http_header_info_copy( globus_i_xio_http_header_info_t * dest, const globus_i_xio_http_header_info_t * src) { int rc; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_i_xio_http_header_info_init); rc = globus_hashtable_copy( &dest->headers, (globus_hashtable_t *) &src->headers, globus_i_xio_http_header_copy); if (rc != GLOBUS_SUCCESS) { result = GlobusXIOErrorMemory("hashtable"); goto error_exit; } dest->content_length = src->content_length; dest->transfer_encoding = src->transfer_encoding; dest->flags = src->flags; return result; error_exit: return result; } /* globus_i_xio_http_header_info_copy() */ /** * Set the value of a header in a hashtable * @ingroup globus_i_xio_http_header * * Adds a new header to a header info structure, or updates the value of an * existing header. Copies of the name and value will be stored in a * #globus_xio_http_header_t in a hashtable in the header info structure. * * @param headers * Pointer to the header info structure. * @param header_name * Name of the header. * @param header_value * Value of the header. * * @retval GLOBUS_SUCCESS * Header successfully added to the hashtable. * @retval GLOBUS_XIO_ERROR_MEMORY * Unable to add header due to memory constraints. */ globus_result_t globus_i_xio_http_header_info_set_header( globus_i_xio_http_header_info_t * headers, const char * header_name, const char * header_value) { char * save_header; globus_result_t result = GLOBUS_SUCCESS; globus_xio_http_header_t * header; int rc; unsigned long length; GlobusXIOName(globus_l_xio_http_header_set); /* Special cases for entity-body handling headers */ if (strcmp(header_name, "Content-Length") == 0) { rc = sscanf(header_value, "%lu", &length); if (rc < 1) { result = GlobusXIOHttpErrorInvalidHeader(header_name, header_value); goto error_exit; } headers->content_length = length; headers->flags |= GLOBUS_I_XIO_HTTP_HEADER_CONTENT_LENGTH_SET; } else if (strcmp(header_name, "Transfer-Encoding") == 0) { if (strcmp(header_value, "identity") == 0) { headers->transfer_encoding = GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY; } else if (strcmp(header_value, "chunked") == 0) { headers->transfer_encoding = GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED; } else { result = GlobusXIOHttpErrorInvalidHeader(header_name, header_value); goto error_exit; } } else if (strcmp(header_name, "Connection") == 0) { if (strcmp(header_value, "close") == 0) { headers->flags |= GLOBUS_I_XIO_HTTP_HEADER_CONNECTION_CLOSE; } else if (strcmp(header_value, "keep-alive") == 0) { headers->flags &= ~GLOBUS_I_XIO_HTTP_HEADER_CONNECTION_CLOSE; } else { result = GlobusXIOHttpErrorInvalidHeader(header_name, header_value); goto error_exit; } } else { /* * Either modify the header's value in the hashtable, if it's a * duplicate, or create a new entry in the hashtable */ header = globus_hashtable_lookup( &headers->headers, (void *) header_name); if (header != NULL) { /* Replace current header's value */ save_header = header->value; header->value = globus_libc_strdup(header_value); if (header->value == NULL) { header->value = save_header; result = GlobusXIOErrorMemory("header"); goto error_exit; } globus_libc_free(save_header); } else { header = globus_libc_malloc(sizeof(globus_xio_http_header_t)); if (header == NULL) { result = GlobusXIOErrorMemory("header"); goto error_exit; } header->name = globus_libc_strdup(header_name); if (header->name == NULL) { result = GlobusXIOErrorMemory("header"); goto free_header_exit; } header->value = globus_libc_strdup(header_value); if (header->value == NULL) { result = GlobusXIOErrorMemory("header"); goto free_header_name_exit; } rc = globus_hashtable_insert( &headers->headers, header->name, header); if (rc != GLOBUS_SUCCESS) { result = GlobusXIOErrorMemory("header"); goto free_header_value_exit; } } } return result; free_header_value_exit: globus_libc_free(header->value); free_header_name_exit: globus_libc_free(header->name); free_header_exit: globus_libc_free(header); error_exit: return result; } /* globus_l_xio_http_header_info_set_header() */ globus_xio-3.6/builtins/http/globus_xio_http_client.c0000666000076400007640000010346211006134627020222 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_client Internal HTTP Client Implementation */ #endif static void globus_l_xio_http_client_write_request_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); static void globus_l_xio_http_client_read_response_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); static globus_result_t globus_l_xio_http_client_parse_response( globus_i_xio_http_handle_t * http_handle, globus_bool_t * done); static globus_result_t globus_l_xio_http_cleanup_cancel( globus_i_xio_http_handle_t * http_handle); /** * Client-side connection open callback * @ingroup globus_i_xio_http_client * * Called as a result of open at the transport level. If this was * successful, we will write the HTTP request which corresponds to our * target to this new connection. * * If this function succeeds, the open will remain unfinished until that * write completes. If an error happens, this function will close the handle * internally and call globus_xio_driver_finished_open() before returning. * * @param op * operation associated with the open call. * @param result * Lower-level protocol result from open. * @param user_arg * A void pointer pointing to a #globus_i_xio_http_driver_t * * @return void */ void globus_i_xio_http_client_open_callback( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_result_t result2; globus_mutex_lock(&http_handle->mutex); if (result != GLOBUS_SUCCESS) { http_handle->send_state = GLOBUS_XIO_HTTP_CLOSE; goto error_exit; } if(http_handle->delay_write_header) { globus_xio_driver_finished_open( http_handle, op, result); } else { globus_assert(http_handle->send_state == GLOBUS_XIO_HTTP_PRE_REQUEST_LINE); http_handle->send_state = GLOBUS_XIO_HTTP_REQUEST_LINE; result = globus_i_xio_http_client_write_request(op, http_handle); if (result != GLOBUS_SUCCESS) { http_handle->send_state = GLOBUS_XIO_HTTP_EOF; goto error_exit; } } globus_mutex_unlock(&http_handle->mutex); return; error_exit: if (http_handle->send_state == GLOBUS_XIO_HTTP_EOF) { result2 = globus_xio_driver_operation_create( &http_handle->close_operation, http_handle->handle); if (result2 != GLOBUS_SUCCESS) { /* * We can't close the transport, we'll make the best of the * situation. Resetting this flag makes the lower code destroy * the handle. */ http_handle->send_state = GLOBUS_XIO_HTTP_CLOSE; goto destroy_handle_exit; } result2 = globus_xio_driver_pass_close( http_handle->close_operation, globus_i_xio_http_close_callback, http_handle); if (result2 == GLOBUS_SUCCESS) { http_handle->user_close = GLOBUS_FALSE; } else { http_handle->send_state = GLOBUS_XIO_HTTP_CLOSE; } } destroy_handle_exit: globus_mutex_unlock(&http_handle->mutex); if (http_handle->send_state == GLOBUS_XIO_HTTP_CLOSE) { globus_i_xio_http_handle_destroy(http_handle); globus_libc_free(http_handle); http_handle = NULL; } globus_xio_driver_finished_open( http_handle, op, result); } /* globus_i_xio_http_client_open_callback() */ /** * Write an HTTP request * @ingroup globus_i_xio_http_client * * Composes and writes an HTTP request which corresponds to the attributes and * target which were passed to the HTTP driver's open implementation. * * Called with the mutex locked. * * @param op * Previously allocated XIO operation which is associaed with the current * open being processed by the driver. * @param http_handle * An HTTP handle containing state about this connection. * * @returns This function returns GLOBUS_SUCCESS, GLOBUS_XIO_ERROR_MEMORY, or * other errors from the XIO system or transport driver. * * @retval GLOBUS_SUCCESS * The request was successfully composed and passed to the transport * driver. * @retval GLOBUS_XIO_ERROR_MEMORY * Unable to compose or write the request because of memory constraints. */ globus_result_t globus_i_xio_http_client_write_request( globus_xio_operation_t op, globus_i_xio_http_handle_t * http_handle) { globus_result_t result; int rc; globus_fifo_t iovecs; char * str; globus_size_t send_size; globus_xio_iovec_t * iov; globus_xio_http_header_t * current_header; int i; char * size_buffer = NULL; GlobusXIOName(globus_i_xio_http_client_write_request); globus_assert(http_handle->send_state == GLOBUS_XIO_HTTP_REQUEST_LINE); /* * Compose HTTP request: * Method URI HTTP-Version\r\n * Header-Name: Header-Value\r\n * ... * \r\n */ rc = globus_fifo_init(&iovecs); if (rc != GLOBUS_SUCCESS) { result = GlobusXIOErrorMemory("iovecs"); goto error_exit; } /* Default request method is GET, if none is provided in open attrs */ if ((str = http_handle->request_info.method) == NULL) { str = "GET"; } /* Certain HTTP methods should be accompanied by an entity-body. We handle * the cases described in RFC 2616, but the user may use some other method * perhaps, we allow an override in the open attr. * * In cases where an entity is included, we require the application to use * the GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY handle command to signal * this. */ if (! GLOBUS_I_XIO_HTTP_HEADER_IS_ENTITY_NEEDED( &http_handle->request_info.headers)) { if (globus_i_xio_http_method_requires_entity(str)) { http_handle->request_info.headers.flags |= GLOBUS_I_XIO_HTTP_HEADER_ENTITY_NEEDED; } } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, str, strlen(str), free_iovecs_exit); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, " ", 1, free_iovecs_exit); if (((str = http_handle->request_info.uri) == NULL) && ((str = http_handle->target_info.uri) == NULL)) { str = "/"; } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, str, strlen(str), free_iovecs_exit); if (http_handle->request_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_0) { str = " HTTP/1.0\r\n"; } else { http_handle->request_info.http_version = GLOBUS_XIO_HTTP_VERSION_1_1; str = " HTTP/1.1\r\n"; } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, str, strlen(str), free_iovecs_exit); current_header = globus_hashtable_first( &http_handle->request_info.headers.headers); while (current_header) { GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, current_header->name, strlen(current_header->name), free_iovecs_exit); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, ": ", 2, free_iovecs_exit); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, current_header->value, strlen(current_header->value), free_iovecs_exit); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "\r\n", 2, free_iovecs_exit); current_header = globus_hashtable_next( &http_handle->request_info.headers.headers); } /* * Special headers we generate, related to entity size management. These * will be intercepted in the attr command which sets a header. */ if (http_handle->request_info.http_version != GLOBUS_XIO_HTTP_VERSION_1_0) { /* HTTP/1.1 clients MUST send a Host header */ GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Host: ", 6, free_iovecs_exit); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, http_handle->target_info.host, strlen(http_handle->target_info.host), free_iovecs_exit); if (http_handle->target_info.port != 0 && http_handle->target_info.port != 80) { char port_buffer[7]; int len; sprintf(port_buffer, ":%hu%n", http_handle->target_info.port, &len); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, port_buffer, len, free_iovecs_exit); } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "\r\n", 2, free_iovecs_exit); } if (GLOBUS_I_XIO_HTTP_HEADER_IS_ENTITY_NEEDED( &http_handle->request_info.headers)) { if ((http_handle->request_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_0) || ((http_handle->request_info.headers.transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY) && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET( &http_handle->request_info.headers))) { if (http_handle->request_info.http_version != GLOBUS_XIO_HTTP_VERSION_1_0) { GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Transfer-Encoding: identity\r\n", 29, free_iovecs_exit); } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Content-Length: ", 16, free_iovecs_exit); size_buffer = globus_common_create_string( "%lu\r\n", (unsigned long) http_handle->request_info.headers.content_length); if (size_buffer == NULL) { result = GlobusXIOErrorMemory("iovec.iov_base"); goto free_iovecs_exit; } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, size_buffer, strlen(size_buffer), free_iovecs_exit); http_handle->request_info.headers.transfer_encoding = GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY; free(size_buffer); size_buffer = NULL; } else { http_handle->request_info.headers.transfer_encoding = GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED; GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Transfer-Encoding: chunked\r\n", 28, free_iovecs_exit); } } if (GLOBUS_I_XIO_HTTP_HEADER_IS_CONNECTION_CLOSE( &http_handle->request_info.headers)) { GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Connection: close\r\n", 19, free_iovecs_exit); } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "\r\n", 2, free_iovecs_exit); http_handle->header_iovcnt = globus_fifo_size(&iovecs); http_handle->header_iovec = globus_libc_malloc( http_handle->header_iovcnt * sizeof(globus_xio_iovec_t)); if (http_handle->header_iovec == NULL) { goto free_iovecs_exit; } /* Convert fifo to iovec array, counting up size for wait_for_nbytes * parameter to globus_xio_driver_pass_write. */ for (i = 0, send_size = 0; i < http_handle->header_iovcnt; i++) { iov = globus_fifo_dequeue(&iovecs); globus_assert(iov != NULL); http_handle->header_iovec[i].iov_base = iov->iov_base; http_handle->header_iovec[i].iov_len = iov->iov_len; send_size += iov->iov_len; globus_libc_free(iov); } result = globus_xio_driver_pass_write( op, http_handle->header_iovec, http_handle->header_iovcnt, send_size, globus_l_xio_http_client_write_request_callback, http_handle); if (result != GLOBUS_SUCCESS) { goto free_headers_exit; } globus_fifo_destroy(&iovecs); return GLOBUS_SUCCESS; free_headers_exit: for (i = 0; i < http_handle->header_iovcnt; i++) { globus_libc_free(http_handle->header_iovec[i].iov_base); } globus_libc_free(http_handle->header_iovec); http_handle->header_iovec = NULL; http_handle->header_iovcnt = 0; free_iovecs_exit: while (! globus_fifo_empty(&iovecs)) { iov = globus_fifo_dequeue(&iovecs); free(iov->iov_base); free(iov); } globus_fifo_destroy(&iovecs); if (size_buffer != NULL) { free(size_buffer); } error_exit: return result; } /* globus_i_xio_http_client_write_request() */ /** * Request Written Callback * @ingroup globus_i_xio_http_write_request_callback * * Called when the response has been completely written by the transport. * The driver then registers a read for the HTTP response. * After this has been registered, the HTTP driver is done "opening" the HTTP * handle, and will signal this to the user via * globus_xio_driver_finished_open(). The user may then send any data * payload associated with the request via the globus_xio_write() family of * functions. * * @param op * XIO operation originally associated with the open of this handle. * @param result * Result from the transport of writing the HTTP request. * @param nbytes * Number of bytes in the message that were written. * @param user_arg * Void pointer containing the #globus_i_xio_http_handle_t. * * @return void */ static void globus_l_xio_http_client_write_request_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; int i; GlobusXIOName(globus_l_xio_http_client_write_request_callback); globus_mutex_lock(&http_handle->mutex); /* Free up headers */ for (i = 0; i < http_handle->header_iovcnt; i++) { globus_libc_free(http_handle->header_iovec[i].iov_base); } globus_libc_free(http_handle->header_iovec); http_handle->header_iovec = NULL; http_handle->header_iovcnt = 0; if (result != GLOBUS_SUCCESS) { goto error_exit; } /* Synthesize read operation for response */ result = globus_xio_driver_operation_create( &http_handle->response_read_operation, http_handle->handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } /* * First time we use a connection with a handle, we allocate a buffer, * later on we just reuse after shifting offset to catch already read * bits */ if (http_handle->read_buffer.iov_base == NULL) { http_handle->read_buffer.iov_len = GLOBUS_XIO_HTTP_CHUNK_SIZE; http_handle->read_buffer.iov_base = globus_libc_malloc( GLOBUS_XIO_HTTP_CHUNK_SIZE); http_handle->read_iovec.iov_base = http_handle->read_buffer.iov_base; http_handle->read_iovec.iov_len = http_handle->read_buffer.iov_len; if (http_handle->read_buffer.iov_base == NULL) { result = GlobusXIOErrorMemory("read_buffer"); goto destroy_op_exit; } } else { result = globus_i_xio_http_clean_read_buffer(http_handle); if (result != GLOBUS_SUCCESS) { goto destroy_op_exit; } } http_handle->parse_state = GLOBUS_XIO_HTTP_STATUS_LINE; if (!GLOBUS_I_XIO_HTTP_HEADER_IS_ENTITY_NEEDED( &http_handle->request_info.headers)) { http_handle->send_state = GLOBUS_XIO_HTTP_EOF; } else if (http_handle->request_info.headers.transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY) { http_handle->send_state = GLOBUS_XIO_HTTP_IDENTITY_BODY; } else { http_handle->send_state = GLOBUS_XIO_HTTP_CHUNK_BODY; } result = globus_xio_driver_pass_read( http_handle->response_read_operation, &http_handle->read_buffer, 1, 1, globus_l_xio_http_client_read_response_callback, http_handle); if (result != GLOBUS_SUCCESS) { goto free_read_buffer_exit; } if(http_handle->delay_write_header) { http_handle->delay_write_header = 0; globus_mutex_unlock(&http_handle->mutex); globus_i_xio_http_write( http_handle, http_handle->first_write_iovec, http_handle->first_write_iovec_count, op); } else { globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_open( http_handle, op, result); } return; destroy_op_exit: globus_xio_driver_operation_destroy( http_handle->response_read_operation); http_handle->response_read_operation = NULL; free_read_buffer_exit: globus_libc_free(http_handle->read_buffer.iov_base); http_handle->read_buffer.iov_len = 0; error_exit: if (http_handle->reopen_in_progress) { globus_object_t * cause = NULL; if (result != GLOBUS_SUCCESS) { cause = globus_error_get(result); } result = GlobusXIOHttpErrorPersistentConnectionDropped(cause); } if(http_handle->delay_write_header) { globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_write( op, result, nbytes); } else { globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_open( http_handle, op, result); } } /* globus_i_xio_http_client_write_request_callback() */ /** * Read response callback * @ingroup globus_i_xio_http_client * * Called when part of the response has been read by the transport driver. * If all of the response headers are present, or some error occurs at the * transport layer, or the response isn't well-formed, then the response ready * callback set in the handle's open attribute will be called. If the header * information isn't all present, then another read will be passed * to the transport. * * @param op * XIO operation associated with the response read. * @param result * Transport-level result of reading the response. * @param nbytes * Amount of data read by the transport. * @param user_arg * Void * pointing to the #globus_i_xio_http_handle_t associated * with this response. * * @return void */ static void globus_l_xio_http_client_read_response_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_bool_t eof = GLOBUS_FALSE; globus_bool_t done; globus_bool_t finish_read = GLOBUS_FALSE; globus_bool_t registered_again = GLOBUS_FALSE; globus_i_xio_http_attr_t * descriptor; globus_result_t save_result = result; globus_object_t * response_error = NULL; GlobusXIOName(globus_l_xio_http_client_read_response_callback); globus_mutex_lock(&http_handle->mutex); if (result != GLOBUS_SUCCESS) { if (globus_xio_error_is_eof(result)) { eof = GLOBUS_TRUE; result = GLOBUS_SUCCESS; } else { response_error = globus_error_get(result); http_handle->response_info.status_code = 500; http_handle->response_info.reason_phrase = globus_error_print_friendly(response_error); if (http_handle->write_operation.operation != NULL) { /* Error occurred reading a response. A write which * has been registered should be cancelled. */ result = globus_xio_driver_operation_cancel( http_handle->write_operation.driver_handle, http_handle->write_operation.operation); globus_assert(result == GLOBUS_SUCCESS); } if (http_handle->reopen_in_progress) { response_error = GlobusXIOHTTPErrorObjPersistentConnectionDropped(response_error); } /* don't go to error exit yet because we may need to clean up * the cancel info */ if (!globus_xio_error_is_canceled(result)) { goto error_exit; } } } http_handle->read_buffer_valid += nbytes; /* Parsed response line and headers (but don't bother if it was canceled. */ if (result == GLOBUS_SUCCESS) { result = globus_l_xio_http_client_parse_response(http_handle, &done); } if (result == GLOBUS_SUCCESS && !done) { goto reregister_read; } /* If user registered a read before we finished parsing, we'll * have to handle it now. */ if (http_handle->read_operation.operation != NULL) { result = globus_l_xio_http_cleanup_cancel(http_handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } /* Set metadata on this read to contain the response info */ descriptor = globus_xio_operation_get_data_descriptor( http_handle->read_operation.operation, GLOBUS_TRUE); if (descriptor == NULL) { result = GlobusXIOErrorMemory("descriptor"); goto error_exit; } globus_i_xio_http_response_destroy(&descriptor->response); result = globus_i_xio_http_response_copy( &descriptor->response, &http_handle->response_info); if (result != GLOBUS_SUCCESS) { goto error_exit; } http_handle->read_response = GLOBUS_TRUE; result = globus_i_xio_http_parse_residue( http_handle, ®istered_again); if ((http_handle->read_operation.wait_for <= 0 && !registered_again) || result != GLOBUS_SUCCESS) { if (http_handle->response_info.headers.transfer_encoding != GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET( &http_handle->response_info.headers) && http_handle->response_info.headers.content_length == 0) { /* Synthesize EOF if we've read all of the entity content */ result = GlobusXIOErrorEOF(); } /* * Either we've read enough, hit end of chunk, no entity was * present, or pass to transport failed. Call finished_read */ op = http_handle->read_operation.operation; nbytes = http_handle->read_operation.nbytes; globus_libc_free(http_handle->read_operation.iov); http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; finish_read = GLOBUS_TRUE; } } globus_xio_driver_operation_destroy(http_handle->response_read_operation); http_handle->response_read_operation = NULL; globus_mutex_unlock(&http_handle->mutex); if (finish_read) { globus_xio_driver_finished_read(op, result, nbytes); } return; reregister_read: if (eof) { /* Header block wasn't complete before eof. */ result = save_result; goto error_exit; } result = globus_i_xio_http_clean_read_buffer(http_handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } result = globus_xio_driver_pass_read( http_handle->response_read_operation, &http_handle->read_iovec, 1, 1, globus_l_xio_http_client_read_response_callback, http_handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } globus_mutex_unlock(&http_handle->mutex); return; error_exit: if (http_handle->read_operation.operation != NULL) { if (http_handle->cancellation != NULL) { globus_l_xio_http_cleanup_cancel(http_handle); } /* * Either we've read enough, hit end of chunk, no entity was * present, or pass to transport failed. Call finished_read */ op = http_handle->read_operation.operation; nbytes = http_handle->read_operation.nbytes; globus_libc_free(http_handle->read_operation.iov); http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; finish_read = GLOBUS_TRUE; if (eof && response_error == NULL) { result = GlobusXIOErrorEOF(); } } if (result == GLOBUS_SUCCESS) { descriptor = globus_xio_operation_get_data_descriptor(op, GLOBUS_TRUE); if (descriptor == NULL) { result = GlobusXIOErrorMemory("descriptor"); } else { globus_i_xio_http_response_destroy(&descriptor->response); result = globus_i_xio_http_response_copy( &descriptor->response, &http_handle->response_info); } } globus_xio_driver_operation_destroy(http_handle->response_read_operation); http_handle->response_read_operation = NULL; if (response_error != NULL) { result = globus_error_put(response_error); } globus_mutex_unlock(&http_handle->mutex); if (finish_read) { globus_xio_driver_finished_read(op, result, nbytes); } } /* globus_l_xio_http_client_read_response_callback() */ /** * Parse the response to an HTTP request * @ingroup globus_i_xio_http_client * * Parses the response line and then uses globus_i_xio_http_header_parse() to * parse the header block. If the entire response header section is read, * the boolean pointed to by @a done will be modified to be GLOBUS_TRUE. * * Called with mutex locked. * @param http_handle * @param done * * @return * This function returns GLOBUS_SUCCESS, GLOBUS_XIO_HTTP_ERROR_PARSE, * or GLOBUS_XIO_ERROR_MEMORY. Other errors may be returned from * globus_i_xio_http_header_parse(). * @retval GLOBUS_SUCCESS * No parsing errors occurred while parsing the status line or headers. * Parsing may still be incomplete, depending on the final value of * @a done. * @retval ::GLOBUS_XIO_HTTP_ERROR_PARSE * Parse error reading the HTTP Status line * @retval GLOBUS_XIO_ERROR_MEMORY * Parsing failed because of memory constraints. */ static globus_result_t globus_l_xio_http_client_parse_response( globus_i_xio_http_handle_t * http_handle, globus_bool_t * done) { globus_result_t result; char * eol; char * current_offset; int parsed; unsigned int http_major; unsigned int http_minor; int rc; GlobusXIOName(globus_l_xio_http_client_parse_response); if (http_handle->parse_state == GLOBUS_XIO_HTTP_STATUS_LINE) { /* Parse the status line: * * HTTP-Version SP Status-Code SP Reason-Phrase CRLF */ current_offset = ((char *) (http_handle->read_buffer.iov_base)) + http_handle->read_buffer_offset; eol = globus_i_xio_http_find_eol( current_offset, http_handle->read_buffer_valid); if (eol == NULL) { *done = GLOBUS_FALSE; return GLOBUS_SUCCESS; } *eol = '\0'; rc = sscanf(current_offset, "HTTP/%u.%u %n", &http_major, &http_minor, &parsed); if (rc < 2) { result = GlobusXIOHttpErrorParse("Http-Version", current_offset); goto error_exit; } http_handle->response_info.http_version = globus_i_xio_http_guess_version(http_major, http_minor); current_offset += parsed; /* Status-Code */ rc = sscanf(current_offset, "%d %n", &http_handle->response_info.status_code, &parsed); if (http_handle->response_info.status_code < 100 || http_handle->response_info.status_code > 599) { result = GlobusXIOHttpErrorParse("Status-Code", current_offset); goto error_exit; } current_offset += parsed; /* Reason Phrase */ http_handle->response_info.reason_phrase = globus_libc_strdup(current_offset); if (http_handle->response_info.reason_phrase == NULL) { result = GlobusXIOErrorMemory("reason_phrase"); goto error_exit; } /* Set current offset after the end of CRLF at end of this line */ current_offset = eol+2; parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; http_handle->parse_state = GLOBUS_XIO_HTTP_HEADERS; } return globus_i_xio_http_header_parse(http_handle, done); error_exit: parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); /* Chop of what we managed to parse from the buffer */ http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; return result; } /* globus_i_xio_http_client_parse_response() */ static globus_result_t globus_l_xio_http_cleanup_cancel( globus_i_xio_http_handle_t * http_handle) { globus_list_t * l; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_http_cleanup_cancel); globus_assert(http_handle->cancellation != NULL); /* At this point, we don't need to enable cancels for the op any more: * the tcp driver can handle it for us. We disable our cancel handler * here. If the cancel callback has fired, we can free the cancel * info ourselves here. * it here and let the cancel callback (if it occurs) remove it */ globus_mutex_lock(&globus_i_xio_http_cancel_mutex); if ((l = globus_list_search(globus_i_xio_http_cancellable_handles, http_handle->cancellation)) != NULL) { /* Cancel callback hasn't occurred yet. We'll disable cancel. * and remove the cancellation info from the list (which will * cause any cancel callback to free the data), and if we know * that no callback has or will happen, we can free it ourselves. */ globus_list_remove(&globus_i_xio_http_cancellable_handles, l); globus_xio_operation_disable_cancel( http_handle->cancellation->user_read_op); if (! globus_xio_operation_is_canceled( http_handle->cancellation->user_read_op)) { /* Cancellation didn't happen while we were doing the above, * and so the cancel callback will never be fired. We can * free the cancellation info ourselves here. */ free(http_handle->cancellation); http_handle->cancellation = NULL; } else { http_handle->cancellation = NULL; result = GlobusXIOErrorCanceled(); } } else { /* Cancel callback occurred in another thread. That thread will * try to cancel this operation. We are obliged to free the * cancel info. */ free(http_handle->cancellation); http_handle->cancellation = NULL; result = GlobusXIOErrorCanceled(); } globus_mutex_unlock(&globus_i_xio_http_cancel_mutex); return result; } globus_xio-3.6/builtins/http/globus_xio_http_server.c0000666000076400007640000007050511005676003020251 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_server Internal Server Implementation */ #endif static void globus_l_xio_http_accept_callback( globus_xio_operation_t op, globus_result_t result, void * user_arg); static globus_result_t globus_l_xio_http_server_parse_request( globus_i_xio_http_handle_t * http_handle, globus_bool_t * done); static void globus_l_xio_http_server_write_response_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); /** * Accept an HTTP request * @ingroup globus_i_xio_http_server * * Passes the request to the transport driver. In the callback, * the request target information will be generated. * * @param driver_server * Void * pointing to a server structure. Not used yet. * @param accept_op * Operation associated with the accept. * * @return * This function passes the accept to the underlying transport driver, * so will return whatever value that driver returns. */ globus_result_t globus_i_xio_http_accept( void * driver_server, globus_xio_operation_t accept_op) { return globus_xio_driver_pass_accept(accept_op, globus_l_xio_http_accept_callback, NULL); } /* globus_i_xio_http_accept() */ /** * Accept callback * @ingroup globus_i_xio_http_server * * Callback function called when the transport completes accepting * a connection for the request. Generates a new target to associate with * the result of this accept. This target will be passed to * globus_xio_open() or globus_xio_register_open() to begin processing the * request. * * @param op * XIO Data structure passed through to globus_xio_driver_finished_accept(). * @param result * Result from the transport's attempt to accept a new connection. * @param user_arg * Not used. * * @return void * * @todo When implemented in the XIO driver framework, parse the request * header before returning from this, so the target is populated with * meaningful information for the user. This will help enable persistent * connections. */ static void globus_l_xio_http_accept_callback( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_i_xio_http_target_t * target_info = NULL; GlobusXIOName(globus_l_xio_http_accept_callback); if (result == GLOBUS_SUCCESS) { target_info = globus_i_xio_http_target_new(); if (target_info == NULL) { result = GlobusXIOErrorMemory("target"); } } globus_xio_driver_finished_accept(op, target_info, result); } /* globus_l_xio_http_accept_callback() */ /** * Server-side connection open callback * @ingroup globus_i_xio_http_server * * Called as a result of open at the transport level. If this was successful, * we will finish the open operation. If an error happens, this function will * close the * handle internally and call globus_xio_driver_finished_open() to * propagate the error. * * @param op * Operation associated with the open. * @param result * Result from the transport's attempt to open the new connection. * @param user_arg * Void * pointing to a #globus_i_xio_http_handle_t associated with * this open. * * @return void */ void globus_i_xio_http_server_open_callback( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; GlobusXIOName(globus_i_xio_http_server_open_callback); if (result != GLOBUS_SUCCESS) { globus_i_xio_http_handle_destroy(http_handle); globus_libc_free(http_handle); http_handle = NULL; } globus_xio_driver_finished_open( http_handle, op, result); return; } /* globus_i_xio_http_server_open_callback() */ /** * Write the response to an HTTP request * @ingroup globus_i_xio_http_server * * Generates an HTTP response line from a handle, and passes it to the * transport. The globus_l_xio_http_server_write_response_callback() will * be called once the transport has sent the response. * * This call may be triggered by either the first write on a server handle, * or by calling the #GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY handle * control function. * * Called with my mutex lock. * * @param http_handle * Handle associated with this HTTP stream. * @param iovec * Array of globus_xio_iovec_t structs associated with the user's write. * @param iovec_count * Length of the @a iovec array. If this is zero, we assume that the * response is being generated by the * #GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY control. * @param op * Operation associated with the write. If this is NULL (in the case * of the GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY control), one * will be created in this function. * * This function returns GLOBUS_SUCCESS, GLOBUS_XIO_ERROR_MEMORY, or an * error result from globus_xio_driver_operation_create(), or * globus_xio_driver_pass_write(). * * @retval GLOBUS_SUCCESS * Response was passed to the transport for writing. If this was generated * by a user writing data, then the write will occur after the * globus_l_xio_http_server_write_response_callback() has been called. * @retval GLOBUS_XIO_ERROR_MEMORY * Unable to compose the response due to memory constraints. */ globus_result_t globus_i_xio_http_server_write_response( globus_i_xio_http_handle_t * http_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_result_t result; globus_fifo_t iovecs; const char * str; char code_str[5]; globus_xio_iovec_t * iov; int rc; int i; int send_size; char * size_buffer = NULL; globus_bool_t free_op = GLOBUS_FALSE; globus_xio_http_header_t * current_header; GlobusXIOName(globus_i_xio_server_write_response); globus_assert(http_handle->send_state == GLOBUS_XIO_HTTP_STATUS_LINE); rc = globus_fifo_init(&iovecs); if (rc != GLOBUS_SUCCESS) { result = GlobusXIOErrorMemory("iovecs"); goto error_exit; } /* Compose HTTP Response: * HTTP-Version SP Status-Code SP Reason-Phrase CRLF */ if (http_handle->response_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_0) { str = "HTTP/1.0 "; } else { http_handle->response_info.http_version = GLOBUS_XIO_HTTP_VERSION_1_1; str = "HTTP/1.1 "; } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, str, 9, free_iovecs_error); sprintf(code_str, "%d ", http_handle->response_info.status_code); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, code_str, 4, free_iovecs_error); if (http_handle->response_info.reason_phrase != NULL) { str = http_handle->response_info.reason_phrase; } else { str = globus_i_xio_http_lookup_reason( http_handle->response_info.status_code); } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, str, strlen(str), free_iovecs_error); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "\r\n", 2, free_iovecs_error); current_header = globus_hashtable_first( &http_handle->response_info.headers.headers); while (current_header) { GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, current_header->name, strlen(current_header->name), free_iovecs_error); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, ": ", 2, free_iovecs_error); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, current_header->value, strlen(current_header->value), free_iovecs_error); GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "\r\n", 2, free_iovecs_error); current_header = globus_hashtable_next( &http_handle->response_info.headers.headers); } /* * Special headers we generate. */ if (GLOBUS_I_XIO_HTTP_HEADER_IS_CONNECTION_CLOSE( &http_handle->response_info.headers) || (http_handle->request_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_0) || (http_handle->response_info.headers.transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET( &http_handle->response_info.headers))) { http_handle->response_info.headers.flags |= GLOBUS_I_XIO_HTTP_HEADER_CONNECTION_CLOSE; GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Connection: close\r\n", 19, free_iovecs_error); } if (iovec_count > 0) { /* * We are sending a body, so we'll set the appropriate entity-related * headers */ if (http_handle->request_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_0 || (http_handle->response_info.headers.transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET( &http_handle->response_info.headers))) { http_handle->response_info.headers.transfer_encoding = GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY; /* Transfer-Encoding mustn't be sent to a HTTP/1.0 client */ if (http_handle->request_info.http_version != GLOBUS_XIO_HTTP_VERSION_1_0) { GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Transfer-Encoding: identity\r\n", 29, free_iovecs_error); } /* * When we know the content-length beforehand we can set it here, * otherwise, we will use the connection: close header */ if (GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET( &http_handle->response_info.headers)) { GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Content-Length: ", 16, free_iovecs_error); size_buffer = globus_common_create_string( "%lu\r\n", (unsigned long) http_handle->response_info.headers.content_length); if (size_buffer == NULL) { result = GlobusXIOErrorMemory("iovec.iov_base"); goto free_iovecs_error; } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, size_buffer, strlen(size_buffer), free_iovecs_error); free(size_buffer); size_buffer = NULL; } } else { http_handle->response_info.headers.transfer_encoding = GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED; GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "Transfer-Encoding: chunked\r\n", 28, free_iovecs_error); } } GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs, "\r\n", 2, free_iovecs_error); http_handle->header_iovcnt = globus_fifo_size(&iovecs); http_handle->header_iovec = globus_libc_malloc( http_handle->header_iovcnt * sizeof(globus_xio_iovec_t)); if (http_handle->header_iovec == NULL) { goto free_iovecs_error; } /* Convert fifo to iovec array, counting up size for wait_for_nbytes * parameter to globus_xio_driver_pass_write. */ for (i = 0, send_size = 0; i < http_handle->header_iovcnt; i++) { iov = globus_fifo_dequeue(&iovecs); globus_assert(iov != NULL); http_handle->header_iovec[i].iov_base = iov->iov_base; http_handle->header_iovec[i].iov_len = iov->iov_len; send_size += iov->iov_len; globus_libc_free(iov); } if (op == NULL) { result = globus_xio_driver_operation_create( &op, http_handle->handle); free_op = GLOBUS_TRUE; if (result != GLOBUS_SUCCESS) { goto free_headers_exit; } } /* Stash user buffer info until we've sent response headers */ http_handle->write_operation.operation = op; http_handle->write_operation.iov = (globus_xio_iovec_t *) iovec; http_handle->write_operation.iovcnt = iovec_count; http_handle->write_operation.wait_for = 0; result = globus_xio_driver_pass_write( http_handle->write_operation.operation, http_handle->header_iovec, http_handle->header_iovcnt, send_size, globus_l_xio_http_server_write_response_callback, http_handle); if (result != GLOBUS_SUCCESS) { goto free_operation_exit; } globus_fifo_destroy(&iovecs); if (iovec_count == 0) { http_handle->send_state = GLOBUS_XIO_HTTP_EOF; } else if (http_handle->response_info.headers.transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED) { http_handle->send_state = GLOBUS_XIO_HTTP_CHUNK_BODY; } else { http_handle->send_state = GLOBUS_XIO_HTTP_IDENTITY_BODY; } return GLOBUS_SUCCESS; free_operation_exit: if (free_op) { globus_xio_driver_operation_destroy( http_handle->write_operation.operation); } free_headers_exit: http_handle->write_operation.operation = NULL; http_handle->write_operation.driver_handle = NULL; http_handle->write_operation.iov = NULL; http_handle->write_operation.iovcnt = 0; http_handle->write_operation.wait_for = 0; for (i = 0; i < http_handle->header_iovcnt; i++) { globus_libc_free(http_handle->header_iovec[i].iov_base); } globus_libc_free(http_handle->header_iovec); http_handle->header_iovec = NULL; http_handle->header_iovcnt = 0; free_iovecs_error: while (!globus_fifo_empty(&iovecs)) { iov = globus_fifo_dequeue(&iovecs); globus_libc_free(iov->iov_base); globus_libc_free(iov); } globus_fifo_destroy(&iovecs); if (size_buffer != NULL) { free(size_buffer); } error_exit: return result; } /* globus_i_xio_http_server_write_response() */ /** * Callback after writing response * @ingroup globus_i_xio_http_server * * Frees the iovec array associated with the response and then if * writing user data was used to trigger the response, write it to the * transport. If an error occurs while writing, the operation will be * finished. If the response was triggered by the * GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY control, then the operation * is simply destroyed. * * @return void */ static void globus_l_xio_http_server_write_response_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; int i; globus_mutex_lock(&http_handle->mutex); for (i = 0; i < http_handle->header_iovcnt; i++) { globus_libc_free(http_handle->header_iovec[i].iov_base); } globus_libc_free(http_handle->header_iovec); http_handle->header_iovec = NULL; http_handle->header_iovcnt = 0; if (http_handle->write_operation.iovcnt > 0) { /* User data to be sent */ if (http_handle->response_info.headers.transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED) { result = globus_i_xio_http_write_chunk( http_handle, http_handle->write_operation.iov, http_handle->write_operation.iovcnt, op); } else { result = globus_xio_driver_pass_write( op, http_handle->write_operation.iov, http_handle->write_operation.iovcnt, globus_xio_operation_get_wait_for(op), globus_i_xio_http_write_callback, http_handle); } if (result != GLOBUS_SUCCESS) { globus_xio_driver_finished_write(op, result, 0); http_handle->write_operation.operation = NULL; http_handle->write_operation.driver_handle = NULL; } } else { /* destroy synthesized operation */ globus_xio_driver_operation_destroy( http_handle->write_operation.operation); http_handle->write_operation.operation = NULL; http_handle->write_operation.driver_handle = NULL; } if (http_handle->close_operation != NULL) { result = globus_xio_driver_pass_close( http_handle->close_operation, globus_i_xio_http_close_callback, http_handle); globus_mutex_unlock(&http_handle->mutex); if (result != GLOBUS_SUCCESS) { globus_i_xio_http_close_callback( http_handle->close_operation, result, http_handle); } } else { http_handle->parse_state = GLOBUS_XIO_HTTP_PRE_REQUEST_LINE; globus_mutex_unlock(&http_handle->mutex); } return; } /* globus_l_xio_http_server_write_response_callback() */ /** * Parse an HTTP request * @ingroup globus_i_xio_http_server * * Parses the HTTP request line and then uses globus_i_xio_http_header_parse() * to parse the header bock .If the entire request header section is reqad, the * boolean pointed to by @a done will be modified to be GLOBUS_TRUE * * Called with mutex locked. * * @param http_handle * @param done * * @return * This function returns GLOBUS_SUCCESS, GLOBUS_XIO_HTTP_ERROR_PARSE, or * GLOBUS_XIO_ERROR_MEMORY. Other errors may be generated from * globus_i_xio_http_header_parse() * * @retval GLOBUS_SUCCESS * No parsing errors occurred while parsing the status line or headers. * Parsing may still be incomplete, depending on the final value of @a * done. * @retval ::GLOBUS_XIO_HTTP_ERROR_PARSE * Parse error reading the HTTP request line * @retval GLOBUS_XIO_ERROR_MEMORY * Parsing failed because of memory constraints. */ static globus_result_t globus_l_xio_http_server_parse_request( globus_i_xio_http_handle_t * http_handle, globus_bool_t * done) { globus_result_t result; char * eol; char * current_offset; int parsed; int rc; int http_major; int http_minor; GlobusXIOName(globus_l_xio_http_server_parse_request); if (http_handle->parse_state == GLOBUS_XIO_HTTP_REQUEST_LINE) { /* * Make sure any old request info has been freed so we don't leak here * when reusing a handle (or have old headers around) */ globus_i_xio_http_request_destroy(&http_handle->request_info); result = globus_i_xio_http_request_init(&http_handle->request_info); if (result != GLOBUS_SUCCESS) { goto error_exit_init; } /* Parse the request line: * * Method SP Request-URI SP HTTP-Version CRLF */ current_offset = ((char *) (http_handle->read_buffer.iov_base)) + http_handle->read_buffer_offset; eol = globus_i_xio_http_find_eol( current_offset, http_handle->read_buffer_valid); if (eol == NULL) { *done = GLOBUS_FALSE; return GLOBUS_SUCCESS; } *eol = '\0'; rc = sscanf(current_offset, "%*s %n", &parsed); if (rc < 0) { result = GlobusXIOHttpErrorParse("Method", current_offset); goto error_exit; } http_handle->request_info.method = globus_libc_malloc(parsed+1); if (http_handle->request_info.method == NULL) { result = GlobusXIOErrorMemory("method"); goto error_exit; } rc = sscanf(current_offset, "%s ", http_handle->request_info.method); globus_assert(rc == 1); current_offset += parsed; rc = sscanf(current_offset, "%*s %n", &parsed); if (rc < 0) { result = GlobusXIOHttpErrorParse("Request-URI", current_offset); goto error_exit; } http_handle->request_info.uri = globus_libc_malloc(parsed+1); if (http_handle->request_info.uri == NULL) { result = GlobusXIOErrorMemory("uri"); goto error_exit; } rc = sscanf(current_offset, "%s ", http_handle->request_info.uri); globus_assert(rc == 1); current_offset += parsed; rc = sscanf(current_offset, "HTTP/%d.%d", &http_major, &http_minor); if (rc < 2) { result = GlobusXIOHttpErrorParse("Http-Version", current_offset); goto error_exit; } http_handle->request_info.http_version = globus_i_xio_http_guess_version(http_major, http_minor); /* Set current offset to end of CRLF at the end of this line */ current_offset = eol+2; parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; http_handle->parse_state = GLOBUS_XIO_HTTP_HEADERS; } return globus_i_xio_http_header_parse(http_handle, done); error_exit: parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); /* Chop of what we managed to parse from the buffer */ http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; error_exit_init: return result; } /* globus_l_xio_http_server_parse_request() */ void globus_i_xio_http_server_read_request_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_bool_t done; globus_result_t eof_result = GLOBUS_SUCCESS; globus_i_xio_http_attr_t * descriptor; globus_bool_t registered_again = GLOBUS_FALSE; GlobusXIOName(globus_i_xio_http_server_read_request_callback); globus_mutex_lock(&http_handle->mutex); if (result != GLOBUS_SUCCESS) { if (globus_xio_error_is_eof(result)) { eof_result = result; } else { goto error_exit; } } /* Haven't parsed request and headers yet */ http_handle->read_buffer_valid += nbytes; result = globus_l_xio_http_server_parse_request(http_handle, &done); if (result == GLOBUS_SUCCESS && !done) { goto reregister_read; } else if (result != GLOBUS_SUCCESS) { goto error_exit; } /* Determine whether we should expect an entity along with the * request */ if ((http_handle->request_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_1) && (http_handle->request_info.headers.transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED)) { http_handle->parse_state = GLOBUS_XIO_HTTP_CHUNK_LINE; } else if (GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET( &http_handle->request_info.headers)) { http_handle->parse_state = GLOBUS_XIO_HTTP_IDENTITY_BODY; } if (GLOBUS_I_XIO_HTTP_HEADER_IS_CONNECTION_CLOSE( &http_handle->request_info.headers)) { http_handle->response_info.headers.flags |= GLOBUS_I_XIO_HTTP_HEADER_CONNECTION_CLOSE; } http_handle->send_state = GLOBUS_XIO_HTTP_STATUS_LINE; descriptor = globus_xio_operation_get_data_descriptor(op, GLOBUS_TRUE); if (descriptor == NULL) { result = GlobusXIOErrorMemory("descriptor"); goto error_exit; } globus_i_xio_http_request_destroy(&descriptor->request); result = globus_i_xio_http_request_copy( &descriptor->request, &http_handle->request_info); if (result != GLOBUS_SUCCESS) { goto error_exit; } result = globus_i_xio_http_parse_residue(http_handle, ®istered_again); if ((http_handle->read_operation.wait_for <= 0 && !registered_again) || result != GLOBUS_SUCCESS) { if (http_handle->response_info.headers.transfer_encoding != GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET( &http_handle->response_info.headers) && http_handle->response_info.headers.content_length == 0) { /* Synthesize EOF if we've read all of the entity content */ result = GlobusXIOErrorEOF(); } /* * Either we've read enough, hit end of chunk, no entity was present, * or pass to transport failed. Call finished_read */ nbytes = http_handle->read_operation.nbytes; globus_libc_free(http_handle->read_operation.iov); http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_read(op, result, nbytes); return; } else if (registered_again) { globus_mutex_unlock(&http_handle->mutex); return; } /* FALLSTHROUGH */ reregister_read: globus_assert(op == http_handle->read_operation.operation); if (eof_result != GLOBUS_SUCCESS) { /* Header block wasn't complete before eof */ result = eof_result; goto error_exit; } result = globus_i_xio_http_clean_read_buffer(http_handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } result = globus_xio_driver_pass_read( op, &http_handle->read_iovec, 1, 1, globus_i_xio_http_server_read_request_callback, http_handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } globus_mutex_unlock(&http_handle->mutex); return; error_exit: globus_libc_free(http_handle->read_operation.iov); http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_read(op, result, 0); } /* globus_i_xio_http_server_read_request_callback() */ globus_xio-3.6/builtins/http/globus_xio_http_response.c0000666000076400007640000001002010363625124020567 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_response Internal Response Implementation */ #endif /** * Initialize an HTTP response * @ingroup globus_i_xio_http_response * * All fields of this response will be set to their default values. If * this function returns a failure, the response should be considered * uninitialized. * * @param response * Response structure to initialize. * * @return * This function returns GLOBUS_SUCCESS, or a result from * globus_i_xio_http_header_info_init(). * @retval GLOBUS_SUCCESS * Response initialized */ globus_result_t globus_i_xio_http_response_init( globus_i_xio_http_response_t * response) { globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_i_xio_http_response_init); memset(response, '\0', sizeof(globus_i_xio_http_response_t)); res = globus_i_xio_http_header_info_init(&response->headers); response->status_code = 200; return res; } /* globus_i_xio_http_response_init() */ /** * Destroy an HTTP response * @ingroup globus_i_xio_http_response * * All fields of this response will be freed. * * @param response * Response structure to destroy. * * @return void */ void globus_i_xio_http_response_destroy( globus_i_xio_http_response_t * response) { response->status_code = 0; if (response->reason_phrase != NULL) { globus_libc_free(response->reason_phrase); response->reason_phrase = NULL; } response->http_version = GLOBUS_XIO_HTTP_VERSION_UNSET; globus_i_xio_http_header_info_destroy(&response->headers); } /* globus_i_xio_http_response_destroy() */ /** * Copy the contents of an HTTP response * @ingroup globus_i_xio_http_response * * All values associated with the @a src response will be copied * to the corresponding fields of the @a dest response. If this function * returns a failure, then the @a dest should be considered uninitialized. * * @param dest * Response to be initialized with values from src. This should * not be initialized before this is called, or memory may be * leaked. * @param src * Response containing known values. * * @retval GLOBUS_SUCCESS * Response successfully copied. * @retval GLOBUS_XIO_ERROR_MEMORY * Response copy failed due to memory constraints. */ globus_result_t globus_i_xio_http_response_copy( globus_i_xio_http_response_t * dest, const globus_i_xio_http_response_t *src) { globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_i_xio_http_response_copy); dest->status_code = src->status_code; if (src->reason_phrase == NULL) { dest->reason_phrase = NULL; } else { dest->reason_phrase = globus_libc_strdup(src->reason_phrase); if (dest->reason_phrase == NULL) { res = GlobusXIOErrorMemory("reason_phrase"); goto error_exit; } } dest->http_version = src->http_version; res = globus_i_xio_http_header_info_copy( &dest->headers, &src->headers); if (res != GLOBUS_SUCCESS) { goto free_reason_phrase_exit; } return res; free_reason_phrase_exit: if (dest->reason_phrase != NULL) { globus_libc_free(dest->reason_phrase); dest->reason_phrase = NULL; } error_exit: return res; } /* globus_i_xio_http_response_copy() */ globus_xio-3.6/builtins/http/globus_xio_http_rfc2616.c0000666000076400007640000000242410363625124020033 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #include "globus_i_xio_http_responses.h" extern const char * globus_i_xio_http_lookup_reason( int code) { char code_str[4]; int i; if (code < 100 || code > 599) { return "Unknown status"; } sprintf(&code_str[0], "%d", code); for (i = 0; i < GLOBUS_XIO_ARRAY_LENGTH(globus_l_http_descriptions); i+=2) { if (strcmp(code_str, globus_l_http_descriptions[i]) == 0) { return globus_l_http_descriptions[i+1]; } } return "Unknown status"; } /* globus_i_xio_http_lookup_reason() */ globus_xio-3.6/builtins/http/globus_xio_http_request.c0000666000076400007640000001014410363625124020430 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_request Internal Request Implementation */ #endif /** * Initialize an HTTP request * @ingroup globus_i_xio_http_request * * All fields of this request will be set to their default values. If * this function returns a failure, the request should be considered * uninitialized. * * @param request * Request structure to initialize. * * @retval GLOBUS_SUCCESS * Request initialized * @retval GLOBUS_XIO_ERROR_MEMORY * Request initialization failed due to memory constraints. */ globus_result_t globus_i_xio_http_request_init( globus_i_xio_http_request_t * request) { memset(request, '\0', sizeof(globus_i_xio_http_request_t)); return globus_i_xio_http_header_info_init(&request->headers); } /* globus_i_xio_http_request_init() */ /** * Destroy an HTTP request * @ingroup globus_i_xio_http_request * * All fields of this request will be freed. * * @param request * Request structure to destroy. * * @return void */ void globus_i_xio_http_request_destroy( globus_i_xio_http_request_t * request) { globus_i_xio_http_header_info_destroy(&request->headers); if (request->uri != NULL) { globus_libc_free(request->uri); request->uri = NULL; } if (request->method != NULL) { globus_libc_free(request->method); request->method = NULL; } request->http_version = GLOBUS_XIO_HTTP_VERSION_UNSET; } /* globus_i_xio_http_request_destroy() */ /** * Copy the contents of an HTTP request * @ingroup globus_i_xio_http_request * * All values associated with the @a src request will be copied * to the corresponding fields of the @a dest request. If this function * returns a failure, then the @a dest should be considered uninitialized. * * @param dest * Request to be initialized with values from src. This should * not be initialized before this is called, or memory may be * leaked. * @param src * Request containing known values. * * @retval GLOBUS_SUCCESS * Request successfully copied. * @retval GLOBUS_XIO_ERROR_MEMORY * Request copy failed due to memory constraints. */ globus_result_t globus_i_xio_http_request_copy( globus_i_xio_http_request_t * dest, const globus_i_xio_http_request_t * src) { globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_i_xio_http_request_copy); if (src->uri == NULL) { dest->uri = NULL; } else { dest->uri = globus_libc_strdup(src->uri); if (dest->uri == NULL) { res = GlobusXIOErrorMemory("uri"); goto error_exit; } } if (src->method == NULL) { dest->method = NULL; } else { dest->method = globus_libc_strdup(src->method); if (dest->method == NULL) { res = GlobusXIOErrorMemory("method"); goto free_uri_exit; } } dest->http_version = src->http_version; res = globus_i_xio_http_header_info_copy( &dest->headers, &src->headers); if (res != GLOBUS_SUCCESS) { goto free_method_exit; } return res; free_method_exit: if (dest->method) { globus_libc_free(dest->method); dest->method = NULL; } free_uri_exit: if (dest->uri) { globus_libc_free(dest->uri); dest->uri = NULL; } error_exit: return res; } /* globus_i_xio_http_request_copy() */ globus_xio-3.6/builtins/http/globus_i_xio_http.h0000666000076400007640000006012111006134627017173 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_I_XIO_HTTP_H #define GLOBUS_I_XIO_HTTP_H 1 #include "globus_xio.h" #include "globus_xio_driver.h" #include "globus_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL enum { GLOBUS_XIO_HTTP_CHUNK_SIZE = 128 }; typedef enum { GLOBUS_XIO_HTTP_TRANSFER_ENCODING_DEFAULT, GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY, GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED } globus_i_xio_http_transfer_encoding_t; typedef enum { GLOBUS_XIO_HTTP_PRE_REQUEST_LINE, GLOBUS_XIO_HTTP_REQUEST_LINE, GLOBUS_XIO_HTTP_STATUS_LINE, GLOBUS_XIO_HTTP_HEADERS, GLOBUS_XIO_HTTP_CHUNK_CRLF, GLOBUS_XIO_HTTP_CHUNK_LINE, GLOBUS_XIO_HTTP_CHUNK_FOOTERS, GLOBUS_XIO_HTTP_CHUNK_BODY, GLOBUS_XIO_HTTP_IDENTITY_BODY, GLOBUS_XIO_HTTP_EOF, GLOBUS_XIO_HTTP_CLOSE } globus_i_xio_http_parse_state_t; typedef struct { struct globus_i_xio_http_handle_s * http_handle; globus_xio_operation_t user_read_op; globus_xio_operation_t internal_op; globus_xio_driver_handle_t driver_handle; } globus_i_xio_http_cancellation_t; #define GLOBUS_XIO_HTTP_COPY_BLOB(fifo, blob, len, label) \ do { \ result = globus_i_xio_http_copy_blob(fifo, blob, len); \ if (result != GLOBUS_SUCCESS) \ { \ goto label; \ } \ } while (0); typedef struct { /** * Copy of iovec array registered by user. */ globus_xio_iovec_t * iov; /** * Number of iovecs in the iov. */ globus_size_t iovcnt; /** * Operation associated with user's read or write. */ globus_xio_operation_t operation; /** * Driver handle associated with the operation */ globus_xio_driver_handle_t driver_handle; /** * Number of bytes copied into user buffers already (for residue handling * in reads). */ globus_size_t nbytes; /** * Wait for remainder for operation. */ int wait_for; /** * buffer to hold the chunk size line */ globus_byte_t chunk_size_buffer[64]; } globus_i_xio_http_operation_info_t; #define GLOBUS_XIO_ARRAY_LENGTH(x) (sizeof(x)/sizeof(x[0])) #if BUILD_DEBUG #define GLOBUS_XIO_HTTP_TODO(msg) \ do { \ globus_libc_fprintf(stderr, "TODO: %s\n", msg); \ } while (0); #else #define GLOBUS_XIO_HTTP_TODO(msg) \ do { \ globus_libc_fprintf(stderr, "TODO: %s\n", msg); \ abort(); \ } while (0); #endif /** * Target-specific data */ typedef struct { /** * GLOBUS_TRUE when this is the client side of the connection. * GLOBUS_FALSE when this is the server side of the connection. */ globus_bool_t is_client; /** * Host name to connecting to. */ char * host; /** * Port connecting to */ unsigned short port; /** * URI path to access. */ char * uri; } globus_i_xio_http_target_t; typedef enum { /** * Body needed flag * * This should be set when the request or response requires that a entity * be sent along with the request, and that has not yet been done. * This should be unset when the request does not require a entity, or * it has already been sent, or some error prevents it from being sent. */ GLOBUS_I_XIO_HTTP_HEADER_ENTITY_NEEDED = 1 << 0, /** * Content-Length header was supplied. */ GLOBUS_I_XIO_HTTP_HEADER_CONTENT_LENGTH_SET = 1 << 1, /** * Connection will be closed after response flag. */ GLOBUS_I_XIO_HTTP_HEADER_CONNECTION_CLOSE = 1 << 2 } globus_i_xio_http_header_flags_t; /** Flag accessor */ /*@{*/ #define GLOBUS_I_XIO_HTTP_HEADER_IS_ENTITY_NEEDED(header) \ ((header)->flags & GLOBUS_I_XIO_HTTP_HEADER_ENTITY_NEEDED) #define GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(header) \ ((header)->flags & GLOBUS_I_XIO_HTTP_HEADER_CONTENT_LENGTH_SET) #define GLOBUS_I_XIO_HTTP_HEADER_IS_CONNECTION_CLOSE(header) \ ((header)->flags & GLOBUS_I_XIO_HTTP_HEADER_CONNECTION_CLOSE) /*@}*/ /** * Internal information about a header set for a request or response. */ typedef struct { /** * HTTP Headers * * Each entry in the hashtable is keyed by a char * containing the * header name, and the value of the hashtable entries are of type * #globus_xio_http_string_pair_t */ globus_hashtable_t headers; /** * Content-Length header's value, if present */ globus_size_t content_length; /** * Transfer-Encoding header's value, if present. */ globus_i_xio_http_transfer_encoding_t transfer_encoding; /** * Special processing headers present */ globus_i_xio_http_header_flags_t flags; } globus_i_xio_http_header_info_t; /** * Client-generated request information. * * This is used in the HTTP attr and in the driver driver-specific data * associated with a driver operation. */ typedef struct { /** * URI Path * * This value will overrides the path in the globus_xio_contact_t passed * to the target initialization function. If not set, the path in * the contact will be used. * be */ char * uri; /** * HTTP Method * * This value will set the HTTP method (GET, PUT, POST, etc) to be * used by the client to access the URI. If not set, the default of * GET will be used. */ char * method; /** * HTTP Version * * This value will set the HTTP version number to * used by the client to access the URI. If not set, the default of * GLOBUS_XIO_HTTP_VERSION_1_1 will be used. */ globus_xio_http_version_t http_version; /** * Information about headers associated with this request */ globus_i_xio_http_header_info_t headers; } globus_i_xio_http_request_t; /** * All server-generated response information. * * This is used in the HTTP driver-specific data associated with a driver * operation. */ typedef struct { /** * HTTP status code * * Defaults to 200. See RFC 2616 for details. */ int status_code; /** * HTTP reason phrase * * Defaults to string corresponding to status code, * as described in RFC 2616. */ char * reason_phrase; /** * HTTP Version * * This value will set the HTTP version number to * used by the server in its response. If not set, the default of * GLOBUS_XIO_HTTP_VERSION_1_1 will be used. */ globus_xio_http_version_t http_version; /** * Information about headers associated with this request */ globus_i_xio_http_header_info_t headers; } globus_i_xio_http_response_t; typedef struct globus_i_xio_http_handle_s { /** * Information about the target this handle is associated with. */ globus_i_xio_http_target_t target_info; /** * Information about the request this handle is associated with */ globus_i_xio_http_request_t request_info; /** * Information about the response to the request this handle * is associated with */ globus_i_xio_http_response_t response_info; /** * Driver handle associated with this HTTP handle */ globus_xio_driver_handle_t handle; /** * Dynamically allocated array of iovecs for sending headers. */ globus_xio_iovec_t * header_iovec; /** * Length of header iovec. */ int header_iovcnt; /** * Iovec for reading request/response header information. */ globus_xio_iovec_t read_buffer; /** * Iovec containing part of the read_buffer which aren't busy with * unparsed data. */ globus_xio_iovec_t read_iovec; /** * Beginning of unparsed data in the @a read_buffer. */ globus_size_t read_buffer_offset; /** * Number of bytes in the @a read_buffer after the offset which * contain unparsed data */ globus_size_t read_buffer_valid; /** * Operation used for closing, when an error occurs at open time. */ globus_xio_operation_t close_operation; /** * Remaining-to-be-read chunk. */ globus_size_t read_chunk_left; /** Flag indicating whether to delay writing request lines until first * data write is done instead of at open time. */ globus_bool_t delay_write_header; /** If delaying write for the client, this will contain the * first data set to write */ const globus_xio_iovec_t * first_write_iovec; /** * Number of iovecs in the first_write_iovec array. */ int first_write_iovec_count; /** * Current state of the HTTP parser for reading data. */ globus_i_xio_http_parse_state_t parse_state; /** * Current state of the HTTP parser for writing data. */ globus_i_xio_http_parse_state_t send_state; /** * Read operation to process response on the client side. This * operation is created when the request write is first registered * so that if an error occurs we can cut things off. */ globus_xio_operation_t response_read_operation; globus_i_xio_http_operation_info_t read_operation; globus_i_xio_http_operation_info_t write_operation; /** * Flag indicating whether close was called on this handle. */ globus_bool_t user_close; /** * Flag indicating whether the client has received the data descriptor * with the response yet. */ globus_bool_t read_response; /** * Lock for thread-safety */ globus_mutex_t mutex; /** * Cancellation info */ globus_i_xio_http_cancellation_t * cancellation; /** * Set to true if a connection is reused, so that we can * return a "persistent connection" error if the server * drops us */ globus_bool_t reopen_in_progress; } globus_i_xio_http_handle_t; /** * XIO Attributes for HTTP * This structure is used as both the attributes to open and the data * descriptors returned from various read or write operations. */ typedef struct { /* attrs for client side */ globus_i_xio_http_request_t request; globus_bool_t delay_write_header; /* only one attr for server side for now*/ globus_i_xio_http_response_t response; } globus_i_xio_http_attr_t; /* globus_xio_http.c */ extern globus_result_t globus_i_xio_http_copy_blob( globus_fifo_t * fifo, const char * blob, size_t len); extern char * globus_i_xio_http_find_eol( const char * blob, globus_size_t blob_length); extern globus_bool_t globus_i_xio_http_method_requires_entity( const char * method); extern globus_xio_http_version_t globus_i_xio_http_guess_version( int major_version, int minor_version); extern globus_result_t globus_i_xio_http_clean_read_buffer( globus_i_xio_http_handle_t * http_handle); /* globus_xio_http_attr.c */ extern globus_result_t globus_i_xio_http_attr_init( void ** out_attr); extern globus_result_t globus_i_xio_http_attr_cntl( void * driver_attr, int cmd, va_list ap); extern globus_result_t globus_i_xio_http_attr_copy( void ** dst, void * src); extern globus_result_t globus_i_xio_http_attr_destroy( void * driver_attr); /* globus_xio_http_client.c */ extern globus_result_t globus_i_xio_http_client_write_request( globus_xio_operation_t op, globus_i_xio_http_handle_t * http_handle); extern void globus_i_xio_http_client_open_callback( globus_xio_operation_t op, globus_result_t result, void * user_arg); /* globus_xio_http_handle.c */ extern globus_result_t globus_i_xio_http_handle_init( globus_i_xio_http_handle_t * http_handle, globus_i_xio_http_attr_t * attr, globus_i_xio_http_target_t * target); extern globus_result_t globus_i_xio_http_handle_reinit( globus_i_xio_http_handle_t * http_handle, globus_i_xio_http_attr_t * http_attr, globus_i_xio_http_target_t * http_target); extern void globus_i_xio_http_handle_destroy( globus_i_xio_http_handle_t * http_handle); extern globus_result_t globus_i_xio_http_handle_cntl( void * handle, int cmd, va_list ap); extern globus_result_t globus_i_xio_http_set_end_of_entity( globus_i_xio_http_handle_t * http_handle); /* globus_xio_http_header.c */ extern void globus_i_xio_http_header_copy( void ** dest_key, void ** dest_datum, void * src_key, void * src_datum); extern void globus_i_xio_http_header_destroy( void * header); extern globus_result_t globus_i_xio_http_header_parse( globus_i_xio_http_handle_t * handle, globus_bool_t * done); /* globus_xio_http_header_info.c */ extern globus_result_t globus_i_xio_http_header_info_init( globus_i_xio_http_header_info_t * headers); extern void globus_i_xio_http_header_info_destroy( globus_i_xio_http_header_info_t * headers); extern globus_result_t globus_i_xio_http_header_info_copy( globus_i_xio_http_header_info_t * dest, const globus_i_xio_http_header_info_t * src); extern globus_result_t globus_i_xio_http_header_info_set_header( globus_i_xio_http_header_info_t * headers, const char * header_name, const char * header_value); /* globus_xio_http_rfc2616.c */ extern const char * globus_i_xio_http_lookup_reason( int code); /* globus_xio_http_target.c */ extern globus_i_xio_http_target_t * globus_i_xio_http_target_new(void); extern globus_result_t globus_i_xio_http_target_destroy( void * driver_target); extern void globus_i_xio_http_target_destroy_internal( globus_i_xio_http_target_t * target); /* globus_xio_http_request_t */ extern globus_result_t globus_i_xio_http_request_init( globus_i_xio_http_request_t * request); extern globus_result_t globus_i_xio_http_request_copy( globus_i_xio_http_request_t * dest, const globus_i_xio_http_request_t * src); extern void globus_i_xio_http_request_destroy( globus_i_xio_http_request_t * request); /* globus_xio_http_response.c */ extern globus_result_t globus_i_xio_http_response_init( globus_i_xio_http_response_t * response); extern globus_result_t globus_i_xio_http_response_copy( globus_i_xio_http_response_t * dest, const globus_i_xio_http_response_t *src); extern void globus_i_xio_http_response_destroy( globus_i_xio_http_response_t * response); /* globus_xio_http_server.c */ extern void globus_i_xio_http_server_read_request_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); extern globus_result_t globus_i_xio_http_accept( void * driver_server, globus_xio_operation_t accept_op); extern void globus_i_xio_http_server_open_callback( globus_xio_operation_t op, globus_result_t result, void * user_arg); extern globus_result_t globus_i_xio_http_server_write_response( globus_i_xio_http_handle_t * http_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op); extern globus_result_t globus_i_xio_http_server_read_next_request( globus_i_xio_http_handle_t * http_handle); /* globus_xio_http_target.c */ extern globus_result_t globus_i_xio_http_target_init( globus_i_xio_http_target_t ** out_target, const globus_xio_contact_t * contact_info); extern globus_result_t globus_i_xio_http_target_copy( globus_i_xio_http_target_t * dest, const globus_i_xio_http_target_t * src); /* globus_xio_http_transform.c */ extern globus_list_t * globus_i_xio_http_cached_handles; extern globus_mutex_t globus_i_xio_http_cached_handle_mutex; extern globus_list_t * globus_i_xio_http_cancellable_handles; extern globus_mutex_t globus_i_xio_http_cancel_mutex; extern globus_result_t globus_i_xio_http_open( const globus_xio_contact_t * contact_info, void * link, void * attr, globus_xio_operation_t op); extern globus_result_t globus_i_xio_http_read( void * handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op); extern globus_result_t globus_i_xio_http_write( void * handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op); extern globus_result_t globus_i_xio_http_parse_residue( globus_i_xio_http_handle_t * handle, globus_bool_t * registered_again); extern globus_result_t globus_i_xio_http_write_chunk( globus_i_xio_http_handle_t * http_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op); extern void globus_i_xio_http_write_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); extern globus_result_t globus_i_xio_http_close( void * handle, void * attr, globus_xio_operation_t op); extern globus_result_t globus_i_xio_http_close_internal( globus_i_xio_http_handle_t * http_handle); extern void globus_i_xio_http_close_callback( globus_xio_operation_t operation, globus_result_t result, void * handle); GlobusXIODeclareModule(http); #define GLOBUS_XIO_HTTP_MODULE GlobusXIOMyModule(http) #define GlobusXIOHttpErrorObjParse(token, context) \ globus_error_construct_error( \ GLOBUS_XIO_HTTP_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_HTTP_ERROR_PARSE, \ __FILE__, \ _xio_name, \ __LINE__, \ "Error parsing %s token at %s", \ token, context) #define GlobusXIOHttpErrorParse(token, context) \ globus_error_put( \ GlobusXIOHttpErrorObjParse(token, context)) #define GlobusXIOHttpErrorObjInvalidHeader(name, value) \ globus_error_construct_error( \ GLOBUS_XIO_HTTP_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_HTTP_ERROR_INVALID_HEADER, \ __FILE__, \ _xio_name, \ __LINE__, \ "Invalid %s header value %s", \ name, value) #define GlobusXIOHttpErrorInvalidHeader(name, value) \ globus_error_put( \ GlobusXIOHttpErrorObjInvalidHeader(name, value)) #define GlobusXIOHttpErrorObjNoEntity() \ globus_error_construct_error( \ GLOBUS_XIO_HTTP_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_HTTP_ERROR_NO_ENTITY, \ __FILE__, \ _xio_name, \ __LINE__, \ "No entity to read or write") #define GlobusXIOHttpErrorNoEntity() \ globus_error_put( \ GlobusXIOHttpErrorObjNoEntity()) #define GlobusXIOHttpErrorObjEOF() \ globus_error_construct_error( \ GLOBUS_XIO_HTTP_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_HTTP_ERROR_EOF, \ __FILE__, \ _xio_name, \ __LINE__, \ "End of Entity") #define GlobusXIOHttpErrorEOF() \ globus_error_put( \ GlobusXIOHttpErrorObjEOF()) #define GlobusXIOHttpErrorPersistentConnectionDropped(cause) \ globus_error_put( \ GlobusXIOHTTPErrorObjPersistentConnectionDropped(cause)) #define GlobusXIOHTTPErrorObjPersistentConnectionDropped(cause) \ globus_error_construct_error( \ GLOBUS_XIO_HTTP_MODULE, \ cause, \ GLOBUS_XIO_HTTP_ERROR_PERSISTENT_CONNECTION_DROPPED, \ __FILE__, \ _xio_name, \ __LINE__, \ "Persistent connection dropped") #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ #endif /* GLOBUS_I_XIO_HTTP_H */ globus_xio-3.6/builtins/http/globus_xio_http.h0000666000076400007640000004226111522621706016672 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined GLOBUS_XIO_DRIVER_HTTP_H #define GLOBUS_XIO_DRIVER_HTTP_H 1 /** * @file globus_xio_http.h Globus XIO HTTP Driver Header */ #include "globus_xio.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL EXTERN_C_BEGIN #endif /** * @defgroup http_driver Globus XIO HTTP Driver * This driver implements the HTTP/1.0 and HTTP/1.1 protocols within * the Globus XIO framework. It may be used with the tcp driver for * the standard HTTP protocol stack, or may be combined with the gsi * driver for a HTTPS implementation. * * This implementation supports user-defined HTTP headers, persistent * connections, and chunked transfer encoding. */ /** * @defgroup http_driver_instance Opening/Closing * @ingroup http_driver * * An XIO handle with the http driver can be created with either * @ref globus_xio_handle_create() or * @ref globus_xio_server_register_accept(). * * If the handle is created with * @ref globus_xio_server_register_accept(), then an HTTP service handle * will be created when @ref globus_xio_register_open() is called. The XIO * application must call one of the functions in the @ref globus_xio_read() * family to receive the HTTP request metadata. This metadata will be returned * in the data descriptor associated with that first read: the application * should use the GLOBUS_XIO_HTTP_GET_REQUEST descriptor cntl to extract * this metadata. * * If the handle is created with @ref globus_xio_handle_create(), then * an HTTP client handle will be created when * @ref globus_xio_register_open() is called. HTTP request headers, version and * method may be chosen by setting attributes. */ /** * @defgroup http_driver_io Reading/Writing * @ingroup http_driver * * The HTTP driver behaves similar to the underlying transport driver * with respect to reads and writes with the exception that metadata must * be passed to the handle via open attributes on the client side and will * be received as data descriptors as part of the first request read or * response read. */ /** * @defgroup http_driver_server Server * @ingroup http_driver * * The @ref globus_xio_server_create() causes a new transport-specific * listener socket to be created to handle new HTTP connections. * @ref globus_xio_server_register_accept() will accept a new * connection for processing. @ref globus_xio_server_register_close() * cleans up the internal resources associated with the http server * and calls close on the listener. * * Multiple HTTP requests may be read in sequence from an HTTP * server. After each request is processed and the response is sent (either by * writing the entire entity body as specified by the Content-Length header or * by using the GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY handle cntl), the next * read will contain the metadata related to the next operation. * Only one request will be in process at once--the previous request must have * sent or received and EOF (whichever is applicable to the request type). */ /** * @defgroup http_driver_cntls Attributes and Cntls * @ingroup http_driver * * HTTP driver specific attrs and cntls. * * @see globus_xio_attr_cntl() * @see globus_xio_handle_cntl() */ /** * @defgroup http_driver_errors Error Types * @ingroup http_driver * * In addition to errors generated by underlying protocol drivers, the XIO * HTTP driver defines a few error conditions specific to the HTTP protocol. * * @see globus_xio_driver_error_match() */ /** doxygen varargs filter stuff * GlobusVarArgDefine( * attr, globus_result_t, globus_xio_attr_cntl, attr, driver) * GlobusVarArgDefine( * handle, globus_result_t, globus_xio_handle_cntl, handle, driver) * GlobusVarArgDefine( * dd, globus_result_t, globus_xio_data_descriptor_cntl, dd, driver) */ /** * HTTP Header * @ingroup http_driver */ typedef struct { /** Header Name */ char * name; /** Header Value */ char * value; } globus_xio_http_header_t; /** * HTTP driver specific cntls * @ingroup http_driver_cntls */ typedef enum { /** * GlobusVarArgEnum(handle) * Set the value of a response HTTP header. * @ingroup http_driver_cntls * * @param header_name * Name of the HTTP header to set. * @param header_value * Value of the HTTP header * * Certain headers will cause changes in how the HTTP protocol will * be handled. These include: * - Transfer-Encoding: {identity|chunked} * Override the default transfer encoding. If a server knows the * exact length of the message body, or does not intend to support * persistent connections, it may set this header to be * "identity".

* If this is set to "identity" and any of the following are true, then * the connection will be closed after the end of the response is sent: *

* - A Content-Length header is not present * - The HTTP version is set to "HTTP/1.0" * - The Connection header is set to "close" * Attempts to set this to "chunked" with an "HTTP/1.0" client will * fail with a GLOBUS_XIO_ERROR_HTTP_INVALID_HEADER error. * - Content-Length: 1*Digit * - Provide a content length for the response message. If the * "chunked" transfer encoding is being used, then this header * will be silently ignored by the HTTP driver. * - Connection: close * - The HTTP connection will be closed after the end of the data * response is written. * * @return This handle control function can fail with * - GLOBUS_XIO_ERROR_MEMORY * - GLOBUS_XIO_ERROR_PARAMETER * - GLOBUS_XIO_ERROR_HTTP_INVALID_HEADER */ /* const char * header_name, const char * header_value */ GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HEADER, /** GlobusVarArgEnum(handle) * Set the response status code. * @ingroup http_driver_cntls * * @param status * Value in the range 100-599 which will be used as the HTTP response * code, as per RFC 2616. * * If this cntl is not called by a server, then * the default value of 200 ("Ok") will be used. If this is called on the * client-side of an HTTP connection, the handle control will fail with a * GLOBUS_XIO_ERROR_PARAMETER error. * * @return This handle control function can fail with * - GLOBUS_XIO_ERROR_PARAMETER */ /* int status */ GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_STATUS_CODE, /** GlobusVarArgEnum(handle) * Set the response reason phrase. * @ingroup http_driver_cntls * * @param reason * The value of the HTTP response string, as per RFC 2616. * * If this cntl is not called by a server, then a default value based on * the handle's response status code will be generated. If this is called * on the client-side of an HTTP connection, the handle control will fail * with a GLOBUS_XIO_ERROR_PARAMETER error. * * @return This handle control function can fail with * - GLOBUS_XIO_ERROR_MEMORY * - GLOBUS_XIO_ERROR_PARAMETER */ /* const char * reason */ GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_REASON_PHRASE, /** GlobusVarArgEnum(handle) * Set the response HTTP version. * @ingroup http_driver_cntls * * @param version * The HTTP version to be used in the server response line. * * If this cntl is not called by a server, then the default of * GLOBUS_XIO_HTTP_VERSION_1_1 will be used, though no HTTP/1.1 features * (chunking, persistent connections, etc) will be * assumed if the client request was an HTTP/1.0 request. If this is * called on the client-side of an HTTP connection, the handle control * will fail with GLOBUS_XIO_ERROR_PARAMETER. * * @return This handle control function can fail with * - GLOBUS_XIO_ERROR_MEMORY * - GLOBUS_XIO_ERROR_PARAMETER */ /* globus_xio_http_version_t version */ GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HTTP_VERSION, /** GlobusVarArgEnum(handle) * Indicate end-of-entity for an HTTP body. * @ingroup http_driver_cntls * * HTTP clients and servers must call this command to indicate to the * driver that the entity-body which is being sent is completed. * Subsequent attempts to write data on the handle will fail. * * This handle command MUST be called on the client side of an HTTP * connection when the HTTP method is OPTIONS, POST, or PUT, or when * the open attributes indicate that an entity will be sent. This handle * command MUST be called on the server side of an HTTP request connection * when the HTTP method was OPTIONS, GET, POST, or TRACE. */ GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY, GLOBUS_XIO_HTTP_HANDLE_SET_REQUEST_HEADER } globus_xio_http_handle_cmd_t; /** * HTTP driver specific attribute and data descriptor cntls * @ingroup http_driver_cntls */ typedef enum { /** GlobusVarArgEnum(attr) * Set the HTTP method to use for a client request. * @ingroup http_driver_cntls * * @param method * The request method string ("GET", "PUT", "POST", etc) that will * be used in the HTTP request. * * If this is not set on the target before it is opened, it will default * to GET. * * This attribute is ignored when opening the server side of an HTTP * connection. * * Setting this attribute may fail with * - GLOBUS_XIO_ERROR_MEMORY * - GLOBUS_XIO_ERROR_PARAMETER */ /* const char * method */ GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_METHOD, /** GlobusVarArgEnum(attr) * Set the HTTP version to use for a client request. * @ingroup http_driver_cntls * * @param version * The HTTP version to use for the client request. * * If the client is using HTTP/1.0 in a request which will send a * request message body (such as a POST or PUT), then the client MUST set * the "Content-Length" HTTP header to be the length of the message. If * this attribute is not present, then the default of * GLOBUS_XIO_HTTP_VERSION_1_1 will be used. * * This attribute is ignored when opening the server side of an HTTP * connection. */ /* globus_xio_http_version_t version */ GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HTTP_VERSION, /** GlobusVarArgEnum(attr) * Set the value of an HTTP request header. * @ingroup http_driver_cntls * * @param header_name * Name of the HTTP header to set. * @param header_value * Value of the HTTP header * * Certain headers will cause the HTTP driver to behave differently than * normal. This must be called before * * - Transfer-Encoding: {identity|chunked} * Override the default transfer encoding. If a server knows the * exact length of the message body, or does not intend to support * persistent connections, it may set this header to be * "identity".

* If this is set to "identity" and any of the following are true, then * the connection will be closed after the end of the message is sent: *

* - A Content-Length header is not present * - The HTTP version is set to "HTTP/1.0" * - The Connection header is set to "close" * Attempts to set this to "chunked" with an "HTTP/1.0" client will * fail with a GLOBUS_XIO_ERROR_HTTP_INVALID_HEADER error. * - Content-Length: 1*Digit * - Provide a content length for the response message. If the * "chunked" transfer encoding is being used, then this header * will be silently ignored by the HTTP driver. * - Connection: close * - If present in the server response, the connection * will be closed after the end of the data response is written. * Otherwise, when persistent connections are enabled, the connection * may be left open by the driver. Persistent connections * are not yet implemented. */ /* const char * header_name, * const char * header_value */ GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HEADER, /** GlobusVarArgEnum(attr) * Delay writing HTTP request until first data write. * * If this attribute is present when opening an HTTP handle, the HTTP * request will not be sent immediately upon opening the handle. Instead, * it will be delayed until the first data write is done. This allows * other HTTP headers to be sent after the handle is opened. * * This attribute cntl takes no arguments. */ GLOBUS_XIO_HTTP_ATTR_DELAY_WRITE_HEADER, /** GlobusVarArgEnum(dd) * Get HTTP Request Information. * * Returns in the passed parameters values concerning the HTTP request. Any * of the parameters may be NULL if the application is not interested in * that part of the information. * * @param method * Pointer to be set to the HTTP request method (typically * GET, PUT, or POST). The caller must not access this value * outside of the lifetime of the data descriptor nor free it. * @param uri * Pointer to be set to the requested HTTP path. The caller must * not access this value outside of the lifetime of the data * descriptor nor free it. * @param http_version * Pointer to be set to the HTTP version used for this request. * @param headers * Pointer to be set to point to a hashtable of * globus_xio_http_header_t values, keyed by the HTTP header names. * The caller must not access this value outside of the lifetime of * the data descriptor nor free it or any values in it. */ /* char ** method, char ** uri, globus_xio_http_version_t * http_version, globus_hashtable_t * headers */ GLOBUS_XIO_HTTP_GET_REQUEST, /** GlobusVarArgEnum(dd) * Get HTTP Response Information * * Returns in the passed parameters values concerning the HTTP response. * Any of the parameters may be NULL if the application is not interested * in that part of the information. * * @param status_code * Pointer to be set to the HTTP response status code (such as 404), * as per RFC 2616. The caller must not access this value outside of * the lifetime of the data descriptor nor free it or any values in * it. * @param reason_phrase * Pointer to be set to the HTTP response reason phrase (such as Not * Found). The caller must not access this value outside of * the lifetime of the data descriptor nor free it or any values in * it. * @param http_version * Pointer to be set to the HTTP version used for this request. * @param headers * Pointer to be set to point to a hashtable of * globus_xio_http_header_t values, keyed by the HTTP header names. * The caller must not access this value outside of the lifetime of * the data descriptor nor free it or any values in it. */ /* int * status_code, char ** reason_phrase, globus_xio_http_version_t * http_version, globus_hashtable_t * headers */ GLOBUS_XIO_HTTP_GET_RESPONSE } globus_xio_http_attr_cmd_t; /** * Error types used to generate errors using the globus_error_generic module. * @ingroup http_driver_errors */ typedef enum { /** * An attempt to set a header which is not compatible with the HTTP * version being used. * @hideinitializer */ GLOBUS_XIO_HTTP_ERROR_INVALID_HEADER, /** * Error parsing HTTP protocol */ GLOBUS_XIO_HTTP_ERROR_PARSE, /** * There is no entity body to read or write. */ GLOBUS_XIO_HTTP_ERROR_NO_ENTITY, /** * Server side fake EOF */ GLOBUS_XIO_HTTP_ERROR_EOF, /** * Persistent connection dropped by the server. */ GLOBUS_XIO_HTTP_ERROR_PERSISTENT_CONNECTION_DROPPED } globus_xio_http_errors_t; /** * @ingroup http_driver * Valid HTTP versions, used with the * #GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HTTP_VERSION attribute and the * #GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HTTP_VERSION handle control */ typedef enum { GLOBUS_XIO_HTTP_VERSION_UNSET, /** * HTTP/1.0 */ GLOBUS_XIO_HTTP_VERSION_1_0, /** * HTTP/1.1 */ GLOBUS_XIO_HTTP_VERSION_1_1 } globus_xio_http_version_t; #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL EXTERN_C_END #endif #endif globus_xio-3.6/builtins/http/globus_xio_http_target.c0000666000076400007640000001325310363625124020232 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_target Internal Target Implementation */ #endif /** * Allocate a new target * @ingroup globus_i_xio_http_target */ globus_i_xio_http_target_t * globus_i_xio_http_target_new(void) { return globus_libc_calloc(1, sizeof(globus_i_xio_http_target_t)); } /* globus_l_xio_http_target_new() */ globus_result_t globus_i_xio_http_target_init( globus_i_xio_http_target_t ** out_target, const globus_xio_contact_t * contact_info) { globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_http_target_t * target; GlobusXIOName(globus_l_xio_http_target_init); target = globus_i_xio_http_target_new(); if (target == NULL) { res = GlobusXIOErrorMemory("target"); goto error_exit; } target->is_client = GLOBUS_TRUE; if (contact_info->host == NULL) { res = GlobusXIOErrorParameter("contact_info"); goto free_target_exit; } target->host = globus_libc_strdup(contact_info->host); if (target->host == NULL) { res = GlobusXIOErrorMemory("host"); goto free_target_exit; } if (contact_info->resource == NULL) { target->uri = globus_libc_strdup("/"); } else { if (contact_info->resource[0] != '/') { size_t urilen = strlen(contact_info->resource); target->uri = malloc(urilen + 2); target->uri[0] = '/'; memcpy(target->uri+1, contact_info->resource, urilen); target->uri[urilen + 1] = '\0'; } else { target->uri = globus_libc_strdup(contact_info->resource); } } if (target->uri == NULL) { goto free_target_exit; } if(contact_info->port == 0) { if(strcmp(contact_info->scheme, "http") == 0) { target->port = 80; } else if(strcmp(contact_info->scheme, "https") == 0) { target->port = 443; } else { res = GlobusXIOErrorParameter("port"); goto free_target_exit; } } else { target->port = (unsigned short) atoi(contact_info->port); } *out_target = target; return res; free_target_exit: globus_i_xio_http_target_destroy(target); error_exit: return res; } /* globus_i_xio_http_target_init() */ /** * Copy the contents of an HTTP target * @ingroup globus_i_xio_http_target * * All values associated with the @a src target will be copied into the * corresponding fields of the @a dest target. If this function returns * a failure, then the @a dest target should be considered uninitialized. * * @param dest * Target to be initialized with the values form src. This should not * be initialized before this is called, or memory may be leaked. * @param src * Target containing defined values. * * @retval GLOBUS_SUCCESS * Copy successful. * @retval GLOBUS_XIO_ERROR_MEMORY * Copy failed due to memory constraints. */ globus_result_t globus_i_xio_http_target_copy( globus_i_xio_http_target_t * dest, const globus_i_xio_http_target_t * src) { globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_i_xio_http_target_copy); dest->is_client = src->is_client; if (src->host != NULL) { dest->host = globus_libc_strdup(src->host); if (dest->host == NULL) { res = GlobusXIOErrorMemory("host"); goto error_exit; } } if (src->uri != NULL) { dest->uri = globus_libc_strdup(src->uri); if (dest->uri == NULL) { res = GlobusXIOErrorMemory("uri"); goto free_host_exit; } } dest->port = src->port; return res; free_host_exit: globus_libc_free(dest->host); dest->host = NULL; error_exit: return res; } /* globus_i_xio_http_target_copy() */ /** * Destroy an HTTP target * @ingroup globus_i_xio_http_target * * Frees all storage associated with an HTTP target. No further opens may * be alled with this target. This is called by the XIO driver via * globus_xio_target_destroy(). * * @param driver_target * Void pointer to a #globus_i_xio_http_target_t structure to be * destroyed. * * @return This function always returns GLOBUS_SUCCESS. */ globus_result_t globus_i_xio_http_target_destroy( void * driver_target) { globus_i_xio_http_target_destroy_internal(driver_target); globus_libc_free(driver_target); return GLOBUS_SUCCESS; } /* globus_i_xio_http_target_destroy() */ extern void globus_i_xio_http_target_destroy_internal( globus_i_xio_http_target_t * target) { globus_i_xio_http_target_t * http_target = target; if (http_target->host != NULL) { globus_libc_free(http_target->host); } if (http_target->uri != NULL) { globus_libc_free(http_target->uri); } } /* globus_i_xio_http_target_destroy_internal() */ globus_xio-3.6/builtins/http/Makefile.am0000666000076400007640000000165011462370274015345 00000000000000include $(top_srcdir)/globus_automake_pre Sources= \ globus_xio_http.c \ globus_xio_http_attr.c \ globus_xio_http_client.c \ globus_xio_http_handle.c \ globus_xio_http_header.c \ globus_xio_http_header_info.c \ globus_xio_http_request.c \ globus_xio_http_response.c \ globus_xio_http_rfc2616.c \ globus_xio_http_server.c \ globus_xio_http_target.c \ globus_xio_http_transform.c \ globus_i_xio_http_responses.h \ globus_i_xio_http.h \ globus_xio_http.h include_HEADERS = \ globus_xio_http.h noinst_HEADERS = \ globus_i_xio_http.h \ globus_i_xio_http_responses.h noinst_LTLIBRARIES = libglobus_xio_http_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_http_driver_la_SOURCES = $(Sources) libglobus_xio_http_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_http_driver_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/http/globus_xio_http_attr.c0000666000076400007640000002543010363625124017716 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_attr Internal Attribute Implementation */ #endif /** * Allocate and initialize an HTTP attribute * @ingroup globus_i_xio_http_attr * * Creates a new attribute with default values. This is called by the XIO * driver via globus_xio_attr_init(). * * @param out_attr * Pointer value will be set to point to a * newly allocated and initilized #globus_i_xio_http_attr_t * structure. * * @retval GLOBUS_SUCCESS * Attribute successfully initialized. * @retval GLOBUS_XIO_ERROR_MEMORY * Initialization failed due to memory constraints. * * @see globus_i_xio_http_attr_destroy() */ globus_result_t globus_i_xio_http_attr_init( void ** out_attr) { globus_result_t res; globus_i_xio_http_attr_t * attr; GlobusXIOName(globus_i_xio_http_attr_init); attr = globus_libc_malloc(sizeof(globus_i_xio_http_attr_t)); if (attr == NULL) { res = GlobusXIOErrorMemory("attr"); goto error_exit; } res = globus_i_xio_http_request_init(&attr->request); if (res != GLOBUS_SUCCESS) { goto free_attr_exit; } res = globus_i_xio_http_response_init(&attr->response); if (res != GLOBUS_SUCCESS) { goto free_request_exit; } attr->delay_write_header = GLOBUS_FALSE; *out_attr = attr; return GLOBUS_SUCCESS; free_request_exit: globus_i_xio_http_request_destroy(&attr->request); free_attr_exit: globus_libc_free(attr); error_exit: return res; } /* globus_i_xio_http_attr_init() */ /** * Modify the state of an HTTP attribute * @ingroup globus_i_xio_http_attr * * Modify the state of an attribute. This is called by the XIO driver via * globus_xio_attr_cntl(). * * @param driver_attr * Void pointer to a #globus_i_xio_http_attr_t structure containing * the attribute's values. * @param cmd * Integer value indicating which attribute will be changed. Valid * commands values are in the set defined by #globus_xio_http_attr_cmd_t * @param ap * Variable-length argument list containing any cmd-specific parameters. * * @retval GLOBUS_SUCCESS * Attribute successfully modified. * @retval GLOBUS_XIO_ERROR_MEMORY * Attribute control failed due to memory constraints. * @retval GLOBUS_XIO_ERROR_PARAMETER * Invalid @a cmd parameter or invalid value for cmd-specific parameters * in @a ap. */ globus_result_t globus_i_xio_http_attr_cntl( void * driver_attr, int cmd, va_list ap) { globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_http_attr_t * attr = driver_attr; char * in_string; char * save_string; globus_xio_http_version_t in_http_version; char * in_header_name; char * in_header_value; char ** out_method; char ** out_uri; globus_xio_http_version_t * out_http_version; globus_hashtable_t * out_headers; int * out_status_code; char ** out_reason_phrase; GlobusXIOName(globus_i_xio_http_attr_cntl); switch (cmd) { case GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_METHOD: save_string = attr->request.method; in_string = va_arg(ap, char *); if (in_string == NULL) { res = GlobusXIOErrorParameter("method"); break; } attr->request.method = globus_libc_strdup(in_string); if (attr->request.method == NULL) { attr->request.method = save_string; res = GlobusXIOErrorMemory("method"); break; } if (save_string != NULL) { globus_libc_free(save_string); } break; case GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HTTP_VERSION: in_http_version = va_arg(ap, globus_xio_http_version_t); if (in_http_version != GLOBUS_XIO_HTTP_VERSION_1_0 && in_http_version != GLOBUS_XIO_HTTP_VERSION_1_1) { res = GlobusXIOErrorParameter("version"); break; } attr->request.http_version = in_http_version; break; case GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HEADER: in_header_name = va_arg(ap, char *); if (in_header_name == NULL) { res = GlobusXIOErrorParameter("name"); break; } in_header_value = va_arg(ap, char *); if (in_header_value == NULL) { res = GlobusXIOErrorParameter("value"); break; } res = globus_i_xio_http_header_info_set_header( &attr->request.headers, in_header_name, in_header_value); break; case GLOBUS_XIO_HTTP_ATTR_DELAY_WRITE_HEADER: attr->delay_write_header = 1; break; case GLOBUS_XIO_HTTP_GET_REQUEST: out_method = va_arg(ap, char **); out_uri = va_arg(ap, char **); out_http_version = va_arg(ap, globus_xio_http_version_t *); out_headers = va_arg(ap, globus_hashtable_t *); if (out_method != NULL) { *out_method = attr->request.method; } if (out_uri != NULL) { *out_uri = attr->request.uri; } if (out_http_version != NULL) { *out_http_version = attr->request.http_version; } if (out_headers != NULL) { *out_headers = attr->request.headers.headers; } break; case GLOBUS_XIO_HTTP_GET_RESPONSE: out_status_code = va_arg(ap, int *); out_reason_phrase = va_arg(ap, char **); out_http_version = va_arg(ap, globus_xio_http_version_t *); out_headers = va_arg(ap, globus_hashtable_t *); if (out_status_code != NULL) { *out_status_code = attr->response.status_code; } if (out_reason_phrase != NULL) { *out_reason_phrase = attr->response.reason_phrase; } if (out_http_version != NULL) { *out_http_version = attr->response.http_version; } if (out_headers != NULL) { *out_headers = attr->response.headers.headers; } break; default: res = GlobusXIOErrorParameter("cmd"); } return res; } /* globus_i_xio_http_attr_cntl() */ /** Copy an HTTP attribute * @ingroup globus_i_xio_http_attr * * Copies all values associated with the @a src http attribute to * a newly allocated attribute in @a dst. If this function returns a * failure, then the @a dst should be considered uninitiailized. This is * called by the XIO driver via globus_xio_attr_copy(). * * @param dst * Void ** which will be set to point to a newly allocated attribute * with equivalent values to those in @a src. * @param src * Void * pointing to a #globus_i_xio_http_attr_t which contains the * attributes we want to copy. * * @return * This function returns GLOBUS_SUCCESS or GLOBUS_XIO_ERROR_MEMORY itself. * Other errors generated by globus_i_xio_http_request_copy() may be * returned as well. * * @retval GLOBUS_SUCCESS * Attribute successfully copied. * @retval GLOBUS_XIO_ERROR_MEMORY * Attribute copy failed due to memory constraints. */ globus_result_t globus_i_xio_http_attr_copy( void ** dst, void * src) { globus_result_t result; globus_i_xio_http_attr_t * http_dst; globus_i_xio_http_attr_t * http_src = src; GlobusXIOName(globus_i_xio_http_attr_copy); /* * Don't use globus_i_xio_http_request_init() here or the call to * globus_i_xio_http_request_copy() below will leak. */ http_dst = globus_libc_malloc(sizeof(globus_i_xio_http_attr_t)); if (http_dst == NULL) { result = GlobusXIOErrorMemory(dst); goto error_exit; } /* Copy request attrs */ result = globus_i_xio_http_request_copy( &http_dst->request, &http_src->request); if (result != GLOBUS_SUCCESS) { goto free_http_dst_exit; } /* Copy response attrs */ result = globus_i_xio_http_response_copy( &http_dst->response, &http_src->response); if (result != GLOBUS_SUCCESS) { goto free_http_dst_request_exit; } http_dst->delay_write_header = http_src->delay_write_header; *dst = http_dst; return GLOBUS_SUCCESS; free_http_dst_request_exit: globus_i_xio_http_request_destroy(&http_dst->request); free_http_dst_exit: globus_libc_free(http_dst); error_exit: return result; } /* globus_i_xio_http_attr_copy() */ /** * Destroy an HTTP attribute * @ingroup globus_i_xio_http_attr * * Frees all storage associated with an HTTP attribute. No further * handle controls may be called on this attribute. This is called by the XIO * driver via globus_xio_attr_destroy(). * * @param driver_attr * Void pointer to a #globus_i_xio_http_attr_t structure to be destroyed. * * @return This function always returns GLOBUS_SUCCESS. * * @see globus_i_xio_http_attr_init() */ globus_result_t globus_i_xio_http_attr_destroy( void * driver_attr) { globus_i_xio_http_attr_t * attr = driver_attr; GlobusXIOName(globus_i_xio_http_attr_destroy); globus_i_xio_http_request_destroy(&attr->request); globus_i_xio_http_response_destroy(&attr->response); globus_libc_free(attr); return GLOBUS_SUCCESS; } /* globus_i_xio_http_attr_destroy() */ globus_xio-3.6/builtins/http/globus_xio_http_transform.c0000666000076400007640000017473611006134627020773 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #include #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_transform Internal Transform Implementation */ #endif globus_mutex_t globus_i_xio_http_cached_handle_mutex; globus_mutex_t globus_i_xio_http_cancel_mutex; globus_list_t * globus_i_xio_http_cached_handles = NULL; globus_list_t * globus_i_xio_http_cancellable_handles = NULL; static globus_i_xio_http_handle_t * globus_l_xio_http_find_cached_handle( globus_i_xio_http_target_t * target, globus_i_xio_http_attr_t * attr); static globus_result_t globus_l_xio_http_reopen( globus_i_xio_http_handle_t * http_handle, globus_i_xio_http_target_t * http_target, globus_i_xio_http_attr_t * http_attr, globus_xio_operation_t op); static globus_result_t globus_l_xio_http_open( const globus_xio_contact_t * contact_info, void * target, void * attr, globus_xio_operation_t op); static void globus_l_xio_http_read_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); static globus_result_t globus_l_xio_http_parse_chunk_header( globus_i_xio_http_handle_t * http_handle, globus_bool_t * done); static void globus_l_xio_http_read_chunk_header_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); static void globus_l_xio_http_copy_residue( globus_i_xio_http_handle_t * http_handle); static void globus_l_xio_http_client_cache_kickout( void * user_arg); static void globus_l_xio_http_read_cancel_callback( globus_xio_operation_t op, void * user_arg, globus_xio_error_type_t reason); static void globus_l_xio_http_read_timeout_callback( void * user_arg); /** * Open an HTTP URI * @ingroup globus_i_xio_http_transform * * Opens a new connection to handle an HTTP request. Allocates a handle * and then passes the open on to the transport. In the callback called * by the transport-level open, the HTTP driver will begin sending or * receiving the HTTP request metadata. * * @param target * HTTP-specific target contact information. * @param attr * HTTP attributes to associate with this open. On the client side, * this will allow overriding some information in the target. * @param op * XIO Operation associated with this open. * * @returns This function directly returns GLOBUS_SUCCESS or * GLOBUS_XIO_ERROR_MEMORY. Other errors may be generated by * globus_i_xio_http_handle_init() or globus_xio_driver_pass_open(). * * @retval GLOBUS_SUCCESS * Open successfully passed to transport. * @retval GLOBUS_XIO_ERROR_MEMORY * Unable to allocate an HTTP handle. */ globus_result_t globus_i_xio_http_open( const globus_xio_contact_t * contact_info, void * link, void * attr, globus_xio_operation_t op) { globus_result_t result; globus_i_xio_http_target_t * target = NULL; globus_i_xio_http_handle_t * http_handle; GlobusXIOName(globus_i_xio_http_open); if(link) { target = (globus_i_xio_http_target_t *) link; } else { result = globus_i_xio_http_target_init(&target, contact_info); if(result != GLOBUS_SUCCESS) { goto error; } } http_handle = globus_l_xio_http_find_cached_handle(target, attr); if (http_handle != NULL) { result = globus_l_xio_http_reopen(http_handle, target, attr, op); } else { result = globus_l_xio_http_open(contact_info, target, attr, op); } if(!link && target) { globus_i_xio_http_target_destroy(target); } error: return result; } /* globus_i_xio_http_open() */ static globus_result_t globus_l_xio_http_reopen( globus_i_xio_http_handle_t * http_handle, globus_i_xio_http_target_t * http_target, globus_i_xio_http_attr_t * http_attr, globus_xio_operation_t op) { globus_result_t result; globus_mutex_lock(&http_handle->mutex); globus_assert(http_handle->target_info.is_client == http_target->is_client); globus_assert(http_handle->request_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_1); result = globus_i_xio_http_handle_reinit( http_handle, http_attr, http_target); if (result != GLOBUS_SUCCESS) { goto error_exit; } result = globus_xio_driver_merge_handle( op, http_handle->handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } globus_assert(http_target->is_client); http_handle->send_state = GLOBUS_XIO_HTTP_REQUEST_LINE; http_handle->parse_state = GLOBUS_XIO_HTTP_STATUS_LINE; http_handle->reopen_in_progress = GLOBUS_TRUE; result = globus_i_xio_http_client_write_request(op, http_handle); error_exit: globus_mutex_unlock(&http_handle->mutex); return result; } /* globus_l_xio_http_reopen() */ static globus_result_t globus_l_xio_http_open( const globus_xio_contact_t * contact_info, void * target, void * attr, globus_xio_operation_t op) { globus_result_t result; globus_i_xio_http_handle_t * http_handle; globus_i_xio_http_attr_t * http_attr = attr; globus_xio_driver_callback_t open_callback; globus_xio_contact_t new_contact_info; char port_buf[12]; GlobusXIOName(globus_l_xio_http_open); http_handle = globus_libc_calloc(1, sizeof(globus_i_xio_http_handle_t)); if (http_handle == NULL) { result = GlobusXIOErrorMemory("http_handle"); goto error_exit; } result = globus_i_xio_http_handle_init( http_handle, http_attr, target); if (result != GLOBUS_SUCCESS) { goto free_http_handle_exit; return result; } if (http_handle->target_info.is_client) { open_callback = globus_i_xio_http_client_open_callback; http_handle->send_state = GLOBUS_XIO_HTTP_PRE_REQUEST_LINE; if (http_handle->request_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_0) { if (!GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET( &http_handle->request_info.headers) && !http_handle->delay_write_header) { result = GlobusXIOHttpErrorInvalidHeader( "Content-Length", "not set"); goto destroy_http_handle; } } } else { open_callback = globus_i_xio_http_server_open_callback; http_handle->send_state = GLOBUS_XIO_HTTP_STATUS_LINE; } memcpy(&new_contact_info, contact_info, sizeof(new_contact_info)); snprintf(port_buf, sizeof(port_buf), "%hu", http_handle->target_info.port); new_contact_info.port = port_buf; http_handle->handle = globus_xio_operation_get_driver_handle(op); result = globus_xio_driver_pass_open( op, &new_contact_info, open_callback, http_handle); if (result != GLOBUS_SUCCESS) { goto destroy_http_handle; } return result; destroy_http_handle: globus_i_xio_http_handle_destroy(http_handle); free_http_handle_exit: globus_libc_free(http_handle); error_exit: return result; } /* globus_l_xio_http_open() */ static globus_i_xio_http_handle_t * globus_l_xio_http_find_cached_handle( globus_i_xio_http_target_t * http_target, globus_i_xio_http_attr_t * http_attr) { globus_i_xio_http_handle_t * http_handle = NULL; globus_list_t * iter; if (http_attr == NULL) { return NULL; } if (http_attr->request.http_version == GLOBUS_XIO_HTTP_VERSION_1_0 || !http_target->is_client) { return NULL; } globus_mutex_lock(&globus_i_xio_http_cached_handle_mutex); iter = globus_i_xio_http_cached_handles; while (! globus_list_empty(iter)) { http_handle = globus_list_first(iter); if (strcmp(http_target->host, http_handle->target_info.host) == 0 && http_target->port == http_handle->target_info.port) { globus_list_remove(&globus_i_xio_http_cached_handles, iter); break; } else { iter = globus_list_rest(iter); } http_handle = NULL; } globus_mutex_unlock(&globus_i_xio_http_cached_handle_mutex); return http_handle; } /* globus_l_xio_http_find_cached_handle() */ /** * Read from an HTTP stream * @ingroup globus_i_xio_http_transform * * Begins processing a read. If this is called before the headers have been * parsed, then the information pertaining to the read is just stored to * be processed later. Otherwise globus_i_xio_http_parse_residue() is called * to handle any residual data in the header buffer and pass the read * to the transport if necessary. * * If there is sufficient data in the buffer residue to satisfy the "wait_for" * value passed to the read function, then this will cause * globus_xio_driver_finished_read() to be called. Otherwise, the driver * will pass the read to the transport driver. * * @param handle * Void pointer to a globus_i_xio_http_handle_t. * @param iovec * Pointer to user's iovec array. Can't be changed, so a copy is made * in the http_handle. * @param iovec_count * Length of the iovec array. * @param op * Operation associated with the read. * * @return * This function returns GLOBUS_SUCCESS, * GLOBUS_XIO_ERROR_ALREADY_REGISTERED, and GLOBUS_XIO_ERROR_EOF * errors directly. * * @retval GLOBUS_SUCCESS * Read handled successfully. Either the read was passed to the transport, * or globus_xio_driver_finished_read() was be called. * @retval GLOBUS_XIO_ERROR_ALREADY_REGISTERED * A read is already registered with the HTTP handle, so we can't deal * with this new one. * @retval GLOBUS_XIO_ERROR_EOF * A read is being registered on a handle which won't have any more * entity body available (either none was present or the entire content * length or final chunk has been read). */ globus_result_t globus_i_xio_http_read( void * handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_i_xio_http_handle_t * http_handle = handle; globus_result_t result = GLOBUS_SUCCESS; globus_i_xio_http_header_info_t * header_info; globus_size_t nbytes; globus_bool_t registered_again = GLOBUS_FALSE; int i; globus_i_xio_http_attr_t * descriptor; GlobusXIOName(globus_i_xio_http_read); if (http_handle->target_info.is_client) { header_info = &http_handle->response_info.headers; } else { header_info = &http_handle->request_info.headers; } globus_mutex_lock(&http_handle->mutex); if (http_handle->read_operation.operation != NULL) { /* Only one read in progress per handle, sorry */ result = GlobusXIOErrorAlreadyRegistered(); goto error_exit; } /* Copy user's iovec into non-const version in the handle, so that * we can deal with premature reads or reads from the header residue. */ http_handle->read_operation.iov = globus_libc_calloc( iovec_count, sizeof(globus_xio_iovec_t)); http_handle->read_operation.iovcnt = iovec_count; http_handle->read_operation.operation = op; http_handle->read_operation.nbytes = 0; http_handle->read_operation.wait_for = globus_xio_operation_get_wait_for(op); for (i = 0; i < iovec_count; i++) { http_handle->read_operation.iov[i].iov_base = iovec[i].iov_base; http_handle->read_operation.iov[i].iov_len = iovec[i].iov_len; } if (http_handle->parse_state == GLOBUS_XIO_HTTP_REQUEST_LINE || http_handle->parse_state == GLOBUS_XIO_HTTP_STATUS_LINE || http_handle->parse_state == GLOBUS_XIO_HTTP_HEADERS) { /* Still reading header information---read will be handled after * headers are parsed */ globus_bool_t cancelled; globus_assert(http_handle->cancellation == NULL); http_handle->cancellation = malloc(sizeof(globus_i_xio_http_cancellation_t)); if (http_handle->cancellation == NULL) { globus_mutex_unlock(&http_handle->mutex); return GlobusXIOErrorMemory("cancellation"); } http_handle->cancellation->user_read_op = op; http_handle->cancellation->internal_op = http_handle->response_read_operation; http_handle->cancellation->http_handle = http_handle; http_handle->cancellation->driver_handle = globus_xio_operation_get_driver_handle(op); globus_mutex_lock(&globus_i_xio_http_cancel_mutex); globus_list_insert( &globus_i_xio_http_cancellable_handles, http_handle->cancellation); globus_mutex_unlock(&globus_i_xio_http_cancel_mutex); cancelled = globus_xio_operation_enable_cancel( op, globus_l_xio_http_read_cancel_callback, http_handle->cancellation); if (cancelled) { free(http_handle->read_operation.iov); http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; http_handle->read_operation.wait_for = 0; free(http_handle->cancellation); http_handle->cancellation = NULL; result = GlobusXIOErrorCanceled(); } globus_mutex_unlock(&http_handle->mutex); return result; } else if ((! http_handle->target_info.is_client) && (http_handle->parse_state == GLOBUS_XIO_HTTP_PRE_REQUEST_LINE)) { /* Haven't started reading header information yet---register that * read */ if (http_handle->read_buffer.iov_base == NULL) { http_handle->read_buffer.iov_len = GLOBUS_XIO_HTTP_CHUNK_SIZE; http_handle->read_buffer.iov_base = globus_libc_malloc( GLOBUS_XIO_HTTP_CHUNK_SIZE); if (http_handle->read_buffer.iov_base == NULL) { result = GlobusXIOErrorMemory("read_buffer"); goto error_exit; } } else { result = globus_i_xio_http_clean_read_buffer(http_handle); if (result != GLOBUS_SUCCESS) { goto error_exit; } http_handle->parse_state = GLOBUS_XIO_HTTP_REQUEST_LINE; } result = globus_xio_driver_pass_read( op, &http_handle->read_buffer, 1, 1, globus_i_xio_http_server_read_request_callback, http_handle); if (result == GLOBUS_SUCCESS) { http_handle->parse_state = GLOBUS_XIO_HTTP_REQUEST_LINE; } else { goto error_exit; } globus_mutex_unlock(&http_handle->mutex); return result; } /* Parse any residual information in our buffer, maybe copying to use * buffer, maybe registering a read */ result = globus_i_xio_http_parse_residue(http_handle, ®istered_again); if ((http_handle->read_operation.wait_for <= 0 && !registered_again) || result != GLOBUS_SUCCESS) { if (header_info->transfer_encoding != GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(header_info) && header_info->content_length == 0) { /* Synthesize EOF if we've read all of the entity content */ result = GlobusXIOErrorEOF(); } /* * Either we've read enough, hit end of chunk, no entity was present, * or pass to transport failed. Call finished_read */ op = http_handle->read_operation.operation; nbytes = http_handle->read_operation.nbytes; globus_libc_free(http_handle->read_operation.iov); http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; if (http_handle->target_info.is_client && !http_handle->read_response) { /* Set metadata on this read to contain the response info */ descriptor = globus_xio_operation_get_data_descriptor( op, GLOBUS_TRUE); if (descriptor == NULL) { result = GlobusXIOErrorMemory("descriptor"); goto error_exit; } globus_i_xio_http_response_destroy(&descriptor->response); result = globus_i_xio_http_response_copy( &descriptor->response, &http_handle->response_info); if (result != GLOBUS_SUCCESS) { goto error_exit; } http_handle->read_response = GLOBUS_TRUE; } globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_read(op, result, nbytes); result = GLOBUS_SUCCESS; } else { globus_mutex_unlock(&http_handle->mutex); } return result; error_exit: globus_mutex_unlock(&http_handle->mutex); return result; } /* globus_i_xio_http_read() */ /** * Parse residual data from header read into user buffers. * @ingroup globus_i_xio_http_transform * * Parses the data in the @a http_handle's read_buffer---if content is * present, it will be copied into the user buffer * passed to the http driver via globus_xio_http_driver_pass_read(). * * Called with the handle's mutex locked. * * @param http_handle * Handle associated with the read. * @param registered_again * Set to GLOBUS_TRUE by this function if the read operation was passed * down again as a result of a partial read of data. * * @return void */ globus_result_t globus_i_xio_http_parse_residue( globus_i_xio_http_handle_t * http_handle, globus_bool_t * registered_again) { int i; globus_result_t result = GLOBUS_SUCCESS; globus_i_xio_http_header_info_t * headers; globus_size_t nbytes; globus_bool_t done; globus_size_t max_content = 0; GlobusXIOName(globus_i_xio_http_parse_residue); *registered_again = GLOBUS_FALSE; if (http_handle->target_info.is_client) { headers = &http_handle->response_info.headers; } else { headers = &http_handle->request_info.headers; } if (http_handle->read_operation.iovcnt == 0) { http_handle->read_operation.wait_for = 0; goto finish; } if (http_handle->parse_state != GLOBUS_XIO_HTTP_EOF) { /* Deal with read if an entity is expected. If it isn't, then * any data in the read buffer is likely a pipelined request or * response. */ switch (http_handle->parse_state) { case GLOBUS_XIO_HTTP_CHUNK_CRLF: case GLOBUS_XIO_HTTP_CHUNK_LINE: case GLOBUS_XIO_HTTP_CHUNK_FOOTERS: /* Get another chunk header out of the residue */ result = globus_l_xio_http_parse_chunk_header( http_handle, &done); if (result == GLOBUS_SUCCESS && (!done)) { /* * Didn't get the complete chunk header, we'll need to * register another read. */ result = globus_i_xio_http_clean_read_buffer(http_handle); if (result != GLOBUS_SUCCESS) { break; } result = globus_xio_driver_pass_read( http_handle->read_operation.operation, &http_handle->read_iovec, 1, 1, globus_l_xio_http_read_chunk_header_callback, http_handle); if (result == GLOBUS_SUCCESS) { *registered_again = GLOBUS_TRUE; } break; } else if (result != GLOBUS_SUCCESS) { /* Error parsing chunk size */ break; } /* FALLSTHROUGH */ case GLOBUS_XIO_HTTP_CHUNK_BODY: case GLOBUS_XIO_HTTP_IDENTITY_BODY: globus_l_xio_http_copy_residue(http_handle); if (http_handle->parse_state != GLOBUS_XIO_HTTP_EOF && http_handle->read_operation.wait_for > 0) { /* Haven't pre-read enough, pass to transport */ if (http_handle->parse_state == GLOBUS_XIO_HTTP_IDENTITY_BODY && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers)) { max_content = headers->content_length; } else if (http_handle->parse_state == GLOBUS_XIO_HTTP_CHUNK_BODY) { max_content = http_handle->read_chunk_left; } if (max_content > 0) { /* * Need to truncate iovecs here, so that we don't try * to read past end of content and have to copy * data back in to our read buffer. XIO will repost the * read to us if we finish with < wait_for bytes. */ nbytes = 0; for (i = 0; i < http_handle->read_operation.iovcnt; i++) { if ((http_handle->read_operation.iov[i].iov_len + nbytes) > max_content) { http_handle->read_operation.iov[i].iov_len = max_content - nbytes; nbytes += http_handle->read_operation.iov[i].iov_len; } } } result = globus_xio_driver_pass_read( http_handle->read_operation.operation, http_handle->read_operation.iov, http_handle->read_operation.iovcnt, http_handle->read_operation.wait_for, globus_l_xio_http_read_callback, http_handle); } break; case GLOBUS_XIO_HTTP_PRE_REQUEST_LINE: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_PRE_REQUEST_LINE); case GLOBUS_XIO_HTTP_REQUEST_LINE: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_REQUEST_LINE); case GLOBUS_XIO_HTTP_STATUS_LINE: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_STATUS_LINE); case GLOBUS_XIO_HTTP_HEADERS: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_HEADERS); case GLOBUS_XIO_HTTP_EOF: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_EOF); case GLOBUS_XIO_HTTP_CLOSE: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_CLOSE); result = GlobusXIOErrorParameter("handle [invalid state]"); break; } } finish: return result; } /* globus_i_xio_http_parse_residue() */ /** * Called with mutex locked. */ static void globus_l_xio_http_copy_residue( globus_i_xio_http_handle_t * http_handle) { globus_i_xio_http_header_info_t * headers; int to_copy; int i; if (http_handle->target_info.is_client) { headers = &http_handle->response_info.headers; } else { headers = &http_handle->request_info.headers; } if (GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers)) { /* Don't wait beyond content-length */ if (http_handle->read_operation.wait_for > headers->content_length) { http_handle->read_operation.wait_for = headers->content_length; } } to_copy = 0; /* * Copy already read data into the user's buffers. */ for (i = 0; (i < http_handle->read_operation.iovcnt) && (http_handle->read_buffer_valid > 0); i++) { if (http_handle->read_operation.iov[i].iov_len > http_handle->read_buffer_valid) { to_copy = http_handle->read_buffer_valid; } else { to_copy = http_handle->read_operation.iov[i].iov_len; } /* Don't copy more than content-length */ if (headers->transfer_encoding != GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers) && headers->content_length < to_copy) { to_copy = headers->content_length; } else if (headers->transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && http_handle->read_chunk_left < to_copy) { to_copy = http_handle->read_chunk_left; } if (to_copy == 0) { continue; } memcpy(http_handle->read_operation.iov[i].iov_base, (globus_byte_t *)http_handle->read_buffer.iov_base + http_handle->read_buffer_offset, to_copy); http_handle->read_buffer_valid -= to_copy; http_handle->read_buffer_offset += to_copy; http_handle->read_operation.iov[i].iov_len -= to_copy; http_handle->read_operation.iov[i].iov_base = (char *) http_handle->read_operation.iov[i].iov_base + to_copy; http_handle->read_operation.nbytes += to_copy; if (http_handle->read_operation.wait_for >= to_copy) { http_handle->read_operation.wait_for -= to_copy; } else { http_handle->read_operation.wait_for = 0; } http_handle->read_chunk_left -= to_copy; if (headers->transfer_encoding != GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers)) { headers->content_length -= to_copy; } else if (headers->transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && http_handle->read_chunk_left == 0) { http_handle->parse_state = GLOBUS_XIO_HTTP_CHUNK_CRLF; } } } /* globus_l_xio_http_copy_residue() */ /** * Read callback for user data * @ingroup globus_i_xio_http_transform * * Returns data to the XIO layer when transport has read the part of a chunk * or entity body for the user. * * @param op * Operation associated with this read. * @param result * Transport result for this read. * @param nbytes * Number of bytes read by the transport. * @param user_arg * Void pointer pointing to an HTTP handle. * * @return void */ static void globus_l_xio_http_read_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_i_xio_http_header_info_t * headers; globus_size_t nbytes_result = nbytes; GlobusXIOName(globus_l_xio_http_read_callback); if (http_handle->target_info.is_client) { headers = &http_handle->response_info.headers; } else { headers = &http_handle->request_info.headers; } globus_mutex_lock(&http_handle->mutex); globus_libc_free(http_handle->read_operation.iov); /* Add in amt of data pre-read when chunk header was read */ nbytes_result += http_handle->read_operation.nbytes; http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; if (headers->transfer_encoding != GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers)) { headers->content_length -= nbytes; if (headers->content_length == 0 && result == GLOBUS_SUCCESS) { if (http_handle->target_info.is_client) { result = GlobusXIOErrorEOF(); } else { result = GlobusXIOHttpErrorEOF(); } } } else if (headers->transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED) { http_handle->read_chunk_left -= nbytes; if (http_handle->read_chunk_left == 0) { http_handle->parse_state = GLOBUS_XIO_HTTP_CHUNK_CRLF; } } globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_read(op, result, nbytes_result); } /* globus_l_xio_http_read_callback() */ /** * Read callback for chunk header information * @ingroup globus_i_xio_http_transform * * Called when the driver has read (at least part of) an http chunk line. * Any residue in the driver's buffer will be copied to a user's buffer later. * * @param op * Operation associated with this read. * @param result * Transport result for this read. * @param nbytes * Number of bytes read by the transport. * @param user_arg * Void pointer pointing to an HTTP handle. * * @return void */ static void globus_l_xio_http_read_chunk_header_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_i_xio_http_header_info_t * headers; globus_bool_t registered_again = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_http_read_chunk_header_callback); globus_mutex_lock(&http_handle->mutex); http_handle->read_buffer_valid += nbytes; if (http_handle->target_info.is_client) { headers = &http_handle->response_info.headers; } else { headers = &http_handle->request_info.headers; } if (result == GLOBUS_SUCCESS) { result = globus_i_xio_http_parse_residue( http_handle, ®istered_again); } if ((http_handle->read_operation.wait_for <= 0 && !registered_again) || result != GLOBUS_SUCCESS) { if (headers->transfer_encoding != GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED && GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers) && headers->content_length == 0) { /* Synthesize EOF if we've read all of the entity content */ if (http_handle->target_info.is_client) { result = GlobusXIOErrorEOF(); } else { result = GlobusXIOHttpErrorEOF(); } } /* * Either we've read enough, hit end of chunk, no entity was present, * or pass to transport failed. Call finished_read */ op = http_handle->read_operation.operation; nbytes = http_handle->read_operation.nbytes; globus_libc_free(http_handle->read_operation.iov); http_handle->read_operation.iov = NULL; http_handle->read_operation.iovcnt = 0; http_handle->read_operation.operation = NULL; http_handle->read_operation.driver_handle = NULL; http_handle->read_operation.nbytes = 0; globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_read(op, result, nbytes); } else { globus_mutex_unlock(&http_handle->mutex); } } /* globus_l_xio_http_read_chunk_header_callback() */ /** * Parse the framing for an http chunk * @ingroup globus_i_xio_http_transform * * Parse the chunk size, end-of-chunk CRLF, or chunk footers, out of the * handle's read buffer, depending on the current parse state. * * @param http_handle * Handle associated with this parsing. * @param done * Pointer to a boolean. This will be set to GLOBUS_TRUE if we are * able to parse an entire chunk header line, or have read the * final footer line. Otherwise, will be set to GLOBUS_FALSE. * * @return This function returns GLOBUS_SUCCESS, GLOBUS_XIO_HTTP_ERROR_PARSE, * or GLOBUS_XIO_ERROR_EOF. It also modifies the value pointed to by the * @a done parameter as described above. * * Called with mutex locked. * * @retval GLOBUS_SUCCESS * No parsing errors encountered. * @retval ::GLOBUS_XIO_HTTP_ERROR_PARSE * Improperly formed chunk header. * @retval GLOBUS_XIO_ERROR_EOF * Final chunk footer was read. */ static globus_result_t globus_l_xio_http_parse_chunk_header( globus_i_xio_http_handle_t * http_handle, globus_bool_t * done) { char * current_offset; char * eol; unsigned long chunk_size; globus_result_t result = GLOBUS_SUCCESS; size_t parsed; GlobusXIOName(globus_l_xio_http_parse_chunk_header); current_offset = ((char *) (http_handle->read_buffer.iov_base)) + http_handle->read_buffer_offset; eol = globus_i_xio_http_find_eol(current_offset, http_handle->read_buffer_valid); if (eol == NULL) { /* Not enough data to parse */ *done = GLOBUS_FALSE; return result; } switch (http_handle->parse_state) { case GLOBUS_XIO_HTTP_CHUNK_CRLF: if (current_offset != eol) { result = GlobusXIOHttpErrorParse("chunk", current_offset); break; } current_offset += 2; http_handle->read_buffer_valid -= 2; http_handle->read_buffer_offset += 2; eol = globus_i_xio_http_find_eol(current_offset, http_handle->read_buffer_valid); http_handle->parse_state = GLOBUS_XIO_HTTP_CHUNK_LINE; if (eol == NULL) { *done = GLOBUS_FALSE; result = GLOBUS_SUCCESS; break; } /* FALLSTHROUGH */ case GLOBUS_XIO_HTTP_CHUNK_LINE: *eol = '\0'; globus_libc_lock(); errno = 0; chunk_size = strtoul(current_offset, NULL, 16); if (chunk_size == ULONG_MAX && errno != 0) { result = GlobusXIOHttpErrorParse("Chunk-size", current_offset); globus_libc_unlock(); break; } globus_libc_unlock(); if (chunk_size > UINT_MAX) { result = GlobusXIOHttpErrorParse("Chunk-size", current_offset); globus_libc_unlock(); break; } http_handle->read_chunk_left = (globus_size_t) chunk_size; current_offset = eol + 2; parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; if (http_handle->read_chunk_left != 0) { *done = GLOBUS_TRUE; http_handle->parse_state = GLOBUS_XIO_HTTP_CHUNK_BODY; result = GLOBUS_SUCCESS; break; } /* 0 byte chunk is the Last chunk. Parse footers. */ http_handle->parse_state = GLOBUS_XIO_HTTP_CHUNK_FOOTERS; /* FALLSTHROUGH */ case GLOBUS_XIO_HTTP_CHUNK_FOOTERS: /* We parsed the last chunk size line '0'. Now parse any footers * and the final CRLF */ while ((eol = globus_i_xio_http_find_eol( current_offset, http_handle->read_buffer_valid)) != current_offset) { if (eol == NULL) { /* final headers not all found */ *done = GLOBUS_FALSE; break; } /* Ignore footers for now */ current_offset = eol + 2; parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; } if (eol != NULL) { /* We found an empty line---end of footers found. */ *done = GLOBUS_TRUE; current_offset = eol + 2; parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; http_handle->parse_state = GLOBUS_XIO_HTTP_EOF; if (http_handle->target_info.is_client) { result = GlobusXIOErrorEOF(); } else { result = GlobusXIOHttpErrorEOF(); } } else { /* Didn't finish parsing */ *done = GLOBUS_FALSE; } break; case GLOBUS_XIO_HTTP_PRE_REQUEST_LINE: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_PRE_REQUEST_LINE); case GLOBUS_XIO_HTTP_REQUEST_LINE: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_REQUEST_LINE); case GLOBUS_XIO_HTTP_STATUS_LINE: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_STATUS_LINE); case GLOBUS_XIO_HTTP_HEADERS: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_HEADERS); case GLOBUS_XIO_HTTP_CHUNK_BODY: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_CHUNK_BODY); case GLOBUS_XIO_HTTP_IDENTITY_BODY: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_IDENTITY_BODY); case GLOBUS_XIO_HTTP_EOF: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_EOF); case GLOBUS_XIO_HTTP_CLOSE: globus_assert(http_handle->parse_state != GLOBUS_XIO_HTTP_CLOSE); } return result; } /* globus_l_xio_http_parse_chunk_header() */ /** * Write to an HTTP stream * @ingroup globus_i_xio_http_transform * * Begins processing a write. If this is called in a server implementation * before the response has been sent, then the information pertaining to the * write is just stored to be processed later, and the response will be sent * now. Otherwise, if this "chunked" transfer-encoding is being used, * globus_i_xio_http_write_chunk() is called to frame and send this data. * If "chunked" encoding is not being used, then the data buffer is simply * passed to the transport. * * @param handle * Void pointer to a globus_i_xio_http_handle_t. * @param iovec * Pointer to user's iovec array. Can't be changed, so a copy is made * in the http_handle when we are delaying the write. * @param iovec_count * Length of the iovec array. * @param op * Operation associated with the write. * * @return * This function returns GLOBUS_SUCCESS, * GLOBUS_XIO_ERROR_ALREADY_REGISTERED, and GLOBUS_XIO_ERROR_EOF * errors directly. Other errors may be returned from * globus_i_xio_http_server_write_response(), * globus_i_xio_http_write_chunk(), or globus_xio_driver_pass_write(). * * @retval GLOBUS_SUCCESS * Write handled successfully. At some point later, * globus_xio_driver_finished_read() will be called. * @retval ::GLOBUS_XIO_HTTP_ERROR_NO_ENTITY * A write was attempted for an operation which does not require a * message body (such as a "GET" request) or after the end of the * entity has already been sent. * @retval GLOBUS_XIO_ERROR_ALREADY_REGISTERED * A write is already registered with the HTTP handle, so we can't deal * with this new one. */ globus_result_t globus_i_xio_http_write( void * handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_i_xio_http_handle_t * http_handle = handle; globus_result_t result; globus_i_xio_http_header_info_t * headers; GlobusXIOName(globus_i_xio_http_write); if (http_handle->target_info.is_client) { headers = &http_handle->request_info.headers; } else { headers = &http_handle->response_info.headers; } globus_mutex_lock(&http_handle->mutex); switch (http_handle->send_state) { case GLOBUS_XIO_HTTP_STATUS_LINE: result = globus_i_xio_http_server_write_response( http_handle, iovec, iovec_count, op); break; case GLOBUS_XIO_HTTP_EOF: case GLOBUS_XIO_HTTP_CLOSE: result = GlobusXIOHttpErrorNoEntity(); break; case GLOBUS_XIO_HTTP_CHUNK_BODY: if (http_handle->write_operation.operation != NULL) { result = GlobusXIOErrorAlreadyRegistered(); break; } result = globus_i_xio_http_write_chunk( handle, iovec, iovec_count, op); break; case GLOBUS_XIO_HTTP_IDENTITY_BODY: if (http_handle->write_operation.operation != NULL) { result = GlobusXIOErrorAlreadyRegistered(); break; } result = globus_xio_driver_pass_write( op, (globus_xio_iovec_t *) iovec, iovec_count, globus_xio_operation_get_wait_for(op), globus_i_xio_http_write_callback, http_handle); break; case GLOBUS_XIO_HTTP_PRE_REQUEST_LINE: if(http_handle->delay_write_header) { http_handle->first_write_iovec = iovec; http_handle->first_write_iovec_count = iovec_count; result = globus_i_xio_http_client_write_request( op, http_handle); break; } /* FALLSTHROUGH */ case GLOBUS_XIO_HTTP_REQUEST_LINE: case GLOBUS_XIO_HTTP_HEADERS: case GLOBUS_XIO_HTTP_CHUNK_CRLF: case GLOBUS_XIO_HTTP_CHUNK_LINE: case GLOBUS_XIO_HTTP_CHUNK_FOOTERS: globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_PRE_REQUEST_LINE); globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_REQUEST_LINE); globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_HEADERS); globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_CHUNK_CRLF); globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_CHUNK_LINE); globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_CHUNK_FOOTERS); result = GlobusXIOErrorParameter(handle); break; } globus_mutex_unlock(&http_handle->mutex); return result; } /* globus_i_xio_http_write() */ /** * Write a chunk of data on an HTTP stream * @ingroup globus_i_xio_http_transform * * Frames an iovec that the user wishes to write with a chunk header and * passes it to the transport driver. When the transport returns, * globus_i_xio_http_write_callback() will be called to finish the write * operation. * * Called with the handle's mutex locked. * * @param http_handle * Handle to the HTTP stream. * @param iovec * User's iovec of data to be written. * @param iovec_count * Length of the @a iovec array * @param op * Operation associated with the write. * * @return This function returns GLOBUS_SUCCESS, GLOBUS_XIO_ERROR_MEMORY, or * an error result from globus_xio_driver_pass_write(). * * @retval GLOBUS_SUCCESS * Write framed and passed to the transport. When the transport completes, * it will call the globus_i_xio_write_callback() function to finish * the write operation. * @retval GLOBUS_XIO_ERROR_MEMORY * Unable to process write due to memory constraints. */ globus_result_t globus_i_xio_http_write_chunk( globus_i_xio_http_handle_t * http_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { int i; globus_result_t result; GlobusXIOName(globus_l_xio_http_write_chunk); for (i = 0, http_handle->write_operation.wait_for = 0; i < iovec_count; i++) { http_handle->write_operation.wait_for += iovec[i].iov_len; } if (http_handle->write_operation.wait_for == 0) { /* No content! Return done now (sending 0 length chunk will signal * eof!) */ globus_xio_driver_finished_write(op, GLOBUS_SUCCESS, 0); return GLOBUS_SUCCESS; } http_handle->write_operation.operation = op; http_handle->write_operation.driver_handle = globus_xio_operation_get_driver_handle(op); http_handle->write_operation.iov = globus_libc_malloc((iovec_count + 2) * sizeof(globus_xio_iovec_t)); if (http_handle->write_operation.iov == NULL) { result = GlobusXIOErrorMemory("iovec"); goto error_exit; } /* Chunk header to beginning of iovec we pass */ http_handle->write_operation.iov[0].iov_base = http_handle->write_operation.chunk_size_buffer; http_handle->write_operation.iov[0].iov_len = globus_libc_sprintf( http_handle->write_operation.iov[0].iov_base, "%x\r\n", http_handle->write_operation.wait_for); /* Assert we haven't overwritten our buffer--64 bytes of hex string length * should be sufficient for now */ globus_assert(http_handle->write_operation.iov[0].iov_len < sizeof(http_handle->write_operation.chunk_size_buffer)); for (i = 0; i < iovec_count; i++) { http_handle->write_operation.iov[i+1].iov_base = iovec[i].iov_base; http_handle->write_operation.iov[i+1].iov_len = iovec[i].iov_len; } /* Chunk end (CRLF) to end of iovec we pass */ http_handle->write_operation.iov[iovec_count+1].iov_base = "\r\n"; http_handle->write_operation.iov[iovec_count+1].iov_len = 2; http_handle->write_operation.iovcnt = iovec_count + 2; /* Add to the "wait for" the size of framing tokens */ http_handle->write_operation.wait_for += http_handle->write_operation.iov[0].iov_len + http_handle->write_operation.iov[iovec_count+1].iov_len; return globus_xio_driver_pass_write( http_handle->write_operation.operation, http_handle->write_operation.iov, http_handle->write_operation.iovcnt, http_handle->write_operation.wait_for, globus_i_xio_http_write_callback, http_handle); error_exit: http_handle->write_operation.wait_for = 0; http_handle->write_operation.operation = NULL; http_handle->write_operation.driver_handle = NULL; return result; } /* globus_i_xio_http_write_chunk() */ /** * Write complete callback * @ingroup globus_i_xio_http_transform * * Callback indicating that the transport has finished writing http data. * In chunked mode, we will adjust the nbytes to remove the size of the * chunk framing, otherwise we will finish the write with the value passed * to this callback. * * @param op * Operation associated with the write. * @param result * Transport-level result of writing the data. * @param nbytes * Number of bytes written by the transport. * @param user_arg * Void pointer to a globus_i_xio_http_handle_t. * * @return void */ void globus_i_xio_http_write_callback( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_i_xio_http_header_info_t * headers; GlobusXIOName(globus_i_xio_http_write_callback); if (http_handle->target_info.is_client) { headers = &http_handle->request_info.headers; } else { headers = &http_handle->response_info.headers; } globus_mutex_lock(&http_handle->mutex); if (headers->transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED) { /* Subtract off the amount of data which can be attributed to chunk * header and footer information */ if (result == GLOBUS_SUCCESS) { nbytes -= (http_handle->write_operation.iov[0].iov_len + http_handle->write_operation.iov[ http_handle->write_operation.iovcnt-1].iov_len); } else if (nbytes <= http_handle->write_operation.iov[0].iov_len) { nbytes = 0; } else { nbytes -= http_handle->write_operation.iov[0].iov_len; } /* * Free our copy of the iovec with the chunk framing */ globus_libc_free(http_handle->write_operation.iov); } else if (GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers)) { headers->content_length -= nbytes; if (headers->content_length == 0) { http_handle->send_state = GLOBUS_XIO_HTTP_EOF; } } http_handle->write_operation.iov = NULL; http_handle->write_operation.iovcnt = 0; http_handle->write_operation.operation = NULL; http_handle->write_operation.driver_handle = NULL; http_handle->write_operation.nbytes = 0; http_handle->write_operation.wait_for = 0; if (result != GLOBUS_SUCCESS && http_handle->reopen_in_progress) { globus_object_t * err; err = globus_error_get(result); result = GlobusXIOHttpErrorPersistentConnectionDropped(err); } globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_write(op, result, nbytes); } /* globus_i_xio_http_write_callback() */ /** * Close an HTTP handle * @ingroup globus_i_xio_http_transform * * Starts the process of closing the handle. If the request or response * contains an entity, but end-of-file hasn't been marked on it yet, * then we call globus_i_xio_http_handle_cntl() to mark the end of the entity. * If the handle is all ready to close, we'll call * globus_i_xio_http_close_internal() to register the close events. * * @param handle * Void pointer to a #globus_i_xio_http_handle_t. * @param attr * Close attributes. (Ignored by the HTTP driver). * @param op * Operation associated with the close. * * @retval GLOBUS_XIO_ERROR_ALREADY_REGISTERED * The handle has already been closed. * @retval GLOBUS_XIO_ERROR_PARAMETER * The handle is in some unexpected state and the close could not * be handled. */ globus_result_t globus_i_xio_http_close( void * handle, void * attr, globus_xio_operation_t op) { globus_result_t result; globus_i_xio_http_handle_t * http_handle = handle; GlobusXIOName(globus_i_xio_http_close); globus_mutex_lock(&http_handle->mutex); switch (http_handle->send_state) { case GLOBUS_XIO_HTTP_CLOSE: /* Close already called */ result = GlobusXIOErrorAlreadyRegistered(); break; case GLOBUS_XIO_HTTP_STATUS_LINE: if (! http_handle->target_info.is_client) { /* On server, when we close we ought to set the * "Connection: close" header when we want to close if * we haven't sent our status line yet. */ http_handle->response_info.headers.flags |= GLOBUS_I_XIO_HTTP_HEADER_CONNECTION_CLOSE; } /* FALLSTHROUGH */ case GLOBUS_XIO_HTTP_CHUNK_BODY: http_handle->close_operation = op; http_handle->user_close = GLOBUS_TRUE; result = globus_i_xio_http_set_end_of_entity(http_handle); if (result != GLOBUS_SUCCESS) { http_handle->close_operation = NULL; http_handle->user_close = GLOBUS_FALSE; } break; case GLOBUS_XIO_HTTP_IDENTITY_BODY: globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_IDENTITY_BODY); case GLOBUS_XIO_HTTP_REQUEST_LINE: globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_REQUEST_LINE); case GLOBUS_XIO_HTTP_HEADERS: globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_HEADERS); case GLOBUS_XIO_HTTP_CHUNK_CRLF: globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_CHUNK_CRLF); case GLOBUS_XIO_HTTP_CHUNK_LINE: globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_CHUNK_LINE); case GLOBUS_XIO_HTTP_CHUNK_FOOTERS: globus_assert(http_handle->send_state != GLOBUS_XIO_HTTP_CHUNK_FOOTERS); result = GlobusXIOErrorParameter("header"); break; case GLOBUS_XIO_HTTP_PRE_REQUEST_LINE: case GLOBUS_XIO_HTTP_EOF: http_handle->close_operation = op; http_handle->user_close = GLOBUS_TRUE; if (http_handle->write_operation.operation != NULL) { /* EOF writing in progress, return success and eof callback * will finish the close */ result = GLOBUS_SUCCESS; break; } result = globus_i_xio_http_close_internal(http_handle); if (result != GLOBUS_SUCCESS) { http_handle->close_operation = NULL; http_handle->user_close = GLOBUS_FALSE; } break; } globus_mutex_unlock(&http_handle->mutex); return result; } /* globus_i_xio_http_close() */ /** * Close an http handle * @ingroup globus_i_xio_http_transform * * Pass the close event to the transport. This is either called by the above * or after the end-of-entity callback occurs. In the server case, we delay * 100ms before passing the close to the transport, this seems to help avoid * some ECONNRESET errors on the client side---more investigation is needed to * remove this hack. * * Called with mutex locked. * * @param http_handle * The HTTP handle we will be closing * * @return * This function returns the error result of globus_xio_driver_pass_close(). */ globus_result_t globus_i_xio_http_close_internal( globus_i_xio_http_handle_t * http_handle) { globus_i_xio_http_header_info_t * headers; globus_result_t result; globus_reltime_t delay; if (http_handle->target_info.is_client) { headers = &http_handle->request_info.headers; } else { headers = &http_handle->response_info.headers; } http_handle->send_state = GLOBUS_XIO_HTTP_CLOSE; if (http_handle->target_info.is_client && http_handle->user_close && http_handle->request_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_1 && (!GLOBUS_I_XIO_HTTP_HEADER_IS_CONNECTION_CLOSE( &http_handle->response_info.headers)) && http_handle->parse_state == GLOBUS_XIO_HTTP_EOF) { GlobusTimeReltimeSet(delay, 0, 0); result = globus_callback_register_oneshot( NULL, &delay, globus_l_xio_http_client_cache_kickout, http_handle); if (result == GLOBUS_SUCCESS) { goto finish; } } /* If oneshot registration failed, or if the close is "normal", we'll just * pass the close down */ result = globus_xio_driver_pass_close( http_handle->close_operation, globus_i_xio_http_close_callback, http_handle); finish: return result; } /* globus_i_xio_http_close_internal() */ void globus_i_xio_http_close_callback( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_mutex_lock(&http_handle->mutex); /* * If the close is generated by a failure during open (after we've * opened the transport, then this flag is set to false. */ if (http_handle->user_close) { globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_finished_close(op, result); } else { globus_mutex_unlock(&http_handle->mutex); globus_xio_driver_operation_destroy(http_handle->close_operation); } http_handle->close_operation = NULL; globus_i_xio_http_handle_destroy(user_arg); globus_libc_free(user_arg); } /* globus_i_xio_http_close_callback() */ static void globus_l_xio_http_client_cache_kickout( void * user_arg) { globus_i_xio_http_handle_t * http_handle = user_arg; globus_assert(http_handle->target_info.is_client && http_handle->user_close && http_handle->request_info.http_version==GLOBUS_XIO_HTTP_VERSION_1_1); globus_xio_driver_finished_close( http_handle->close_operation, GLOBUS_SUCCESS); globus_mutex_lock(&globus_i_xio_http_cached_handle_mutex); globus_list_insert(&globus_i_xio_http_cached_handles, http_handle); globus_mutex_unlock(&globus_i_xio_http_cached_handle_mutex); return; } /* globus_l_xio_http_client_cache_kickout() */ static void globus_l_xio_http_read_cancel_callback( globus_xio_operation_t op, void * user_arg, globus_xio_error_type_t reason) { globus_callback_register_oneshot( NULL, &globus_i_reltime_zero, globus_l_xio_http_read_timeout_callback, user_arg); } /* globus_l_xio_http_read_cancel_callback() */ static void globus_l_xio_http_read_timeout_callback( void * user_arg) { globus_list_t * l; globus_i_xio_http_cancellation_t * cancellation = user_arg; globus_mutex_lock(&globus_i_xio_http_cancel_mutex); l = globus_list_search(globus_i_xio_http_cancellable_handles, user_arg); if (l == NULL) { /* if the cancellation info isn't in the list any more, it was removed * by the operation completing before this oneshot fired. We'll free * up memory and quit. */ free(user_arg); } else { /* Operation hasn't completed yet. Cancel our internal read op, and * remove this op from the list */ globus_list_remove(&globus_i_xio_http_cancellable_handles, l); globus_xio_driver_operation_cancel( cancellation->driver_handle, cancellation->internal_op); } globus_mutex_unlock(&globus_i_xio_http_cancel_mutex); } /* globus_l_xio_http_read_timeout_callback() */ globus_xio-3.6/builtins/http/globus_xio_http_header.c0000666000076400007640000002155010363625124020173 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_i_xio_http_header Internal Header Implementation */ #endif /** * Destroy an HTTP Header * @ingroup globus_i_xio_http_header * * Frees all storage associated with an HTTP header. This function should * be passed to globus_hashtable_destroy_all() to free the key and value * of the headers in a hashtable. * * @param header * A void * pointing to the header to be freed. * * @return void */ extern void globus_i_xio_http_header_destroy( void * header) { globus_xio_http_header_t * http_header = header; if (http_header->name != NULL) { globus_libc_free(http_header->name); } if (http_header->value != NULL) { globus_libc_free(http_header->value); } globus_libc_free(http_header); } /* globus_i_xio_http_header_destroy() */ /** * Copy an HTTP header * @ingroup globus_i_xio_http_header * * Makes a new copy of an http header. This function is used in conjunction * with globus_hashtable_copy() to generate a duplicate of a HTTP header * hashtable. * * @param dest_key * Pointer to a void * which will be set to the HTTP header * name. * @param dest_datum * Pointer to a void * which will be set to point to * the HTTP header structure. * @param src_key * A void * pointing to the HTTP header name in the original * hashtable. This is ignored, as the name is stored in the HTTP header * structure in @a src_datum. * @param src_datum * A void * pointing to the HTTP header structure in the * original hashtable to copy. * * @return void */ extern void globus_i_xio_http_header_copy( void ** dest_key, void ** dest_datum, void * src_key, void * src_datum) { globus_xio_http_header_t * dest_header; globus_xio_http_header_t * src_header = src_datum; dest_header = globus_libc_malloc(sizeof(globus_xio_http_header_t)); globus_assert(dest_header != NULL); dest_header->name = globus_libc_strdup(src_header->name); globus_assert(dest_header->name); dest_header->value = globus_libc_strdup(src_header->value); globus_assert(dest_header->value); *dest_key = dest_header->name; *dest_datum = dest_header; } /* globus_i_xio_http_header_copy() */ /** * Parse HTTP headers * @ingroup globus_i_xio_http_header * * Parse the header block of an HTTP request or response. If the entire header * section is parsed, then the boolean pointed to by @a done will be modified * to be GLOBUS_TRUE. * * @param http_handle * HTTP handle containing the buffer to be parsed. * @param done * Pointer to flag indicating whether the header parsing completed. * * @retval GLOBUS_SUCCESS * No parsing errors occurred. More data may be required to finish parsing * the headers, depending on the final value of the boolean pointed to * by @a done. * @retval GLOBUS_XIO_ERROR_MEMORY * Parsing failed because of insufficient memory. * @retval ::GLOBUS_XIO_HTTP_ERROR_PARSE * Error parsing a header. */ globus_result_t globus_i_xio_http_header_parse( globus_i_xio_http_handle_t * http_handle, globus_bool_t * done) { globus_result_t result; char * eol; char * current_offset; int parsed; globus_i_xio_http_header_info_t * headers; char * header_name; char * header_value; int rc; GlobusXIOName(globus_i_xio_http_header_parse); if (http_handle->target_info.is_client) { headers = &http_handle->response_info.headers; } else { headers = &http_handle->request_info.headers; } current_offset = ((char *) (http_handle->read_buffer.iov_base)) + http_handle->read_buffer_offset; /* * While we find a non-empty line, we are in the header block. */ while ((eol = globus_i_xio_http_find_eol( current_offset, http_handle->read_buffer_valid)) != current_offset) { if (eol == NULL) { /* Full headers not present */ *done = GLOBUS_FALSE; return GLOBUS_SUCCESS; } if ((eol - current_offset + 2) < http_handle->read_buffer_valid) { /* Peek ahead for LWS for multi-line headers */ if (*(eol+2) == ' ' || *(eol+2) == '\t') { /* * first char after eol is space or tab---convert CRLF * into space and try again. */ *(eol) = ' '; *(eol+1) = ' '; continue; } } *eol = '\0'; /* Find end of header name */ rc = sscanf(current_offset, "%*[^: \t\r\n]%n", &parsed); if (rc < 0) { result = GlobusXIOHttpErrorParse("field-name", current_offset); goto error_exit; } header_name = current_offset; if (*(current_offset+parsed) != ':') { result = GlobusXIOHttpErrorParse("field-name", current_offset); goto error_exit; } /* replace : with '\0' */ *(current_offset+parsed) = '\0'; parsed++; current_offset += parsed; /* Find end of post-colon whitespace */ rc = sscanf(current_offset, " %n", &parsed); if (rc < 0) { result = GlobusXIOHttpErrorParse("header-value", current_offset); goto error_exit; } /* Skip leading whitespace */ current_offset += parsed; header_value = current_offset; /* skip past \r\n */ current_offset = eol + 2; parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; /* Actually deal with the header */ result = globus_i_xio_http_header_info_set_header( headers, header_name, header_value); if (result != GLOBUS_SUCCESS) { goto error_exit; } } if (eol != NULL) { /* We found an empty line----end of headers found. */ *done = GLOBUS_TRUE; current_offset = eol+2; parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_offset += parsed; /* Decide how we will handle the next data coming on the stream. * * If we are chunked, a client of an HTTP/1.0 server, or have a content * length header, then we should expect an entity body. Otherwise, * the headers are the end of the message. */ if (headers->transfer_encoding == GLOBUS_XIO_HTTP_TRANSFER_ENCODING_CHUNKED) { http_handle->parse_state = GLOBUS_XIO_HTTP_CHUNK_LINE; } else if ((http_handle->target_info.is_client && http_handle->response_info.http_version == GLOBUS_XIO_HTTP_VERSION_1_0) || GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers)) { http_handle->parse_state = GLOBUS_XIO_HTTP_IDENTITY_BODY; } else { http_handle->parse_state = GLOBUS_XIO_HTTP_EOF; } } else { /* We ran out of lines before finishing parsing */ *done = GLOBUS_FALSE; } return GLOBUS_SUCCESS; error_exit: parsed = current_offset - ((char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset); /* Chop off what we managed to parse from the buffer */ http_handle->read_buffer_valid -= parsed; http_handle->read_buffer_valid += parsed; return result; } /* globus_i_xio_http_header_parse() */ globus_xio-3.6/builtins/http/Makefile.in0000664000076400007640000004550712225614604015361 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins/http ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_http_driver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_http.lo globus_xio_http_attr.lo \ globus_xio_http_client.lo globus_xio_http_handle.lo \ globus_xio_http_header.lo globus_xio_http_header_info.lo \ globus_xio_http_request.lo globus_xio_http_response.lo \ globus_xio_http_rfc2616.lo globus_xio_http_server.lo \ globus_xio_http_target.lo globus_xio_http_transform.lo am_libglobus_xio_http_driver_la_OBJECTS = $(am__objects_1) libglobus_xio_http_driver_la_OBJECTS = \ $(am_libglobus_xio_http_driver_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_http_driver_la_SOURCES) DIST_SOURCES = $(libglobus_xio_http_driver_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies Sources = \ globus_xio_http.c \ globus_xio_http_attr.c \ globus_xio_http_client.c \ globus_xio_http_handle.c \ globus_xio_http_header.c \ globus_xio_http_header_info.c \ globus_xio_http_request.c \ globus_xio_http_response.c \ globus_xio_http_rfc2616.c \ globus_xio_http_server.c \ globus_xio_http_target.c \ globus_xio_http_transform.c \ globus_i_xio_http_responses.h \ globus_i_xio_http.h \ globus_xio_http.h include_HEADERS = \ globus_xio_http.h noinst_HEADERS = \ globus_i_xio_http.h \ globus_i_xio_http_responses.h noinst_LTLIBRARIES = libglobus_xio_http_driver.la INCLUDES = -I$(top_srcdir) $(GPT_INCLUDES) libglobus_xio_http_driver_la_SOURCES = $(Sources) libglobus_xio_http_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_http_driver_la_LIBADD = $(GPT_LIB_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/http/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/http/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio_http_driver.la: $(libglobus_xio_http_driver_la_OBJECTS) $(libglobus_xio_http_driver_la_DEPENDENCIES) $(LINK) $(libglobus_xio_http_driver_la_LDFLAGS) $(libglobus_xio_http_driver_la_OBJECTS) $(libglobus_xio_http_driver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-includeHEADERS : unlink: unlink-recursive unlink-includeHEADERS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS filelist: filelist-recursive filelist-includeHEADERS : link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/builtins/http/globus_xio_http.c0000666000076400007640000002763111060324176016667 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_http.h" #include "version.h" #include #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @file globus_xio_http.c */ /** * @defgroup globus_i_xio_http_util Internal HTTP Utility Functions */ #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ static int globus_l_xio_http_activate(void); static int globus_l_xio_http_deactivate(void); GlobusXIODefineModule(http) = { "globus_xio_http", /*module name*/ globus_l_xio_http_activate, /*activate*/ globus_l_xio_http_deactivate, /*deactivate*/ GLOBUS_NULL, /*at exit*/ GLOBUS_NULL, /*get pointer*/ &local_version /*version*/ }; static globus_result_t globus_l_xio_http_init( globus_xio_driver_t * out_driver) { globus_xio_driver_t driver; globus_result_t res; res = globus_xio_driver_init(&driver, "http", NULL); if(res != GLOBUS_SUCCESS) { return res; } globus_xio_driver_set_transform( driver, globus_i_xio_http_open, globus_i_xio_http_close, globus_i_xio_http_read, globus_i_xio_http_write, globus_i_xio_http_handle_cntl, NULL); globus_xio_driver_set_server( driver, NULL, globus_i_xio_http_accept, NULL, NULL, NULL, globus_i_xio_http_target_destroy); globus_xio_driver_set_attr( driver, globus_i_xio_http_attr_init, globus_i_xio_http_attr_copy, globus_i_xio_http_attr_cntl, globus_i_xio_http_attr_destroy); *out_driver = driver; return GLOBUS_SUCCESS; } /* globus_l_xio_http_init() */ static void globus_l_xio_http_destroy( globus_xio_driver_t driver) { globus_xio_driver_destroy(driver); } /* globus_l_xio_http_destroy() */ /** * Copy a block of data into an iovec fifo. * * @param iovecs * A fifo of iovec pointers. Each iovec will be GLOBUS_XIO_HTTP_CHUNK_SIZE * bytes long. If the last one in the fifo is full, a new one * will be allocated from a memory pool and used. iovecs in this * fifo must be freed by calling globus_libc_free(). * @param data * Pointer to a data block. * @param datalen * Length of the data block. */ globus_result_t globus_i_xio_http_copy_blob( globus_fifo_t * iovecs, const char * data, size_t datalen) { globus_xio_iovec_t * iov = NULL; size_t to_copy; GlobusXIOName(globus_l_http_copy_blob); if (globus_fifo_size(iovecs) > 0) { iov = globus_fifo_tail_peek(iovecs); } while (datalen > 0) { if (iov == NULL || iov->iov_len == GLOBUS_XIO_HTTP_CHUNK_SIZE) { iov = globus_libc_malloc(sizeof(globus_xio_iovec_t)); if (iov == NULL) { return GlobusXIOErrorMemory("iovec"); } iov->iov_base = globus_libc_malloc(GLOBUS_XIO_HTTP_CHUNK_SIZE); if (iov->iov_base == NULL) { globus_free(iov); return GlobusXIOErrorMemory("iovec.iov_base"); } iov->iov_len = 0; globus_fifo_enqueue(iovecs, iov); } to_copy = GLOBUS_XIO_HTTP_CHUNK_SIZE - iov->iov_len; if (datalen < to_copy) { to_copy = datalen; } memcpy((char *) iov->iov_base + iov->iov_len, data, to_copy); iov->iov_len += to_copy; datalen -= to_copy; data += to_copy; } return GLOBUS_SUCCESS; } /* globus_l_xio_http_copy_blob() */ /** * Determine whether an HTTP method should contain an entity. * @ingroup globus_i_xio_http_util * * Based on the information in RFC 2616, determine whether the method * should contain an HTTP entity body along with it. This information is * used to determine whether the client should be required to explicitly * call the GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY handle control. * * @param method * HTTP Method name * * @retval GLOBUS_TRUE * The client's HTTP method requires an entity-body by default. * @retval GLOBUS_FALSE * The client's HTTP method does not require an entity-body by default. */ globus_bool_t globus_i_xio_http_method_requires_entity( const char * method) { char * methods_with_entity[] = { "OPTIONS", "POST", "PUT" }; int i; for (i = 0; i < GLOBUS_XIO_ARRAY_LENGTH(methods_with_entity); i++) { if (strcmp(method, methods_with_entity[i]) == 0) { return GLOBUS_TRUE; } } return GLOBUS_FALSE; } /* globus_i_xio_http_method_requires_entity() */ /** * Choose HTTP version based on major and minor version numbers * @ingroup globus_i_xio_http_util * * Determine from an HTTP major and minor version which * #globus_xio_http_version_t best describes the HTTP version. * * @param http_major * Major version to use for the basis of our guess. * @param http_minor * Minor version to use for the basis of our guess. * * @retval GLOBUS_XIO_HTTP_VERSION_1_0 * The version number is definitely less than 1.1 * @retval GLOBUS_XIO_HTTP_VERSION_1_1 * The version number is definitely greater than 1.0 */ globus_xio_http_version_t globus_i_xio_http_guess_version( int http_minor, int http_major) { if (http_major > 1) { /* Unknown major version, assume compatible with 1.1 */ return GLOBUS_XIO_HTTP_VERSION_1_1; } else if (http_major < 1) { /* Unknown major version, assume compatible with 1.0 */ return GLOBUS_XIO_HTTP_VERSION_1_0; } else if (http_minor == 0) { /* definitely 1.0 */ return GLOBUS_XIO_HTTP_VERSION_1_0; } else { /* definitely 1.1 */ return GLOBUS_XIO_HTTP_VERSION_1_1; } } /* globus_i_xio_http_guess_version() */ /** * Locate the next CRLF sequence in a byte array * @ingroup globus_i_xio_http_util * * Finds the next CRLF sequence in a byte array, returning a pointer to * the beginning of the sequence. * * @param blob * Character array to search through. * @param blob_length * Length of valid data in the @a blob array. * * @return * This function returns either a pointer to the beginning of the CRLF * sequence or NULL, if no such sequence was found. */ char * globus_i_xio_http_find_eol( const char * blob, globus_size_t blob_length) { char * result; globus_size_t skip = 0; while (((skip + 1) < blob_length) && (result = memchr(blob + skip, '\r', blob_length-skip)) != NULL) { if (result+1 == (blob + skip + blob_length)) { return NULL; } else if (*(result+1) == '\n') { return result; } else { skip += (result - blob + 1); } } return NULL; } /* globus_i_xio_http_find_eol() */ /** * Prepare the read buffer of a http handle for a new read * @ingroup globus_i_xio_http_util * * Resets the read_buffer-related fields of the handle so that another * read can be passed with it. The read_buffer may be extended if it is * currently full. * * @param http_handle * Handle to modify. * * @retval GLOBUS_SUCCESS * Some space was freed up in the read buffer * @retval GLOBUS_XIO_ERROR_MEMORY * Unable to resize the read buffer to allow more data in. */ globus_result_t globus_i_xio_http_clean_read_buffer( globus_i_xio_http_handle_t * http_handle) { globus_result_t result; GlobusXIOName(globus_i_xio_http_clean_read_buffer); if (http_handle->read_buffer_valid == 0) { /* Nothing in buffer, can reuse in its entirety */ http_handle->read_buffer_offset = 0; } else if (http_handle->read_buffer_valid < http_handle->read_buffer.iov_len) { /* Something in buffer, but there's some slack left, shift to beginning * and reuse part of the buffer */ memmove(http_handle->read_buffer.iov_base, (char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset, http_handle->read_buffer_valid); http_handle->read_buffer_offset = 0; } else { /* Buffer is totally full, extend it */ void * tmp_buf = http_handle->read_buffer.iov_base; http_handle->read_buffer.iov_base = globus_libc_realloc( http_handle->read_buffer.iov_base, http_handle->read_buffer.iov_len + GLOBUS_XIO_HTTP_CHUNK_SIZE); if (http_handle->read_buffer.iov_base == NULL) { http_handle->read_buffer.iov_base = tmp_buf; result = GlobusXIOErrorMemory("read_buffer"); goto error_exit; } http_handle->read_buffer.iov_len += GLOBUS_XIO_HTTP_CHUNK_SIZE; } /* * Set read iovec to point to part of the buffer without any * data in it. */ http_handle->read_iovec.iov_base = (char *) http_handle->read_buffer.iov_base + http_handle->read_buffer_offset + http_handle->read_buffer_valid; http_handle->read_iovec.iov_len = http_handle->read_buffer.iov_len - http_handle->read_buffer_offset - http_handle->read_buffer_valid; return GLOBUS_SUCCESS; error_exit: return result; } /* globus_i_xio_http_cleanup_read_buffer() */ GlobusXIODefineDriver( http, globus_l_xio_http_init, globus_l_xio_http_destroy); static int globus_l_xio_http_activate(void) { int rc; rc = globus_module_activate(GLOBUS_XIO_MODULE); globus_mutex_init(&globus_i_xio_http_cached_handle_mutex, NULL); globus_mutex_init(&globus_i_xio_http_cancel_mutex, NULL); globus_i_xio_http_cached_handles = NULL; globus_i_xio_http_cancellable_handles = NULL; if(rc == GLOBUS_SUCCESS) { GlobusXIORegisterDriver(http); } return rc; } static int globus_l_xio_http_deactivate(void) { globus_i_xio_http_handle_t * http_handle; globus_result_t result; GlobusXIOUnRegisterDriver(http); globus_mutex_lock(&globus_i_xio_http_cached_handle_mutex); while (!globus_list_empty(globus_i_xio_http_cached_handles)) { http_handle = globus_list_remove( &globus_i_xio_http_cached_handles, globus_i_xio_http_cached_handles); result = globus_xio_driver_operation_create( &http_handle->close_operation, http_handle->handle); globus_assert(result == GLOBUS_SUCCESS); http_handle->user_close = GLOBUS_FALSE; result = globus_i_xio_http_close_internal(http_handle); globus_assert(result == GLOBUS_SUCCESS); } globus_mutex_unlock(&globus_i_xio_http_cached_handle_mutex); globus_mutex_destroy(&globus_i_xio_http_cached_handle_mutex); globus_mutex_destroy(&globus_i_xio_http_cancel_mutex); return globus_module_deactivate(GLOBUS_XIO_MODULE); } globus_xio-3.6/builtins/ordering/0000775000076400007640000000000012225614637014221 500000000000000globus_xio-3.6/builtins/ordering/globus_xio_ordering_driver.h0000666000076400007640000001605011522621711021722 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_XIO_ORDERING_DRIVER_INCLUDE #define GLOBUS_XIO_ORDERING_DRIVER_INCLUDE /** * @file * Header file for XIO ORDERING Driver */ #include "globus_common.h" /** * @defgroup ordering_driver Globus XIO ORDERING Driver */ /** * @defgroup ordering_driver_instance Opening/Closing * @ingroup ordering_driver * Ordering driver is a transform driver and thus has to be used on top of a * transport driver. An XIO handle with the ordering driver can be created with * either @ref globus_xio_handle_create() or * @ref globus_xio_server_register_accept(). * * When the XIO handle is closed, the ordering driver will destroy its internal * resources. */ /** * @defgroup ordering_driver_io Reading/Writing * @ingroup ordering_driver * Ordering driver does not allow multiple @ref globus_xio_register_read() * to be outstanding. This limitation is there to enforce that the users get * the read callback in order. There is a known issue in enforcing the order * in which read callbacks are delivered with multiple outstanding reads. This * limitation does not restrict the use of parallel reads feature provided by * the underlying transport driver. @ref GLOBUS_XIO_ORDERING_SET_MAX_READ_COUNT * on the attr can be used to specify the number of parallel reads. Ordering * will have a maximum of this many number of reads outstanding to the driver * below it on the stack. It buffers the data read and delivers it to the user * in order. * * @ref globus_xio_register_write() does not enforce any restriction. * */ /** * @defgroup ordering_driver_envs Env Variables * @ingroup ordering_driver * * The ordering driver uses the following environment variable * - GLOBUS_XIO_ORDERING_DEBUG Available if using a debug build. See * globus_debug.h for format. */ /** * @defgroup ordering_driver_cntls Attributes and Cntls * @ingroup ordering_driver * * Ordering driver specific attrs and cntls. * * @see globus_xio_attr_cntl() * @see globus_xio_handle_cntl() */ /** * @defgroup ordering_driver_types Types * @ingroup ordering_driver */ /** * @defgroup ordering_driver_errors Error Types * @ingroup ordering_driver * * The errors reported by ORDERING driver include * GLOBUS_XIO_ERROR_COMMAND, GLOBUS_XIO_ERROR_MEMORY, GLOBUS_XIO_ERROR_STATE, * GLOBUS_XIO_ERROR_CANCELED * * @see globus_xio_driver_error_match() * @see globus_error_errno_match() */ /** doxygen varargs filter stuff * GlobusVarArgDefine( * attr, globus_result_t, globus_xio_attr_cntl, attr, driver) * GlobusVarArgDefine( * handle, globus_result_t, globus_xio_handle_cntl, handle, driver) */ /** * ORDERING driver specific error types * @ingroup ordering_driver_errors */ typedef enum { /** * Indicates that an error occured in reading data */ GLOBUS_XIO_ORDERING_ERROR_READ, /** * Indicates an error occured in canceling an operation */ GLOBUS_XIO_ORDERING_ERROR_CANCEL } globus_xio_ordering_error_type_t; /** * ORDERING driver specific cntls * @ingroup ordering_driver_cntls */ typedef enum { /** GlobusVarArgEnum(handle) * Set offset for the next IO operation. This is not allowed when there is * an outstanding IO operation. This operation clears all the buffered data. * @ingroup ordering_driver_cntls * * @param offset * Specifies the offset to use in the next IO operation. */ /* globus_off_t offset */ GLOBUS_XIO_ORDERING_SET_OFFSET, /** GlobusVarArgEnum(attr) * Set the maximum number of reads that ordering driver can have outstanding * on driver(s) below. * @ingroup ordering_driver_cntls * * @param max_read_count * Specifies the maximum number of parallel reads (default is 1). */ /* int max_read_count */ GLOBUS_XIO_ORDERING_SET_MAX_READ_COUNT, /** GlobusVarArgEnum(attr) * Get the maximum number of parallel reads set on the attr. * @ingroup ordering_driver_cntls * * @param max_read_count_out * The maximum number of parallel reads allowed will be stored here. */ /* int * max_read_count_out */ GLOBUS_XIO_ORDERING_GET_MAX_READ_COUNT, /** GlobusVarArgEnum(attr) * This driver can be used in 2 modes; ordering (care about offsets of the * data read - underlying transport driver may deliver data out of order - * this driver will rearrange data based on the offset and deliver inorder * to user) and buffering (do not care about offsets - just buffer the data * read abd deliver it when requested). This attribute control can be used * to enable buffering. * @ingroup ordering_driver_cntls * * @param buffering * GLOBUS_TRUE to enable buffering, GLOBUS_FALSE (default) to disable * buffering. */ /* globus_bool_t buffering */ GLOBUS_XIO_ORDERING_SET_BUFFERING, /** GlobusVarArgEnum(attr) * Get the buffering flag on the attr. * @ingroup ordering_driver_cntls * * @param buffering_out * Buffering flag will be stored in here. */ /* globus_bool_t * buffering_out */ GLOBUS_XIO_ORDERING_GET_BUFFERING, /** GlobusVarArgEnum(attr) * Set the size of the buffer that ordering driver creates to use for * reading data from the driver below it. * @ingroup ordering_driver_cntls * * @param buf_size * Specifies the buffer size for internal reads (default is 100 KB). */ /* int buf_size */ GLOBUS_XIO_ORDERING_SET_BUF_SIZE, /** GlobusVarArgEnum(attr) * Get the size of the buffer used for the internal reads. * @ingroup ordering_driver_cntls * * @param buf_size_out * The buffer size will be stored in here. */ /* int * buf_size_out */ GLOBUS_XIO_ORDERING_GET_BUF_SIZE, /** GlobusVarArgEnum(attr) * Set the maximum number of buffers that this driver can create for * reading data from the driver below it. * @ingroup ordering_driver_cntls * * @param max_buf_count * Specifies the max buffer count for internal reads (default is 100). */ /* int max_buf_count */ GLOBUS_XIO_ORDERING_SET_MAX_BUF_COUNT, /** GlobusVarArgEnum(attr) * Get the maximum buffer count set on the attr. * @ingroup ordering_driver_cntls * * @param max_buf_count_out * The maximun buffer count will be stored in here. */ /* int * max_buf_count_out */ GLOBUS_XIO_ORDERING_GET_MAX_BUF_COUNT } globus_xio_ordering_cmd_t; #endif globus_xio-3.6/builtins/ordering/Makefile.am0000666000076400007640000000101111462370275016167 00000000000000include $(top_srcdir)/globus_automake_pre Sources= \ globus_xio_ordering_driver.c include_HEADERS = \ globus_xio_ordering_driver.h noinst_LTLIBRARIES = libglobus_xio_ordering_driver.la INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/builtins/udp \ -I$(top_srcdir)/builtins/tcp $(GPT_INCLUDES) libglobus_xio_ordering_driver_la_SOURCES = $(Sources) libglobus_xio_ordering_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_ordering_driver_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_xio-3.6/builtins/ordering/Makefile.in0000664000076400007640000004422212225614604016204 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins/ordering ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_ordering_driver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_ordering_driver.lo am_libglobus_xio_ordering_driver_la_OBJECTS = $(am__objects_1) libglobus_xio_ordering_driver_la_OBJECTS = \ $(am_libglobus_xio_ordering_driver_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_ordering_driver_la_SOURCES) DIST_SOURCES = $(libglobus_xio_ordering_driver_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies Sources = \ globus_xio_ordering_driver.c include_HEADERS = \ globus_xio_ordering_driver.h noinst_LTLIBRARIES = libglobus_xio_ordering_driver.la INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/builtins/udp \ -I$(top_srcdir)/builtins/tcp $(GPT_INCLUDES) libglobus_xio_ordering_driver_la_SOURCES = $(Sources) libglobus_xio_ordering_driver_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_ordering_driver_la_LIBADD = $(GPT_LIB_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/ordering/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/ordering/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio_ordering_driver.la: $(libglobus_xio_ordering_driver_la_OBJECTS) $(libglobus_xio_ordering_driver_la_DEPENDENCIES) $(LINK) $(libglobus_xio_ordering_driver_la_LDFLAGS) $(libglobus_xio_ordering_driver_la_OBJECTS) $(libglobus_xio_ordering_driver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-includeHEADERS : unlink: unlink-recursive unlink-includeHEADERS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS filelist: filelist-recursive filelist-includeHEADERS : link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/builtins/ordering/globus_xio_ordering_driver.c0000666000076400007640000015040211522621710021714 00000000000000/* * Portions of this file Copyright 1999-2005 University of Chicago * Portions of this file Copyright 1999-2005 The University of Southern California. * * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ #include "globus_xio_driver.h" #include "globus_xio_ordering_driver.h" #include "version.h" GlobusDebugDefine(GLOBUS_XIO_ORDERING); GlobusXIODeclareDriver(ordering); #define GlobusXIOOrderingDebugPrintf(level, message) \ GlobusDebugPrintf(GLOBUS_XIO_ORDERING, level, message) #define GlobusXIOOrderingDebugEnter() \ GlobusXIOOrderingDebugPrintf( \ GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, \ ("[%s] Entering\n", _xio_name)) #define GlobusXIOOrderingDebugExit() \ GlobusXIOOrderingDebugPrintf( \ GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, \ ("[%s] Exiting\n", _xio_name)) #define GlobusXIOOrderingDebugExitWithError() \ GlobusXIOOrderingDebugPrintf( \ GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, \ ("[%s] Exiting with error\n", _xio_name)) enum globus_l_xio_error_levels { GLOBUS_L_XIO_ORDERING_DEBUG_TRACE = 1, GLOBUS_L_XIO_ORDERING_DEBUG_INTERNAL_TRACE = 2 }; typedef enum globus_i_xio_ordering_state_s { GLOBUS_XIO_ORDERING_NONE, GLOBUS_XIO_ORDERING_READY, GLOBUS_XIO_ORDERING_IO_PENDING, GLOBUS_XIO_ORDERING_EOF_RECEIVED, GLOBUS_XIO_ORDERING_EOF_DELIVERED, GLOBUS_XIO_ORDERING_CLOSE_PENDING, GLOBUS_XIO_ORDERING_CLOSING, GLOBUS_XIO_ORDERING_ERROR } globus_i_xio_ordering_state_t; typedef struct { /* Specifies max number of reads that could be outstanding at any time */ int max_read_count; globus_bool_t buffering; globus_size_t buf_size; /* Specifies max number of buffers that could be outstanding at any time */ int max_buf_count; } globus_l_xio_ordering_attr_t; static globus_l_xio_ordering_attr_t globus_l_xio_ordering_attr_default = { 1, GLOBUS_FALSE, 100000, 100 }; typedef struct globus_l_xio_ordering_user_req_s globus_l_xio_ordering_user_req_t; typedef struct { globus_l_xio_ordering_attr_t * attr; globus_i_xio_ordering_state_t state; globus_l_xio_ordering_user_req_t * user_req; globus_priority_q_t buffer_q; globus_list_t * driver_op_list; globus_mutex_t mutex; globus_off_t offset; globus_off_t expected_offset; int outstanding_read_count; int read_count; int write_count; int buffer_count; globus_xio_operation_t close_op; globus_xio_driver_handle_t driver_handle; globus_object_t * error; } globus_l_xio_ordering_handle_t; struct globus_l_xio_ordering_user_req_s { globus_xio_operation_t op; globus_xio_iovec_t * iovec; int iovec_count; int index; globus_off_t offset; globus_size_t length; globus_size_t wait_for; globus_size_t nbytes; globus_object_t * error; }; typedef struct { globus_xio_operation_t op; globus_l_xio_ordering_handle_t * handle; globus_xio_iovec_t * iovec; globus_off_t offset; globus_off_t data_offset; globus_size_t nbytes; globus_object_t * error; } globus_l_xio_ordering_buffer_t; static int globus_l_xio_ordering_activate(void); static int globus_l_xio_ordering_deactivate(void); static void globus_l_xio_ordering_read_cb( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); static void globus_l_xio_ordering_close_cb( globus_xio_operation_t op, globus_result_t result, void * user_arg); static globus_result_t globus_l_xio_ordering_attr_init( void ** out_attr); static globus_result_t globus_l_xio_ordering_attr_copy( void ** dst, void * src); static globus_result_t globus_l_xio_ordering_attr_destroy( void * driver_attr); GlobusXIODefineModule(ordering) = { "globus_xio_ordering", globus_l_xio_ordering_activate, globus_l_xio_ordering_deactivate, GLOBUS_NULL, GLOBUS_NULL, &local_version }; #define GlobusXIOOrderingErrorRead(reason) \ globus_error_put( \ globus_error_construct_error( \ GlobusXIOMyModule(ordering), \ GLOBUS_NULL, \ GLOBUS_XIO_ORDERING_ERROR_READ, \ __FILE__, \ _xio_name, \ __LINE__, \ "Read error: %s", (reason))) #define GlobusXIOOrderingErrorCancel(reason) \ globus_error_put( \ globus_error_construct_error( \ GlobusXIOMyModule(ordering), \ GLOBUS_NULL, \ GLOBUS_XIO_ORDERING_ERROR_CANCEL, \ __FILE__, \ _xio_name, \ __LINE__, \ "Read error: %s", (reason))) #define GlobusXIOOrderingMin(min, size1, size2) \ do \ { \ globus_size_t _size1; \ globus_size_t _size2; \ globus_size_t _min; \ _size1 = (size1); \ _size2 = (size2); \ if (_size1 > _size2) \ { \ _min = _size2; \ } \ else \ { \ _min = _size1; \ } \ min = _min; \ } while(0) static int globus_l_xio_ordering_activate(void) { int rc; GlobusXIOName(globus_l_xio_ordering_activate); GlobusDebugInit(GLOBUS_XIO_ORDERING, TRACE); GlobusXIOOrderingDebugEnter(); rc = globus_module_activate(GLOBUS_XIO_MODULE); if (rc != GLOBUS_SUCCESS) { goto error_xio_system_activate; } GlobusXIORegisterDriver(ordering); GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error_xio_system_activate: GlobusXIOOrderingDebugExitWithError(); GlobusDebugDestroy(GLOBUS_XIO_ORDERING); return rc; } static int globus_l_xio_ordering_deactivate(void) { int rc; GlobusXIOName(globus_l_xio_ordering_deactivate); GlobusXIOOrderingDebugEnter(); GlobusXIOUnRegisterDriver(ordering); rc = globus_module_deactivate(GLOBUS_XIO_MODULE); if (rc != GLOBUS_SUCCESS) { goto error_deactivate; } GlobusXIOOrderingDebugExit(); GlobusDebugDestroy(GLOBUS_XIO_ORDERING); return GLOBUS_SUCCESS; error_deactivate: GlobusXIOOrderingDebugExitWithError(); GlobusDebugDestroy(GLOBUS_XIO_ORDERING); return rc; } static int globus_l_xio_ordering_offset_cmp( void * priority1, void * priority2) { globus_off_t * offset1; globus_off_t * offset2; int rc = 0; GlobusXIOName(globus_l_xio_ordering_offset_cmp); GlobusXIOOrderingDebugEnter(); offset1 = (globus_off_t *)priority1; offset2 = (globus_off_t *)priority2; if (*offset1 > *offset2) { rc = 1; } else if (*offset1 < *offset2) { rc = -1; } GlobusXIOOrderingDebugExit(); return rc; } static globus_result_t globus_l_xio_ordering_handle_destroy( globus_l_xio_ordering_handle_t * handle) { globus_result_t result; GlobusXIOName(globus_l_xio_ordering_handle_destroy); GlobusXIOOrderingDebugEnter(); result = globus_l_xio_ordering_attr_destroy(handle->attr); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_ordering_attr_destroy", result); goto error; } globus_object_free(handle->error); globus_priority_q_destroy(&handle->buffer_q); if (handle->driver_op_list) { globus_list_free(handle->driver_op_list); } globus_mutex_destroy(&handle->mutex); globus_free(handle); GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error: GlobusXIOOrderingDebugExitWithError(); return result; } static void globus_i_xio_ordering_save_error( globus_l_xio_ordering_handle_t * handle, globus_result_t result) { GlobusXIOName(globus_i_xio_ordering_save_error); GlobusXIOOrderingDebugEnter(); handle->state = GLOBUS_XIO_ORDERING_ERROR; if (handle->error == GLOBUS_NULL) { handle->error = globus_object_copy(globus_error_peek(result)); } GlobusXIOOrderingDebugExit(); } /* allocate the memory for and initialize an internal handle */ static globus_result_t globus_l_xio_ordering_handle_create( globus_l_xio_ordering_handle_t ** out_handle, globus_l_xio_ordering_attr_t * attr) { globus_l_xio_ordering_handle_t * handle; globus_result_t result; globus_size_t handle_size; GlobusXIOName(globus_l_xio_ordering_handle_create); GlobusXIOOrderingDebugEnter(); handle_size = sizeof(globus_l_xio_ordering_handle_t); handle = (globus_l_xio_ordering_handle_t *)globus_malloc(handle_size); if (handle == GLOBUS_NULL) { result = GlobusXIOErrorMemory("handle"); goto error_handle; } memset(handle, 0, handle_size); handle->user_req = (globus_l_xio_ordering_user_req_t *) globus_malloc(sizeof(globus_l_xio_ordering_user_req_t)); if (handle->user_req == GLOBUS_NULL) { goto error_user_req; } if (!attr) { result = globus_l_xio_ordering_attr_init((void**)(void*)&handle->attr); } else { result = globus_l_xio_ordering_attr_copy( (void**)(void*)&handle->attr, (void*)attr); } if (result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_ordering_attr_copy", result); goto error_attr; } result = globus_priority_q_init( &handle->buffer_q, globus_l_xio_ordering_offset_cmp); if (result != GLOBUS_SUCCESS) { goto error_buffer_q_init; } memset(handle->user_req, 0, sizeof(globus_l_xio_ordering_user_req_t)); globus_mutex_init(&handle->mutex, NULL); GlobusXIOOrderingDebugExit(); *out_handle = handle; return GLOBUS_SUCCESS; error_buffer_q_init: globus_l_xio_ordering_attr_destroy(handle->attr); error_attr: globus_free(handle->user_req); error_user_req: globus_free(handle); error_handle: GlobusXIOOrderingDebugExitWithError(); return result; } /* called locked */ static globus_result_t globus_i_xio_ordering_register_read( globus_l_xio_ordering_handle_t * handle, globus_l_xio_ordering_buffer_t * buffer) { globus_list_t * op_sub_list; globus_result_t result; GlobusXIOName(globus_i_xio_ordering_regsiter_read); GlobusXIOOrderingDebugEnter(); if (!buffer) { /* I'm allocated to create upto attr->max_buf_count no. of buffers */ if (handle->buffer_count >= handle->attr->max_buf_count) { result = GlobusXIOErrorMemory("too many buffers"); goto error_buffer; } buffer = (globus_l_xio_ordering_buffer_t *) globus_malloc(sizeof(globus_l_xio_ordering_buffer_t)); if (!buffer) { result = GlobusXIOErrorMemory("buffer"); goto error_buffer; } memset(buffer, 0, sizeof(globus_l_xio_ordering_buffer_t)); buffer->iovec = (globus_xio_iovec_t *) globus_malloc( sizeof(globus_xio_iovec_t)); if (!buffer->iovec) { result = GlobusXIOErrorMemory("buffer->iovec"); goto error_iovec; } buffer->iovec[0].iov_base = globus_malloc( sizeof(globus_byte_t) * handle->attr->buf_size); if (!buffer->iovec[0].iov_base) { result = GlobusXIOErrorMemory("buffer->iovec[0]->iov_base"); goto error_iov_base; } buffer->iovec[0].iov_len = handle->attr->buf_size; result = globus_xio_driver_operation_create( &buffer->op, handle->driver_handle); if (result != GLOBUS_SUCCESS) { goto error_operation_create; } buffer->handle = handle; ++handle->buffer_count; globus_list_insert(&handle->driver_op_list, buffer->op); } result = globus_xio_driver_pass_read( buffer->op, (globus_xio_iovec_t *)buffer->iovec, 1, 1, globus_l_xio_ordering_read_cb, buffer); if (result != GLOBUS_SUCCESS) { goto error; } else { ++handle->outstanding_read_count; } GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; /* * If there is an error in pass_read, i destroy buffer irrespective of * whether I created the buffer now or not */ error: --handle->buffer_count; op_sub_list = globus_list_search(handle->driver_op_list, buffer->op); globus_list_remove(&handle->driver_op_list, op_sub_list); globus_xio_driver_operation_destroy(buffer->op); error_operation_create: globus_free(buffer->iovec[0].iov_base); error_iov_base: globus_free(buffer->iovec); error_iovec: globus_free(buffer); error_buffer: GlobusXIOOrderingDebugExitWithError(); return result; } static void globus_l_xio_ordering_open_cb( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_l_xio_ordering_handle_t * handle; globus_result_t res; GlobusXIOName(globus_l_xio_ordering_open_cb); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *)user_arg; if (result == GLOBUS_SUCCESS) { globus_mutex_lock(&handle->mutex); handle->state = GLOBUS_XIO_ORDERING_READY; globus_mutex_unlock(&handle->mutex); } else { goto error; } globus_xio_driver_finished_open(handle, op, GLOBUS_SUCCESS); GlobusXIOOrderingDebugExit(); return; error: res = globus_l_xio_ordering_handle_destroy(handle); globus_assert(res == GLOBUS_SUCCESS); handle = GLOBUS_NULL; globus_xio_driver_finished_open(handle, op, result); GlobusXIOOrderingDebugExitWithError(); return; } static globus_result_t globus_l_xio_ordering_open( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op) { globus_l_xio_ordering_handle_t * handle; globus_l_xio_ordering_attr_t * attr; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_ordering_open); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *) driver_link; attr = (globus_l_xio_ordering_attr_t *) driver_attr; globus_assert(handle == NULL); result = globus_l_xio_ordering_handle_create(&handle, attr); if (result != GLOBUS_SUCCESS) { goto error_handle_create; } handle->driver_handle = globus_xio_operation_get_driver_handle(op); globus_xio_driver_pass_open( op, contact_info, globus_l_xio_ordering_open_cb, handle); GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error_handle_create: GlobusXIOOrderingDebugExitWithError(); return result; } static void globus_l_xio_ordering_cancel_cb( globus_xio_operation_t op, void * user_arg, globus_xio_error_type_t reason) { globus_l_xio_ordering_handle_t * handle; globus_size_t nbytes; globus_bool_t finish_read = GLOBUS_FALSE; globus_bool_t finish_close = GLOBUS_FALSE; globus_result_t result; GlobusXIOName(globus_l_xio_ordering_cancel_cb); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *) user_arg; /* * I did some changes to globus_xio_handle.c and globus_xio_server.c to * allow finish to be called from cancel_cb. I put 'my_op->in_register = * GLOBUS_TRUE' before every occurence of 'op->cancel_cb()' and * 'my_op->in_register = GLOBUS_FALSE after 'op->cancel_cb()' where my_op * is the 'op->op_entry[op->ndx-1]' */ globus_mutex_lock(&handle->mutex); switch (handle->state) { case GLOBUS_XIO_ORDERING_IO_PENDING: if (handle->read_count == 1) { nbytes = handle->user_req->nbytes; finish_read = GLOBUS_TRUE; --handle->read_count; if (handle->write_count == 0) { handle->state = GLOBUS_XIO_ORDERING_READY; } } break; /* * If the handle's state is READY or CLOSING. it implies that * finished_read/finished_close is going to be called soon. so i can * ignore the cancel. */ case GLOBUS_XIO_ORDERING_READY: case GLOBUS_XIO_ORDERING_CLOSING: break; case GLOBUS_XIO_ORDERING_CLOSE_PENDING: finish_close = GLOBUS_TRUE; handle->state = GLOBUS_XIO_ORDERING_READY; break; case GLOBUS_XIO_ORDERING_ERROR: goto error; default: result = GlobusXIOOrderingErrorCancel( "Invalid state in cancel_cb"); globus_i_xio_ordering_save_error(handle, result); goto error; } globus_mutex_unlock(&handle->mutex); if (finish_read) { globus_xio_driver_finished_read(op, GlobusXIOErrorCanceled(), nbytes); } else if (finish_close) { globus_xio_driver_finished_close(op, GlobusXIOErrorCanceled()); } GlobusXIOOrderingDebugExit(); return; error: globus_mutex_unlock(&handle->mutex); GlobusXIOOrderingDebugExitWithError(); return; } /* called locked */ static void globus_l_xio_ordering_buffer_destroy( globus_l_xio_ordering_handle_t * handle, globus_l_xio_ordering_buffer_t * buffer) { globus_list_t * op_sub_list = GLOBUS_NULL; GlobusXIOName(globus_l_xio_ordering_buffer_destroy); GlobusXIOOrderingDebugEnter(); /* * I do this checking here becoz if user calls close and there are some * reads pending with driver created op, those ops will be available in * handle->driver_op_list. I remove those ops from the driver_op_list * in the close interface and call cancel on those ops. Once they are * canceled, i'll get read_cb and I call buffer_destroy (this function) * in read_cb. I do remove only if i'm sure the element is present. */ if (handle->driver_op_list) { op_sub_list = globus_list_search(handle->driver_op_list, buffer->op); } if (op_sub_list) { globus_list_remove(&handle->driver_op_list, op_sub_list); } globus_xio_driver_operation_destroy(buffer->op); globus_free(buffer->iovec[0].iov_base); globus_free(buffer->iovec); globus_free(buffer); GlobusXIOOrderingDebugExit(); } /* called locked */ static globus_bool_t globus_l_xio_ordering_copy( globus_l_xio_ordering_handle_t * handle) { globus_l_xio_ordering_buffer_t * buffer; globus_l_xio_ordering_user_req_t * user_req; globus_xio_iovec_t * iovec; globus_size_t len; globus_size_t total_len; globus_size_t nbytes_left; globus_bool_t finish = GLOBUS_FALSE; globus_bool_t done; GlobusXIOName(globus_l_xio_ordering_copy); GlobusXIOOrderingDebugEnter(); user_req = handle->user_req; iovec = user_req->iovec; do { total_len = 0; buffer = (globus_l_xio_ordering_buffer_t *) globus_priority_q_dequeue(&handle->buffer_q); if (buffer->error) { if (!user_req->error) { user_req->error = buffer->error; } else { globus_error_put(buffer->error); } } nbytes_left = buffer->nbytes - buffer->offset; while (nbytes_left > 0 && user_req->nbytes < user_req->length) { GlobusXIOOrderingMin( len, iovec[user_req->index].iov_len - user_req->offset, buffer->nbytes - buffer->offset); memcpy( (globus_byte_t *) iovec[user_req->index].iov_base + user_req->offset, (globus_byte_t *) buffer->iovec[0].iov_base + buffer->offset, len); if (user_req->offset + len == iovec[user_req->index].iov_len) { ++user_req->index; user_req->offset = 0; } else { user_req->offset += len; } user_req->nbytes += len; nbytes_left -= len; buffer->offset += len; total_len += len; } handle->expected_offset += total_len; done = GLOBUS_TRUE; if (nbytes_left == 0) { globus_xio_driver_pass_read( buffer->op, (globus_xio_iovec_t *)buffer->iovec, 1, 1, globus_l_xio_ordering_read_cb, buffer); ++handle->outstanding_read_count; /* * This if block is not put outside of the above if block coz * if nbytes_left != 0, then user_req->nbytes will surely be * >= user_req->length (otherwise while loop would not have ended) * and the condition would fail. To avoids unnecessary checking of * that condition, this is placed here. */ if (user_req->nbytes < user_req->length && !globus_priority_q_empty(&handle->buffer_q)) { globus_off_t * offset; offset = (globus_off_t *) globus_priority_q_first_priority(&handle->buffer_q); if (*offset == handle->expected_offset) { done = GLOBUS_FALSE; } } } else { buffer->data_offset += total_len; globus_priority_q_enqueue( &handle->buffer_q, buffer, &buffer->data_offset); } } while (!done); if (user_req->nbytes >= user_req->wait_for) { finish = GLOBUS_TRUE; } GlobusXIOOrderingDebugExit(); return finish; } static void globus_l_xio_ordering_read_cb( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_result_t res; globus_l_xio_ordering_handle_t * handle; globus_l_xio_ordering_buffer_t * buffer; globus_off_t offset; globus_off_t expected_offset; globus_xio_operation_t requestor_op; globus_result_t requestor_result; globus_size_t requestor_nbytes; globus_bool_t finish = GLOBUS_FALSE; globus_bool_t finish_close = GLOBUS_FALSE; globus_bool_t eof = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_ordering_read_cb); GlobusXIOOrderingDebugEnter(); buffer = (globus_l_xio_ordering_buffer_t *) user_arg; handle = buffer->handle; globus_mutex_lock(&handle->mutex); --handle->outstanding_read_count; if (globus_error_match(globus_error_peek(result), GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_EOF)) { eof = GLOBUS_TRUE; } switch (handle->state) { case GLOBUS_XIO_ORDERING_READY: case GLOBUS_XIO_ORDERING_IO_PENDING: if ((result == GLOBUS_SUCCESS) || (eof && (nbytes > 0))) { /* * This driver can be used in 2 modes; ordering (care about * offsets) and buffering (do not care about offsets). In * buffering mode, buffer->data_offset (which is used as the * priority in the priority q) is set to handle->offset and * handle->offset is incremented by nbytes. the new * handle->offset becomes the priority for the next chunk of * data. The increment value does not really matter. I could * have just used a value of 1 (the reason for choosing nbytes * is purely arbitrary). In buffering mode, the priority * is just the order of arrival */ if (handle->attr->buffering) { /* * this assignment below is to make sure that copy is * called whenever there is a user_op pending. see the * condition used to check before copy is called below */ offset = handle->expected_offset; buffer->data_offset = handle->offset; handle->offset += nbytes; } else { res = globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_GET_OFFSET, &offset); if (res != GLOBUS_SUCCESS) { globus_i_xio_ordering_save_error(handle, res); goto error; } buffer->data_offset = offset; } /* * buffer->offset is used to offset into the buffer. It * specifies the offset from the start of the buffer upto * which the data has been copied to the user buffer */ buffer->offset = 0; buffer->nbytes = nbytes; buffer->error = globus_error_get(result); globus_priority_q_enqueue( &handle->buffer_q, buffer, &buffer->data_offset); expected_offset = handle->expected_offset; /* * I register a new read if outstanding_read_count < * max_read_count or offset != handle->expected_offset. If * the condition on the 'if loop' succeeds, then copy() might * modify handle->expected_offset. thats why i store it above */ if (handle->read_count == 1 && offset == expected_offset) { finish = globus_l_xio_ordering_copy(handle); if (eof || finish) { --handle->read_count; if (eof) { handle->state = GLOBUS_XIO_ORDERING_EOF_RECEIVED; } else if (handle->write_count == 0) { handle->state = GLOBUS_XIO_ORDERING_READY; } requestor_op = handle->user_req->op; requestor_result = globus_error_put( handle->user_req->error); requestor_nbytes = handle->user_req->nbytes; } } if (handle->outstanding_read_count < handle->attr->max_read_count) { res = globus_i_xio_ordering_register_read( handle, GLOBUS_NULL); if (res != GLOBUS_SUCCESS) { globus_i_xio_ordering_save_error(handle, res); /* * I do not have a goto error; here coz under error * label, i finish read with error but there may not * any error in the read that finished */ } } } else if (eof) { handle->state = GLOBUS_XIO_ORDERING_EOF_RECEIVED; if (handle->read_count > 0 && globus_priority_q_empty(&handle->buffer_q)) { requestor_op = handle->user_req->op; requestor_result = result; requestor_nbytes = handle->user_req->nbytes; finish = GLOBUS_TRUE; } } else if(globus_error_match( globus_error_peek(result), GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_CANCELED)) { /* * While the handle is in READY state, SET_OFFSET handle cntl * alone can cancel the driver_ops. In that case, all the * buffered data is discarded and I have to initiate new reads * and I make use of the existing buffers */ res = globus_i_xio_ordering_register_read(handle, buffer); if (res != GLOBUS_SUCCESS) { globus_i_xio_ordering_save_error(handle, res); /* * Here I do not have a goto error; coz this error does * not correspond to the finished read */ } } else { globus_i_xio_ordering_save_error(handle, result); goto error; } globus_mutex_unlock(&handle->mutex); break; case GLOBUS_XIO_ORDERING_CLOSE_PENDING: globus_l_xio_ordering_buffer_destroy(handle, buffer); if (handle->outstanding_read_count == 0) { handle->state = GLOBUS_XIO_ORDERING_CLOSING; globus_mutex_unlock(&handle->mutex); globus_xio_operation_disable_cancel(handle->close_op); /* * If cancel has been called in between unlock and disable * pass_close will fail. */ res = globus_xio_driver_pass_close( handle->close_op, globus_l_xio_ordering_close_cb, handle); if (res != GLOBUS_SUCCESS) { finish_close = GLOBUS_TRUE; } } else { globus_mutex_unlock(&handle->mutex); } break; case GLOBUS_XIO_ORDERING_EOF_RECEIVED: case GLOBUS_XIO_ORDERING_EOF_DELIVERED: globus_mutex_unlock(&handle->mutex); break; case GLOBUS_XIO_ORDERING_ERROR: goto error; default: res = GlobusXIOOrderingErrorRead("Invalid state in read cb"); globus_i_xio_ordering_save_error(handle, res); goto error; } if (finish) { /* * If finish is TRUE, I change state to READY (see above) so that I * dont do anything in the cancel_cb (in case if the op is cancelled * before I call disable_cancel) */ globus_xio_operation_disable_cancel(requestor_op); globus_xio_driver_finished_read( requestor_op, requestor_result, requestor_nbytes); } if (finish_close) { /* no contention for handle->close_op so I use it without lock */ globus_xio_driver_finished_close(handle->close_op, res); } GlobusXIOOrderingDebugExit(); return; error: globus_l_xio_ordering_buffer_destroy(handle, buffer); if (handle->read_count == 1) { --handle->read_count; finish = GLOBUS_TRUE; res = globus_error_put(globus_object_copy(handle->error)); } globus_mutex_unlock(&handle->mutex); /* * I access the handle->user_req etc after unlock coz there is no * contention for them after i set state to ERROR */ if (finish) { globus_xio_operation_disable_cancel(handle->user_req->op); globus_xio_driver_finished_read( handle->user_req->op, res, handle->user_req->nbytes); } GlobusXIOOrderingDebugExitWithError(); return; } static void globus_i_xio_ordering_user_req_init( globus_l_xio_ordering_user_req_t * user_req, globus_xio_operation_t op, const globus_xio_iovec_t * iovec, int iovec_count) { GlobusXIOName(globus_l_xio_ordering_read); GlobusXIOOrderingDebugEnter(); user_req->op = op; user_req->iovec = (globus_xio_iovec_t *)iovec; user_req->iovec_count = iovec_count; GlobusXIOUtilIovTotalLength(user_req->length, iovec, iovec_count); user_req->index = 0; user_req->offset = 0; user_req->nbytes = 0; user_req->wait_for = globus_xio_operation_get_wait_for(op); GlobusXIOOrderingDebugExit(); } static globus_result_t globus_l_xio_ordering_read( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_xio_ordering_handle_t * handle; globus_bool_t finish = GLOBUS_FALSE; globus_result_t result; globus_result_t res; globus_size_t nbytes = 0; globus_off_t * offset; GlobusXIOName(globus_l_xio_ordering_read); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *) driver_specific_handle; globus_mutex_lock(&handle->mutex); switch (handle->state) { case GLOBUS_XIO_ORDERING_EOF_RECEIVED: if (!globus_priority_q_empty(&handle->buffer_q)) { globus_i_xio_ordering_user_req_init( handle->user_req, op, iovec, iovec_count); offset = (globus_off_t *) globus_priority_q_first_priority(&handle->buffer_q); if (*offset == handle->expected_offset) { finish = globus_l_xio_ordering_copy(handle); } nbytes = handle->user_req->nbytes; if (finish) { res = globus_error_put(handle->user_req->error); } else { result = GlobusXIOOrderingErrorRead( "EOF already received but requested data not in buffer"); goto error; } break; } else { handle->state = GLOBUS_XIO_ORDERING_EOF_DELIVERED; /* fall through */ } /* * The framework should allow any further reads after an eof is * delivered but just in case */ case GLOBUS_XIO_ORDERING_EOF_DELIVERED: res = GlobusXIOErrorEOF(); finish = GLOBUS_TRUE; break; case GLOBUS_XIO_ORDERING_IO_PENDING: /* * IO_PENDING implies that either a read or write is pending. * Cant have multiple simultaneous reads but a simultaneous read * and write is allowed. */ if (handle->read_count == 1) { result = GlobusXIOOrderingErrorRead( "Ordering driver does not allow multiple simultaneous reads"); goto error; } /* fall through */ case GLOBUS_XIO_ORDERING_READY: globus_i_xio_ordering_user_req_init( handle->user_req, op, iovec, iovec_count); if (!globus_priority_q_empty(&handle->buffer_q)) { offset = (globus_off_t *) globus_priority_q_first_priority(&handle->buffer_q); if (*offset == handle->expected_offset) { finish = globus_l_xio_ordering_copy(handle); } } else if (!handle->driver_op_list) /* first read after open */ { int i; for (i = 0; i < handle->attr->max_read_count; i++) { result = globus_i_xio_ordering_register_read( handle, GLOBUS_NULL); if (result != GLOBUS_SUCCESS) { goto error; } } } if (finish) { nbytes = handle->user_req->nbytes; res = globus_error_put(handle->user_req->error); } else { handle->state = GLOBUS_XIO_ORDERING_IO_PENDING; ++handle->read_count; } break; case GLOBUS_XIO_ORDERING_ERROR: result = globus_error_put(globus_object_copy(handle->error)); goto error; default: result = GlobusXIOErrorInvalidState(handle->state); goto error; } globus_mutex_unlock(&handle->mutex); if (finish) { globus_xio_driver_finished_read(op, res, nbytes); } else if (globus_xio_operation_enable_cancel( op, globus_l_xio_ordering_cancel_cb, handle)) { globus_mutex_lock(&handle->mutex); --handle->read_count; if (handle->write_count == 0) { handle->state = GLOBUS_XIO_ORDERING_READY; } result = GlobusXIOErrorCanceled(); /* unlock happens at error label */ goto error; } GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error: globus_mutex_unlock(&handle->mutex); GlobusXIOOrderingDebugExitWithError(); return result; } static void globus_l_xio_ordering_write_cb( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg) { globus_l_xio_ordering_handle_t * handle; GlobusXIOName(globus_l_xio_ordering_write_cb); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *) user_arg; globus_mutex_lock(&handle->mutex); --handle->write_count; if (handle->write_count == 0 && handle->read_count == 0) { /* * The state could also be EOF_RECEIVED/EOF_DELIVERED. In that * case, the state should not be changed to READY because once * EOF is received, no further reads are allowed. The state machine * can be better but for some reason the initial version of this driver * did not handle EOF and the EOF states were added later and thus had * to do it this way. */ if (handle->state == GLOBUS_XIO_ORDERING_IO_PENDING) { handle->state = GLOBUS_XIO_ORDERING_READY; } } globus_mutex_unlock(&handle->mutex); globus_xio_driver_finished_write(op, result, nbytes); GlobusXIOOrderingDebugExit(); return; } static globus_result_t globus_l_xio_ordering_write( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op) { globus_l_xio_ordering_handle_t * handle; globus_size_t length; globus_result_t result; GlobusXIOName(globus_l_xio_ordering_write); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *) driver_specific_handle; /* * I dont have to do anything special in cancel_cb if the user cancels a * write operation. So I dont do any enable cancel here. As I just pass * the user op to the driver below, I assume xio_cancel will invoke * cancel on driver below and I'll eventually get the write_cb */ globus_mutex_lock(&handle->mutex); switch (handle->state) { /* * I allow multiple outstanding writes from the user. Otherwise user * of this ordering driver will not be able to take advantage of the * mode_e or gridftp driver below (basically use parallel writes on * multiple sockets. Also the order in which the write_cb goes to the * user does not matter (unlike the read_cb's). I use read_count and * write_count to track the number of pending reads and writes. * read_count can be either 0 or 1 as i dont allow multiple pending * reads. */ case GLOBUS_XIO_ORDERING_READY: handle->state = GLOBUS_XIO_ORDERING_IO_PENDING; /* fall through */ /* * The state machine * can be better but for some reason the initial version of this * driver did not handle EOF and the EOF states were added later * and thus had to do it this way. */ case GLOBUS_XIO_ORDERING_EOF_RECEIVED: /* fall through */ case GLOBUS_XIO_ORDERING_EOF_DELIVERED: /* fall through */ case GLOBUS_XIO_ORDERING_IO_PENDING: /* ??? this may be right. not sure if this will work for indicating the offset to the driver below ??? */ ++handle->write_count; result = globus_xio_driver_data_descriptor_cntl( op, NULL, GLOBUS_XIO_DD_SET_OFFSET, handle->offset); if (result != GLOBUS_SUCCESS) { goto error; } GlobusXIOUtilIovTotalLength(length, iovec, iovec_count); result = globus_xio_driver_pass_write( op, (globus_xio_iovec_t *)iovec, iovec_count, length, globus_l_xio_ordering_write_cb, handle); if (result != GLOBUS_SUCCESS) { goto error; } handle->offset += length; break; case GLOBUS_XIO_ORDERING_ERROR: result = globus_error_put(globus_object_copy(handle->error)); goto error; default: result = GlobusXIOErrorInvalidState(handle->state); goto error; } globus_mutex_unlock(&handle->mutex); GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error: globus_mutex_unlock(&handle->mutex); GlobusXIOOrderingDebugExitWithError(); return result; } static void globus_l_xio_ordering_close_cb( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_l_xio_ordering_handle_t * handle; globus_result_t res; GlobusXIOName(globus_l_xio_ordering_close_cb); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *)user_arg; /* * The following lock and unlock is avoid the following race: * ordering_close obtains lock and calls pass_close, before the * pass_close returns and lock is released this close_cb gets called * and handle_destroyed */ globus_mutex_lock(&handle->mutex); globus_mutex_unlock(&handle->mutex); res = globus_l_xio_ordering_handle_destroy(handle); globus_assert(res == GLOBUS_SUCCESS); globus_xio_driver_finished_close(op, result); GlobusXIOOrderingDebugExit(); } static globus_result_t globus_l_xio_ordering_close( void * driver_specific_handle, void * driver_attr, globus_xio_operation_t op) { globus_l_xio_ordering_handle_t * handle; globus_xio_operation_t driver_op = GLOBUS_NULL; globus_result_t result; GlobusXIOName(globus_l_xio_ordering_close); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *) driver_specific_handle; /* * This close interface will be invoked only when no other user op is * pending */ GlobusXIOOrderingDebugPrintf(GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, ("before got lock\n")); globus_mutex_lock(&handle->mutex); GlobusXIOOrderingDebugPrintf(GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, ("got lock\n")); if (!globus_priority_q_empty(&handle->buffer_q)) { globus_l_xio_ordering_buffer_t* buffer; GlobusXIOOrderingDebugPrintf(GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, ("priority queue not empty\n")); do { buffer = globus_priority_q_dequeue(&handle->buffer_q); globus_l_xio_ordering_buffer_destroy(handle, buffer); } while (!globus_priority_q_empty(&handle->buffer_q)); } GlobusXIOOrderingDebugPrintf(GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, ("outside if\n")); /* * outstanding ops wont be present in buffer_q but will be in * driver_op_list */ if (!globus_list_empty(handle->driver_op_list) && (handle->outstanding_read_count > 0)) { GlobusXIOOrderingDebugPrintf(GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, ("driver op not empty and outstanding read count > 0\n")); /* * Cancel will be called on all ops irrespective of whether it is * outstanding or in possession of this driver. This is because there * is only one driver_op_list (if there is another list that has all * the outstanding ops, it can be optimized). The check for outstanding * reads in the if loop above ensures that atleast there is one * outstanding read. So that the cancel below will get the control to * read_cb */ handle->state = GLOBUS_XIO_ORDERING_CLOSE_PENDING; do { driver_op = (globus_xio_operation_t) globus_list_remove( &handle->driver_op_list, handle->driver_op_list); result = globus_xio_driver_operation_cancel( handle->driver_handle, driver_op); if (result != GLOBUS_SUCCESS) { goto error; } } while (!globus_list_empty(handle->driver_op_list)); handle->close_op = op; } else { GlobusXIOOrderingDebugPrintf(GLOBUS_L_XIO_ORDERING_DEBUG_TRACE, ("driver op empty or outstanding read count > 0")); handle->state = GLOBUS_XIO_ORDERING_CLOSING; result = globus_xio_driver_pass_close( op, globus_l_xio_ordering_close_cb, handle); if (result != GLOBUS_SUCCESS) { goto error; } } globus_mutex_unlock(&handle->mutex); /* * user is allowed to cancel a close only if there are any driver_ops * outstanding. driver_op != NULL implies there are outstanding op(s) */ if (driver_op) { if (globus_xio_operation_enable_cancel( op, globus_l_xio_ordering_cancel_cb, handle)) { globus_mutex_lock(&handle->mutex); handle->state = GLOBUS_XIO_ORDERING_READY; result = GlobusXIOErrorCanceled(); /* unlock happens at error label */ goto error; } } GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error: globus_i_xio_ordering_save_error(handle, result); globus_mutex_unlock(&handle->mutex); GlobusXIOOrderingDebugExitWithError(); return result; } static globus_result_t globus_l_xio_ordering_cntl( void * driver_specific_handle, int cmd, va_list ap) { globus_l_xio_ordering_handle_t * handle; globus_result_t result; GlobusXIOName(globus_l_xio_ordering_cntl); GlobusXIOOrderingDebugEnter(); handle = (globus_l_xio_ordering_handle_t *) driver_specific_handle; globus_mutex_lock(&handle->mutex); switch(cmd) { case GLOBUS_XIO_SEEK: case GLOBUS_XIO_ORDERING_SET_OFFSET: { if (handle->state == GLOBUS_XIO_ORDERING_READY) { globus_off_t offset; globus_xio_operation_t op; offset = va_arg(ap, globus_off_t); handle->offset = offset; if (!globus_list_empty(handle->driver_op_list)) { /* * it is harmless to cancel the idle op (cancel doesnt * do anything if the op is considered in your * possession), so i cancel all the driver ops here */ do { op = (globus_xio_operation_t) globus_list_remove( &handle->driver_op_list, handle->driver_op_list); result = globus_xio_driver_operation_cancel( handle->driver_handle, op); if (result != GLOBUS_SUCCESS) { globus_i_xio_ordering_save_error(handle, result); goto error; } } while (!globus_list_empty(handle->driver_op_list)); } if (!globus_priority_q_empty(&handle->buffer_q)) { globus_l_xio_ordering_buffer_t * buffer; /* * discard all the buffered data and invoke new reads on * buffered ops */ do { buffer = globus_priority_q_dequeue(&handle->buffer_q); result = globus_i_xio_ordering_register_read( handle, buffer); if (result != GLOBUS_SUCCESS) { globus_i_xio_ordering_save_error(handle, result); goto error; } } while (!globus_priority_q_empty(&handle->buffer_q)); } } else if (handle->state == GLOBUS_XIO_ORDERING_EOF_RECEIVED || handle->state == GLOBUS_XIO_ORDERING_EOF_DELIVERED) { /* * In this case, there can not be any outstanding reads, so * no need to worry about this like in the above if */ globus_off_t offset; offset = va_arg(ap, globus_off_t); handle->offset = offset; } else { result = GlobusXIOErrorInvalidState(handle->state); goto error; } break; } default: result = GlobusXIOErrorInvalidCommand(cmd); goto error; } globus_mutex_unlock(&handle->mutex); GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error: globus_mutex_unlock(&handle->mutex); GlobusXIOOrderingDebugExitWithError(); return result; } static globus_result_t globus_l_xio_ordering_attr_init( void ** out_attr) { globus_l_xio_ordering_attr_t * attr; globus_result_t result; GlobusXIOName(globus_l_xio_ordering_attr_init); GlobusXIOOrderingDebugEnter(); /* * create a ordering attr structure and intialize its values */ attr = (globus_l_xio_ordering_attr_t *) globus_malloc(sizeof(globus_l_xio_ordering_attr_t)); if(!attr) { result = GlobusXIOErrorMemory("attr"); goto error_attr; } memcpy(attr, &globus_l_xio_ordering_attr_default, sizeof(globus_l_xio_ordering_attr_t)); *out_attr = attr; GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error_attr: GlobusXIOOrderingDebugExitWithError(); return result; } static globus_result_t globus_l_xio_ordering_attr_cntl( void * driver_attr, int cmd, va_list ap) { globus_result_t result; globus_l_xio_ordering_attr_t * attr; GlobusXIOName(globus_l_xio_ordering_attr_cntl); GlobusXIOOrderingDebugEnter(); attr = (globus_l_xio_ordering_attr_t *) driver_attr; switch(cmd) { case GLOBUS_XIO_ORDERING_SET_MAX_READ_COUNT: attr->max_read_count = va_arg(ap, int); break; case GLOBUS_XIO_ORDERING_GET_MAX_READ_COUNT: { int * max_read_count_out = va_arg(ap, int *); *max_read_count_out = attr->max_read_count; break; } case GLOBUS_XIO_ORDERING_SET_BUFFERING: attr->buffering = va_arg(ap, globus_bool_t); break; case GLOBUS_XIO_ORDERING_GET_BUFFERING: { globus_bool_t * buffering_out = va_arg(ap, globus_bool_t *); *buffering_out = attr->buffering; break; } case GLOBUS_XIO_ORDERING_SET_BUF_SIZE: attr->buf_size = va_arg(ap, globus_size_t); break; case GLOBUS_XIO_ORDERING_GET_BUF_SIZE: { globus_size_t * buf_size_out = va_arg(ap, globus_size_t *); *buf_size_out = attr->buf_size; break; } case GLOBUS_XIO_ORDERING_SET_MAX_BUF_COUNT: attr->max_buf_count = va_arg(ap, int); break; case GLOBUS_XIO_ORDERING_GET_MAX_BUF_COUNT: { int * out_max_buf_count; out_max_buf_count = va_arg(ap, int *); *out_max_buf_count = attr->max_buf_count; break; } default: result = GlobusXIOErrorInvalidCommand(cmd); goto error; } GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error: GlobusXIOOrderingDebugExitWithError(); return result; } static globus_result_t globus_l_xio_ordering_attr_copy( void ** dst, void * src) { globus_l_xio_ordering_attr_t * src_attr; globus_l_xio_ordering_attr_t * dst_attr; globus_result_t result; GlobusXIOName(globus_l_xio_ordering_attr_copy); GlobusXIOOrderingDebugEnter(); dst_attr = (globus_l_xio_ordering_attr_t *) globus_malloc(sizeof(globus_l_xio_ordering_attr_t)); if(!dst_attr) { result = GlobusXIOErrorMemory("attr"); goto error_dst_attr; } src_attr = (globus_l_xio_ordering_attr_t *) src; memcpy(dst_attr, src_attr, sizeof(globus_l_xio_ordering_attr_t)); *dst = dst_attr; GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error_dst_attr: GlobusXIOOrderingDebugExitWithError(); return result; } static globus_result_t globus_l_xio_ordering_attr_destroy( void * driver_attr) { globus_l_xio_ordering_attr_t * attr; GlobusXIOName(globus_l_xio_ordering_attr_destroy); GlobusXIOOrderingDebugEnter(); attr = (globus_l_xio_ordering_attr_t *) driver_attr; globus_free(attr); GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; } static globus_result_t globus_l_xio_ordering_init( globus_xio_driver_t * out_driver) { globus_xio_driver_t driver; globus_result_t result; GlobusXIOName(globus_l_xio_ordering_init); GlobusXIOOrderingDebugEnter(); result = globus_xio_driver_init(&driver, "ordering", GLOBUS_NULL); if(result != GLOBUS_SUCCESS) { result = GlobusXIOErrorWrapFailed( "globus_l_xio_driver_init", result); goto error_init; } globus_xio_driver_set_transform( driver, globus_l_xio_ordering_open, globus_l_xio_ordering_close, globus_l_xio_ordering_read, globus_l_xio_ordering_write, globus_l_xio_ordering_cntl, GLOBUS_NULL); globus_xio_driver_set_attr( driver, globus_l_xio_ordering_attr_init, globus_l_xio_ordering_attr_copy, globus_l_xio_ordering_attr_cntl, globus_l_xio_ordering_attr_destroy); *out_driver = driver; GlobusXIOOrderingDebugExit(); return GLOBUS_SUCCESS; error_init: GlobusXIOOrderingDebugExitWithError(); return result; } static void globus_l_xio_ordering_destroy( globus_xio_driver_t driver) { globus_xio_driver_destroy(driver); } GlobusXIODefineDriver( ordering, globus_l_xio_ordering_init, globus_l_xio_ordering_destroy); globus_xio-3.6/builtins/Makefile.in0000664000076400007640000004223112225614604014371 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = builtins ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies SUBDIRS = \ $(XIO_BUILTIN_DIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builtins/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign builtins/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive : unlink: unlink-recursive : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-am filelist: filelist-recursive : link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/GLOBUS_LICENSE0000666000076400007640000002367611522621705012570 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS globus_xio-3.6/globus_xio_util.h0000666000076400007640000007744110766024167014077 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBUS_XIO_UTIL_INCLUDE #define GLOBUS_XIO_UTIL_INCLUDE #include "globus_xio.h" EXTERN_C_BEGIN globus_bool_t globus_xio_get_env_pair( const char * env_name, int * min, int * max); globus_bool_t globus_xio_error_is_eof( globus_result_t res); globus_bool_t globus_xio_error_is_canceled( globus_result_t res); globus_bool_t globus_xio_driver_error_match( globus_xio_driver_t driver, globus_object_t * error, int type); globus_bool_t globus_xio_driver_error_match_with_cb( globus_xio_driver_t driver, globus_object_t * error, globus_extension_error_match_cb_t callback, void * type); globus_bool_t globus_xio_error_match( globus_result_t result, int type); void globus_xio_contact_destroy( globus_xio_contact_t * contact_info); globus_result_t globus_xio_contact_parse( globus_xio_contact_t * contact_info, const char * contact_string); globus_result_t globus_xio_contact_info_to_string( const globus_xio_contact_t * contact_info, char ** contact_string); globus_result_t globus_xio_contact_info_to_url( const globus_xio_contact_t * contact_info, char ** contact_string); globus_result_t globus_xio_contact_info_to_encoded_string( const globus_xio_contact_t * contact_info, const globus_xio_contact_t * encode_chars, char ** contact_string); globus_result_t globus_xio_contact_copy( globus_xio_contact_t * dst, const globus_xio_contact_t * src); /** * Utility macros */ /* all macros in this file require each function to 'declare' their name with * this */ #ifdef __GNUC__ #define GlobusXIOName(func) static const char * _xio_name __attribute__((__unused__)) = #func #else #define GlobusXIOName(func) static const char * _xio_name = #func #endif #define GlobusXIOErrorCanceled() \ globus_error_put(GlobusXIOErrorObjCanceled()) #define GlobusXIOErrorObjCanceled() \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_CANCELED, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Operation was canceled")) #define GlobusXIOErrorTimeout() \ globus_error_put(GlobusXIOErrorObjTimeout()) #define GlobusXIOErrorObjTimeout() \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GlobusXIOErrorObjTimeoutOnly(), \ GLOBUS_XIO_ERROR_CANCELED, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Operation was canceled")) #define GlobusXIOErrorObjTimeoutOnly() \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_TIMEOUT, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Operation timed out")) #define GlobusXIOErrorObjEOF() \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_EOF, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("An end of file occurred")) #define GlobusXIOErrorEOF() \ globus_error_put( \ GlobusXIOErrorObjEOF()) \ #define GlobusXIOErrorInvalidCommand(cmd_number) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_COMMAND, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("An invalid command (%d) was issued"), \ (cmd_number))) #define GlobusXIOErrorContactString(reason) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_CONTACT_STRING, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Contact string invalid. %s"), \ (reason))) #define GlobusXIOErrorObjParameter(param_name) \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_PARAMETER, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Bad parameter, %s"), \ (param_name)) #define GlobusXIOErrorParameter(param_name) \ globus_error_put( \ GlobusXIOErrorObjParameter(param_name)) #define GlobusXIOErrorObjMemory(mem_name) \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_MEMORY, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Memory allocation failed on %s"), \ (mem_name)) #define GlobusXIOErrorMemory(mem_name_obj) \ globus_error_put( \ GlobusXIOErrorObjMemory(mem_name_obj)) #define GlobusXIOErrorObjSystemError(system_func, _errno) \ globus_error_wrap_errno_error( \ GLOBUS_XIO_MODULE, \ (_errno), \ GLOBUS_XIO_ERROR_SYSTEM_ERROR, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("System error in %s"), \ (system_func)) #define GlobusXIOErrorSystemError(system_func, _errno) \ globus_error_put( \ GlobusXIOErrorObjSystemError(system_func, _errno)) #define GlobusXIOErrorSystemResource(reason) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_SYSTEM_RESOURCE, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("System resource error, %s"), \ (reason))) #define GlobusXIOErrorInvalidStack(reason) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_STACK, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Invalid stack, %s"), \ (reason))) #define GlobusXIOErrorInvalidDriver(reason) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_DRIVER, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Invalid Driver, %s"), \ (reason))) #define GlobusXIOErrorPass() \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_PASS, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Operation passed too far"))) #define GlobusXIOErrorAlreadyRegistered() \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_ALREADY_REGISTERED, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Operation already registered"))) #define GlobusXIOErrorInvalidState(state) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ GLOBUS_NULL, \ GLOBUS_XIO_ERROR_STATE, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Unexpected state, %d"), \ (state))) #define GlobusXIOErrorWrapFailed(failed_func, result) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ globus_error_get((result)), \ GLOBUS_XIO_ERROR_WRAPPED, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("%s failed."), \ (failed_func))) #define GlobusXIOErrorWrapFailedWithMessage(result, format, arg) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ globus_error_get((result)), \ GLOBUS_XIO_ERROR_WRAPPED, \ __FILE__, \ _xio_name, \ __LINE__, \ (format), \ (arg))) #define GlobusXIOErrorWrapFailedWithMessage2(result, format, arg1, arg2) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ globus_error_get((result)), \ GLOBUS_XIO_ERROR_WRAPPED, \ __FILE__, \ _xio_name, \ __LINE__, \ (format), \ (arg1), (arg2))) #define GlobusXIOErrorNotRegistered() \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ NULL, \ GLOBUS_XIO_ERROR_NOT_REGISTERED, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Not registered."))) #define GlobusXIOErrorNotActivated() \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ NULL, \ GLOBUS_XIO_ERROR_NOT_ACTIVATED, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Module not activated."))) #define GlobusXIOErrorUnloaded() \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ NULL, \ GLOBUS_XIO_ERROR_UNLOADED, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("Driver in handle has been unloaded."))) #define GlobusXIOErrorParse(arg) \ globus_error_put( \ globus_error_construct_error( \ GLOBUS_XIO_MODULE, \ NULL, \ GLOBUS_XIO_ERROR_PARSE, \ __FILE__, \ _xio_name, \ __LINE__, \ _XIOSL("An error occured parsing the string: %s"), arg)) #define GlobusIXIOUtilCopyNIovec(iov, iovc, siov, siovc, bytes) \ do \ { \ globus_size_t _i; \ globus_size_t _tb = 0; \ globus_size_t _bytes; \ const struct iovec * _siov; \ struct iovec * _iov; \ int _iovc; \ int _siovc; \ \ _siov = (siov); \ _siovc = (siovc); \ _iov = (iov); \ _iovc = (iovc); \ _bytes = (bytes); \ \ for(_i = 0; _i < _siovc && _tb < _bytes; _i++) \ { \ if(_tb + _siov[_i].iov_len > _bytes) \ { \ _iov[_i].iov_len = _bytes - _tb; \ } \ else \ { \ _iov[_i].iov_len = _siov[_i].iov_len; \ } \ _tb += _siov[_i].iov_len; \ _iov[_i].iov_base = _siov[_i].iov_base; \ } \ _iovc = _i; \ } while(0) #define GlobusIXIOUtilTransferIovec(iov, siov, iovc) \ do \ { \ int _i; \ const struct iovec * _siov; \ struct iovec * _iov; \ int _iovc; \ \ _siov = (siov); \ _iov = (iov); \ _iovc = (iovc); \ \ for(_i = 0; _i < _iovc; _i++) \ { \ _iov[_i].iov_base = _siov[_i].iov_base; \ _iov[_i].iov_len = _siov[_i].iov_len; \ } \ } while(0) #define GlobusIXIOUtilAdjustIovec(iov, iovc, nbytes) \ do \ { \ globus_size_t _n = (nbytes); \ \ if(_n > 0) \ { \ struct iovec * _iov = (iov); \ int _iovc = (iovc); \ int _i; \ \ /* skip all completely filled iovecs */ \ for(_i = 0; \ _i < _iovc && _n >= _iov[_i].iov_len; \ _n -= _iov[_i].iov_len, _i++); \ \ if(_i < _iovc) \ { \ _iov[_i].iov_base = (char *) _iov[_i].iov_base + _n; \ _iov[_i].iov_len -= _n; \ (iov) += _i; \ } \ \ (iovc) -= _i; \ } \ } while(0) #define GlobusIXIOUtilTransferAdjustedIovec( \ new_iov, new_iovc, iov, iovc, nbytes) \ do \ { \ globus_size_t _n; \ const struct iovec * _iov; \ int _iovc; \ struct iovec * _new_iov; \ int _i; \ int _j; \ \ _iov = (iov); \ _iovc = (iovc); \ _new_iov = (new_iov); \ \ /* skip all completely filled iovecs */ \ for(_i = 0, _n = (nbytes); \ _i < _iovc && _n >= _iov[_i].iov_len; \ _n -= _iov[_i].iov_len, _i++); \ \ (new_iovc) = _iovc - _i; \ if(_i < _iovc) \ { \ _new_iov[0].iov_base = (char *) _iov[_i].iov_base + _n; \ _new_iov[0].iov_len = _iov[_i].iov_len - _n; \ \ /* copy remaining */ \ for(_j = 1, _i++; _i < _iovc; _j++, _i++) \ { \ _new_iov[_j].iov_base = _iov[_i].iov_base; \ _new_iov[_j].iov_len = _iov[_i].iov_len; \ } \ } \ } while(0) #define GlobusXIOUtilIovTotalLength( \ out_len, iov, iovc) \ do \ { \ int _i; \ const struct iovec * _iov; \ int _iovc; \ globus_size_t _out_len; \ _iov = (iov); \ _iovc = (iovc); \ _out_len = 0; \ for(_i = 0; _i < _iovc; _i++) \ { \ _out_len += _iov[_i].iov_len; \ } \ out_len = _out_len; \ } while(0) #define GlobusXIOUtilIovSerialize( \ out_buf, iov, iovc) \ do \ { \ int _i; \ int _ndx = 0; \ for(_i = 0; _i < iovc; _i++) \ { \ memcpy(&(out_buf)[_ndx], (iov)[_i].iov_base, (iov)[_i].iov_len);\ _ndx += (iov)[_i].iov_len; \ } \ } while(0) EXTERN_C_END #endif globus_xio-3.6/acconfig.h0000666000076400007640000000002407753147377012433 00000000000000#undef HAVE_SYSCONF globus_xio-3.6/globus_i_xio_win32.h0000666000076400007640000001204511522621705014351 00000000000000/* * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ #ifndef GLOBUS_I_XIO_WIN32_H_ #define GLOBUS_I_XIO_WIN32_H_ #include "globus_i_xio_system_common.h" #include #include #include typedef struct globus_l_xio_win32_event_entry_s * globus_i_xio_win32_event_entry_t; /** * this callback is called from within threads managed by this lib. * * you must synchronize access between this and globus interface calls * and you must not call into globus calls unless globus has been built * threaded. * * this callback is called while holding the * globus_i_xio_win32_event_lock() * * return false to unregister event handle, true to keep it * * (this callback will not be reentered for any given event object) */ typedef globus_bool_t (*globus_i_xio_win32_event_cb_t)( void * user_arg); globus_result_t globus_i_xio_win32_event_register( globus_i_xio_win32_event_entry_t * entry_handle, HANDLE event_handle, globus_i_xio_win32_event_cb_t callback, void * user_arg); /** * must be called after globus_i_xio_win32_event_lock() * Do NOT call within globus_i_xio_win32_event_cb_t callback */ void globus_i_xio_win32_event_unregister( globus_i_xio_win32_event_entry_t entry_handle); /** * this lock effectively prevents events from occurring on the specified * handle (and others, but not all) while it is held. This lock is also * held while calling event callbacks (so, don't call it within callbacks) */ void globus_i_xio_win32_event_lock( globus_i_xio_win32_event_entry_t entry_handle); void globus_i_xio_win32_event_unlock( globus_i_xio_win32_event_entry_t entry_handle); /** * must be called after globus_i_xio_win32_event_lock() * Do NOT call within globus_i_xio_win32_event_cb_t callback */ void globus_i_xio_win32_event_post( globus_i_xio_win32_event_entry_t entry_handle); int globus_i_xio_win32_complete_activate(void); int globus_i_xio_win32_complete_deactivate(void); int globus_i_xio_win32_file_activate(void); int globus_i_xio_win32_file_deactivate(void); /** * dispatch callback to globus threads */ globus_result_t globus_i_xio_win32_complete( globus_callback_func_t callback, void * user_arg); int globus_i_xio_win32_mode_activate(void); globus_bool_t globus_i_xio_win32_mode_is_overlapped( HANDLE handle); typedef CRITICAL_SECTION win32_mutex_t; #define win32_mutex_init(x, y) InitializeCriticalSection(x) #define win32_mutex_destroy(x) DeleteCriticalSection(x) #define win32_mutex_lock(x) EnterCriticalSection(x) #define win32_mutex_unlock(x) LeaveCriticalSection(x) #define GlobusXIOSystemDebugSysError(message, err) \ do \ { \ if(GlobusDebugTrue( \ GLOBUS_XIO_SYSTEM, GLOBUS_I_XIO_SYSTEM_DEBUG_INFO)) \ { \ char * msg = NULL; \ int err_ = err; \ \ FormatMessage( \ FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, \ NULL, \ err_, \ 0, \ (LPTSTR)&msg, \ 0, \ NULL); \ \ GlobusDebugMyPrintf( \ GLOBUS_XIO_SYSTEM, \ ("[%s] %s: %d:%s", _xio_name, message, err_, msg)); \ \ if(msg) \ { \ LocalFree(msg); \ } \ } \ } while(0) #endif globus_xio-3.6/doxygen/0000775000076400007640000000000012225614640012226 500000000000000globus_xio-3.6/doxygen/Doxyfile.in0000644000076400007640000001145512225575522014272 00000000000000# Doxyfile 1.2.6 # This file describes the settings to be used by doxygen for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") # # Include the standard part of the doxygen configuration: # @INCLUDE_PATH = @doxygendir@ @INCLUDE = Doxyfile.include # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "@lac_doxygen_project@" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @lac_doxygen_srcdirs@ \ @lac_doxygen_examples@ # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. FILE_PATTERNS = *.c \ *.h \ @lac_doxygen_file_patterns@ # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = @lac_doxygen_input_filter@ # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = @lac_doxygen_examples@ # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = @doxygendir@/globus_head.html # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = @doxygendir@/globus_foot.html # The HTML_STYLESHEET tag can be used to specify a user defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet HTML_STYLESHEET = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. PREDEFINED = GLOBUS_DONT_DOCUMENT_INTERNAL \ GLOBUS_SEPARATE_DOCS \ DOXYGEN \ @lac_doxygen_predefines@ # The TAGFILES tag can be used to specify one or more tagfiles. TAGFILES = @lac_doxygen_tagfiles@ # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = doc/html/@lac_doxygen_output_tagfile@.tag # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = @PERL@ # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = @HAVE_DOT@ # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = @lac_doxygen_srcdirs@ \ @lac_doxygen_examples@ globus_xio-3.6/doxygen/Doxyfile-internal.in0000644000076400007640000001073512225575522016104 00000000000000# Doxyfile 1.2.6 # This file describes the settings to be used by doxygen for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") # # Include the standard part of the doxygen configuration: # @INCLUDE_PATH = @doxygendir@ @INCLUDE = Doxyfile-internal.include # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "@lac_doxygen_project@ (Internal Documentation)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @lac_doxygen_srcdirs@ \ @lac_doxygen_examples@ # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. FILE_PATTERNS = *.c \ *.h \ @lac_doxygen_file_patterns@ # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = @lac_doxygen_input_filter@ # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = @lac_doxygen_examples@ # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = @doxygendir@/globus_head.html # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = @doxygendir@/globus_foot.html # The HTML_STYLESHEET tag can be used to specify a user defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet HTML_STYLESHEET = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. PREDEFINED = DOXYGEN \ @lac_doxygen_predefines@ # The TAGFILES tag can be used to specify one or more tagfiles. TAGFILES = @lac_doxygen_tagfiles@ # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = doc/html/@lac_doxygen_output_tagfile@.tag # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = @PERL@ # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = @HAVE_DOT@ globus_xio-3.6/doxygen/Makefile.am0000644000076400007640000000464112225575522014212 00000000000000include $(top_srcdir)/globus_automake_pre # # Automake rules for installing and building doxygen docs # doxygen_installdox = @lac_doxygen_installdox@ doc-stamp: @DOXYFILE@ @if test ! -z "@DOXYGEN@"; then \ @DOXYGEN@ @DOXYFILE@; \ if test -n "$(doxygen_installdox)"; then \ if test -x ./doc/html/installdox; then \ $(PERL) ./doc/html/installdox $(doxygen_installdox) ./doc/html/*;\ fi ; \ fi ; \ if test -d doc/latex; then \ (cd doc/latex ; for f in *.tex ; do sed 's/\\doxyref{p\.}/\\doxyref{}{p\.}/g' $$f > $$f.new ; mv $$f.new $$f ; done ; sed 's/\(latex_count\)=[0-9] /\1=10 /' Makefile > Makefile.new ; mv Makefile.new Makefile ; make) ; \ fi \ fi touch $@ all-local: doc-stamp install-data-local: doc-stamp @if test ! -z "@DOXYGEN@"; then \ for dir in `find ./doc/{html,man} -type d -print|sed "s,./doc/,,"`; do \ if test -z "`echo $${dir}|sed -n '/^man/ p'`"; then \ $(INSTALL) -d -m 755 \ $(DESTDIR)$(docdir)/$${dir}; \ else \ $(INSTALL) -d -m 755 \ $(DESTDIR)$(mandir)/`echo $${dir} | sed -e 's/^man//'`; \ fi \ done; \ for file in `find ./doc/{html,man} -type f -print|sed "s,./doc/,,"`; do \ if test -z "`echo $${file}|sed -n '/^man/ p'`"; then \ $(INSTALL) -m 644 ./doc/$${file} \ $(DESTDIR)$(docdir)/$${file}; \ else \ $(INSTALL) -m 644 ./doc/$${file} \ $(DESTDIR)$(mandir)/`echo $${file} | sed -e 's/^man//'`;\ fi \ done; \ if test -f doc/latex/refman.pdf; then \ $(INSTALL) -m 644 doc/latex/refman.pdf \ $(DESTDIR)$(docdir); \ fi \ fi clean-local: @if test ! -z "@DOXYGEN@"; then \ rm -rf ./doc*; \ fi rm -f doc-stamp filelist: doc-stamp @if test ! -z "@DOXYGEN@"; then \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ find ./doc/{man,html} -type f -print | \ sed -e 's,./doc/man,$(mandir),' \ -e 's,./doc,$(docdir),' \ -e 's,^$(prefix),,' \ >> $${filelistdir}/noflavor_doc.filelist; \ if test -f doc/latex/refman.pdf; then \ echo $(docdir)/refman.pdf | sed 's,^$(prefix),,' \ >> $${filelistdir}/noflavor_doc.filelist; \ fi \ fi dist-hook: doc-stamp @if test ! -z "@DOXYGEN@"; then \ if test -d doc; then \ cp -r doc $(distdir)/doc ; \ fi ; \ if test -d doc-internal; then \ cp -r doc-internal $(distdir)/doc-internal ; \ fi ; \ fi ; include $(top_srcdir)/globus_automake_post globus_xio-3.6/doxygen/Makefile.in0000664000076400007640000003347412225614603014225 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Doxyfile-internal.in $(srcdir)/Doxyfile.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_pre subdir = doxygen ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = Doxyfile Doxyfile-internal depcomp = am__depfiles_maybe = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies # # Automake rules for installing and building doxygen docs # doxygen_installdox = @lac_doxygen_installdox@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_post $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doxygen/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doxygen/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ Doxyfile-internal: $(top_builddir)/config.status $(srcdir)/Doxyfile-internal.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-info-am doc-stamp: @DOXYFILE@ @if test ! -z "@DOXYGEN@"; then \ @DOXYGEN@ @DOXYFILE@; \ if test -n "$(doxygen_installdox)"; then \ if test -x ./doc/html/installdox; then \ $(PERL) ./doc/html/installdox $(doxygen_installdox) ./doc/html/*;\ fi ; \ fi ; \ if test -d doc/latex; then \ (cd doc/latex ; for f in *.tex ; do sed 's/\\doxyref{p\.}/\\doxyref{}{p\.}/g' $$f > $$f.new ; mv $$f.new $$f ; done ; sed 's/\(latex_count\)=[0-9] /\1=10 /' Makefile > Makefile.new ; mv Makefile.new Makefile ; make) ; \ fi \ fi touch $@ all-local: doc-stamp install-data-local: doc-stamp @if test ! -z "@DOXYGEN@"; then \ for dir in `find ./doc/{html,man} -type d -print|sed "s,./doc/,,"`; do \ if test -z "`echo $${dir}|sed -n '/^man/ p'`"; then \ $(INSTALL) -d -m 755 \ $(DESTDIR)$(docdir)/$${dir}; \ else \ $(INSTALL) -d -m 755 \ $(DESTDIR)$(mandir)/`echo $${dir} | sed -e 's/^man//'`; \ fi \ done; \ for file in `find ./doc/{html,man} -type f -print|sed "s,./doc/,,"`; do \ if test -z "`echo $${file}|sed -n '/^man/ p'`"; then \ $(INSTALL) -m 644 ./doc/$${file} \ $(DESTDIR)$(docdir)/$${file}; \ else \ $(INSTALL) -m 644 ./doc/$${file} \ $(DESTDIR)$(mandir)/`echo $${file} | sed -e 's/^man//'`;\ fi \ done; \ if test -f doc/latex/refman.pdf; then \ $(INSTALL) -m 644 doc/latex/refman.pdf \ $(DESTDIR)$(docdir); \ fi \ fi clean-local: @if test ! -z "@DOXYGEN@"; then \ rm -rf ./doc*; \ fi rm -f doc-stamp filelist: doc-stamp @if test ! -z "@DOXYGEN@"; then \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ find ./doc/{man,html} -type f -print | \ sed -e 's,./doc/man,$(mandir),' \ -e 's,./doc,$(docdir),' \ -e 's,^$(prefix),,' \ >> $${filelistdir}/noflavor_doc.filelist; \ if test -f doc/latex/refman.pdf; then \ echo $(docdir)/refman.pdf | sed 's,^$(prefix),,' \ >> $${filelistdir}/noflavor_doc.filelist; \ fi \ fi dist-hook: doc-stamp @if test ! -z "@DOXYGEN@"; then \ if test -d doc; then \ cp -r doc $(distdir)/doc ; \ fi ; \ if test -d doc-internal; then \ cp -r doc-internal $(distdir)/doc-internal ; \ fi ; \ fi ; # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: globus_xio-3.6/globus_xio_pass.c0000666000076400007640000015700111374254655014055 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio.h" #include "globus_xio_util.h" /************************************************************************ * open * ---- ***********************************************************************/ globus_result_t globus_xio_driver_pass_open( globus_xio_operation_t in_op, const globus_xio_contact_t * contact_info, globus_xio_driver_callback_t in_cb, void * in_user_arg) { globus_i_xio_op_t * op; globus_i_xio_handle_t * handle; globus_i_xio_context_t * context; globus_i_xio_context_entry_t * my_context; globus_i_xio_op_entry_t * my_op; int prev_ndx; globus_result_t res; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_bool_t close = GLOBUS_FALSE; globus_xio_driver_t driver; GlobusXIOName(globus_xio_driver_pass_open); GlobusXIODebugInternalEnter(); op = (in_op); globus_assert(op->ndx < op->stack_size); handle = op->_op_handle; context = op->_op_context; op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; if(op->canceled) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] :Operation canceled\n"), _xio_name)); res = GlobusXIOErrorCanceled(); } else { my_context = &context->entry[op->ndx]; GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_OPENING); my_context->outstanding_operations++; context->ref++; prev_ndx = op->ndx; do { driver = context->entry[op->ndx].driver; op->ndx++; } while(driver->transport_open_func == NULL && driver->transform_open_func == NULL); op->entry[prev_ndx].next_ndx = op->ndx; op->entry[prev_ndx].type = GLOBUS_XIO_OPERATION_TYPE_OPEN; my_op = &op->entry[op->ndx - 1]; my_op->cb = (in_cb); my_op->user_arg = (in_user_arg); my_op->prev_ndx = prev_ndx; my_op->type = GLOBUS_XIO_OPERATION_TYPE_OPEN; /* at time that stack is built this will be varified */ globus_assert(op->ndx <= context->stack_size); /* ok to do this unlocked because no one else has it yet */ op->ref += 2; /* 1 for the pass, and one until finished */ my_op->in_register = GLOBUS_TRUE; if(op->ndx == op->stack_size) { res = driver->transport_open_func( contact_info, my_op->link, my_op->open_attr, op); } else { res = driver->transform_open_func( contact_info, my_op->link, my_op->open_attr, op); } my_op->in_register = GLOBUS_FALSE; if(driver->attr_destroy_func != NULL && my_op->open_attr != NULL) { driver->attr_destroy_func(my_op->open_attr); my_op->open_attr = NULL; } if(res == GLOBUS_SUCCESS && prev_ndx == 0) { while(op->finished_delayed) { /* reuse this blocked thread to finish the operation */ op->finished_delayed = GLOBUS_FALSE; globus_i_xio_driver_resume_op(op); } } globus_mutex_lock(&context->mutex); { if(res != GLOBUS_SUCCESS) { globus_i_xio_pass_failed(op, my_context, &close, &destroy_handle); context->ref--; /* cant possibly be 0 while there is still this op */ globus_assert(context->ref > 0); globus_assert(!destroy_handle); } GlobusXIOOpDec(op); /* for the pass */ if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } } GlobusXIODebugInternalExit(); return res; } void globus_xio_driver_finished_open( void * in_dh, globus_xio_operation_t in_op, globus_result_t in_res) { globus_i_xio_op_t * op; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_i_xio_op_entry_t * my_op; globus_result_t res; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_xio_driver_finished_open); GlobusXIODebugInternalEnter(); res = (in_res); op = (globus_i_xio_op_t *)(in_op); globus_assert(op->ndx > 0); op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; context = op->_op_context; context->entry[op->ndx - 1].driver_handle = (in_dh); my_op = &op->entry[op->ndx - 1]; my_context = &context->entry[my_op->prev_ndx]; /* no operation can happen while in OPENING state so no need to lock */ switch(my_context->state) { case GLOBUS_XIO_CONTEXT_STATE_OPENING: if(res == GLOBUS_SUCCESS) { GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_OPEN); } else { GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_OPEN_FAILED); } break; /* if user has already called close */ case GLOBUS_XIO_CONTEXT_STATE_OPENING_AND_CLOSING: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_CLOSING); break; default: globus_assert(0); } if(my_op->prev_ndx == 0 && !op->blocking && op->_op_handle) { space = op->_op_handle->space; } op->cached_obj = GlobusXIOResultToObj(res); if(my_op->in_register || space != GLOBUS_CALLBACK_GLOBAL_SPACE) { /* if this is a blocking op, we avoid the oneshot by delaying the * finish until the stack unwinds */ if(op->blocking && GlobusXIOBlockedThreadMatchesCurrentThread(op->blocked_thread)) { GlobusXIODebugDelayedFinish(); op->finished_delayed = GLOBUS_TRUE; } else { GlobusXIODebugInregisterOneShot(); globus_i_xio_register_oneshot( op->_op_handle, globus_l_xio_driver_open_op_kickout, (void *)op, space); } } else { globus_l_xio_driver_open_op_kickout(op); } GlobusXIODebugInternalExit(); } void globus_xio_driver_open_delivered( globus_xio_operation_t in_op, int in_ndx, globus_xio_operation_type_t * deliver_type) { globus_i_xio_op_t * op; globus_i_xio_op_t * close_op = NULL; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_bool_t close_kickout = GLOBUS_FALSE; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_bool_t destroy_context = GLOBUS_FALSE; globus_i_xio_handle_t * handle; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_xio_driver_open_delivered); GlobusXIODebugInternalEnter(); op = (in_op); context = op->_op_context; handle = op->_op_handle; my_context = &context->entry[in_ndx]; /* LOCK */ globus_mutex_lock(&context->mutex); { /* make sure it only gets delivered once */ if(deliver_type == NULL || *deliver_type == GLOBUS_XIO_OPERATION_TYPE_FINISHED) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : Already delivered\n"), _xio_name)); GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } globus_mutex_unlock(&context->mutex); goto exit; } *deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; op->entry[in_ndx].deliver_type = NULL; GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } globus_assert(my_context->outstanding_operations > 0); my_context->outstanding_operations--; switch(my_context->state) { /* open failed and user didn't try and close */ case GLOBUS_XIO_CONTEXT_STATE_OPEN_FAILED: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_CLOSED); context->ref--; break; /* this happens when the open fails and the user calls close */ case GLOBUS_XIO_CONTEXT_STATE_OPENING_AND_CLOSING: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_CLOSING); if(!my_context->close_started && my_context->outstanding_operations == 0 && my_context->close_op != NULL) { close_kickout = GLOBUS_TRUE; my_context->close_started = GLOBUS_TRUE; close_op = my_context->close_op; context->ref--; } break; case GLOBUS_XIO_CONTEXT_STATE_OPEN: case GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED: case GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED: case GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING: break; case GLOBUS_XIO_CONTEXT_STATE_CLOSING: case GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING: if(!my_context->close_started && my_context->outstanding_operations == 0 && my_context->close_op != NULL) { my_context->close_started = GLOBUS_TRUE; close_op = my_context->close_op; } break; default: globus_assert(0); break; } if(context->ref == 0) { destroy_context = GLOBUS_TRUE; } } globus_mutex_unlock(&context->mutex); if(close_op != NULL) { /* if closed before fully opened and open was successful we need to start the regular close process */ if(!close_kickout) { globus_i_xio_driver_start_close(close_op, GLOBUS_FALSE); } /* if open failed then just kickout the close */ else { if(close_op->entry[close_op->ndx - 1].prev_ndx == 0 && !close_op->blocking && close_op->_op_handle != NULL) { space = close_op->_op_handle->space; } globus_i_xio_register_oneshot( handle, globus_l_xio_driver_op_close_kickout, (void *)close_op, space); } } exit: if(destroy_handle) { globus_i_xio_handle_destroy(handle); } if(destroy_context) { /* the only way we'll be destroying the context is if this was a * driver op and the handle no longer exists */ globus_assert(!destroy_handle); globus_i_xio_context_destroy(context); } GlobusXIODebugInternalExit(); } /************************************************************************ * close * ----- ***********************************************************************/ globus_result_t globus_xio_driver_pass_close( globus_xio_operation_t in_op, globus_xio_driver_callback_t in_cb, void * in_ua) { globus_i_xio_op_t * op; globus_i_xio_handle_t * handle; globus_i_xio_context_t * context; globus_i_xio_context_entry_t * my_context; globus_bool_t pass; globus_i_xio_op_entry_t * my_op; int prev_ndx; globus_result_t res = GLOBUS_SUCCESS; globus_xio_driver_t driver; globus_xio_operation_type_t deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; GlobusXIOName(globus_xio_driver_pass_close); GlobusXIODebugInternalEnter(); op = (in_op); globus_assert(op->ndx < op->stack_size); handle = op->_op_handle; context = op->_op_context; op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; my_context = &context->entry[op->ndx]; if(op->canceled && op->type != GLOBUS_XIO_OPERATION_TYPE_OPEN) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] :Operation canceled\n"), _xio_name)); res = GlobusXIOErrorCanceled(); } else { prev_ndx = op->ndx; do { driver = context->entry[op->ndx].driver; op->ndx++; } while(driver->close_func == NULL); my_op = &op->entry[op->ndx - 1]; my_op->type = GLOBUS_XIO_OPERATION_TYPE_CLOSE; /* deal with context state */ globus_mutex_lock(&context->mutex); { switch(my_context->state) { case GLOBUS_XIO_CONTEXT_STATE_OPEN: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_CLOSING); break; case GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING); break; case GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING); break; case GLOBUS_XIO_CONTEXT_STATE_OPEN_FAILED: case GLOBUS_XIO_CONTEXT_STATE_OPENING: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_OPENING_AND_CLOSING); break; default: globus_assert(0); } /* a barrier will never happen if the level above already did th close barrier and this level has not created any driver ops. in this case outstanding_operations is garentueed to be zero */ globus_assert(!my_context->close_started); if(my_context->outstanding_operations == 0) { pass = GLOBUS_TRUE; my_context->close_started = GLOBUS_TRUE; } /* cache the op for close barrier */ else { pass = GLOBUS_FALSE; my_context->close_op = op; } if(op->entry[prev_ndx].deliver_type != NULL) { /* make local copy */ deliver_type = *op->entry[prev_ndx].deliver_type; /* set copy in finished to null, thus preventing Delived from being called twice */ *op->entry[prev_ndx].deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; /* set the op ppinter to NULL for completeness */ op->entry[prev_ndx].deliver_type = NULL; /* op ref count so that op stays around long enough to check that it was restarted */ GlobusXIOOpInc(op); } } globus_mutex_unlock(&context->mutex); my_op->cb = (in_cb); my_op->user_arg = (in_ua); my_op->prev_ndx = prev_ndx; if(deliver_type != GLOBUS_XIO_OPERATION_TYPE_FINISHED) { globus_i_xio_driver_deliver_op(op, prev_ndx, deliver_type); } /* op can be checked outside of lock */ if(pass) { res = globus_i_xio_driver_start_close(op, GLOBUS_TRUE); } } if(res != GLOBUS_SUCCESS) { globus_mutex_lock(&context->mutex); { GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_CLOSED); context->ref--; /* cant possibly be 0 if there is still an op */ globus_assert(context->ref > 0); } globus_mutex_unlock(&context->mutex); } GlobusXIODebugInternalExit(); return res; } void globus_xio_driver_finished_close( globus_xio_operation_t in_op, globus_result_t in_res) { globus_i_xio_op_t * op; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_i_xio_op_entry_t * my_op; globus_result_t res; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_xio_driver_finished_close); GlobusXIODebugInternalEnter(); res = (in_res); op = (globus_i_xio_op_t *)(in_op); globus_assert(op->ndx > 0); op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; context = op->_op_context; my_op = &op->entry[op->ndx - 1]; my_context = &context->entry[my_op->prev_ndx]; globus_mutex_lock(&context->mutex); { GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_CLOSED); context->ref--; } globus_mutex_unlock(&context->mutex); globus_assert(op->ndx >= 0); /* otherwise we are not in bad memory */ op->cached_obj = GlobusXIOResultToObj(res); if(my_op->prev_ndx == 0 && !op->blocking && op->_op_handle) { space = op->_op_handle->space; } if(my_op->in_register || space != GLOBUS_CALLBACK_GLOBAL_SPACE) { /* if this is a blocking op, we avoid the oneshot by delaying the * finish until the stack unwinds */ if(op->blocking && GlobusXIOBlockedThreadMatchesCurrentThread(op->blocked_thread)) { GlobusXIODebugDelayedFinish(); op->finished_delayed = GLOBUS_TRUE; } else { GlobusXIODebugInregisterOneShot(); globus_i_xio_register_oneshot( op->_op_handle, globus_l_xio_driver_op_close_kickout, (void *)op, space); } } else { globus_l_xio_driver_op_close_kickout(op); } GlobusXIODebugInternalExit(); } /************************************************************************ * write * ----- ***********************************************************************/ globus_result_t globus_xio_driver_pass_write( globus_xio_operation_t in_op, globus_xio_iovec_t * in_iovec, int in_iovec_count, globus_size_t in_wait_for, globus_xio_driver_data_callback_t in_cb, void * in_user_arg) { globus_i_xio_op_t * op; globus_i_xio_op_entry_t * my_op; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_entry_t * next_context; globus_i_xio_context_t * context; globus_bool_t close = GLOBUS_FALSE; int prev_ndx; globus_result_t res = GLOBUS_SUCCESS; globus_xio_driver_t driver; globus_xio_operation_type_t deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; globus_i_xio_handle_t * handle; globus_bool_t destroy_handle = GLOBUS_FALSE; GlobusXIOName(globus_xio_driver_pass_write); GlobusXIODebugInternalEnter(); op = (in_op); context = op->_op_context; my_context = &context->entry[op->ndx]; op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; handle = op->_op_handle; globus_assert(op->ndx < op->stack_size); /* error checking */ globus_assert(my_context->state == GLOBUS_XIO_CONTEXT_STATE_OPEN || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED); if(op->canceled) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] :Operation canceled\n"), _xio_name)); res = GlobusXIOErrorCanceled(); } else { /* set up the entry */ prev_ndx = op->ndx; do { next_context = &context->entry[op->ndx]; driver = next_context->driver; op->ndx++; } while(driver->write_func == NULL); op->entry[prev_ndx].next_ndx = op->ndx; op->entry[prev_ndx].type = GLOBUS_XIO_OPERATION_TYPE_WRITE; my_op = &op->entry[op->ndx - 1]; my_op->prev_ndx = prev_ndx; my_op->_op_ent_data_cb = (in_cb); my_op->user_arg = (in_user_arg); my_op->_op_ent_iovec = (in_iovec); my_op->_op_ent_iovec_count = (in_iovec_count); my_op->_op_ent_nbytes = 0; my_op->_op_ent_wait_for = (in_wait_for); my_op->type = GLOBUS_XIO_OPERATION_TYPE_WRITE; globus_mutex_lock(&context->mutex); { if(op->entry[prev_ndx].deliver_type != NULL) { /* make local copy */ deliver_type = *op->entry[prev_ndx].deliver_type; /* set copy in finished to null, thus preventing Delived from being called twice */ *op->entry[prev_ndx].deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; /* set the op ppinter to NULL for completeness */ op->entry[prev_ndx].deliver_type = NULL; /* op ref count so that op stays around long enough to check that it was restarted */ GlobusXIOOpInc(op); } my_context->outstanding_operations++; op->ref += 2; /* for pass and until finished */ } globus_mutex_unlock(&context->mutex); if(deliver_type != GLOBUS_XIO_OPERATION_TYPE_FINISHED) { globus_i_xio_driver_deliver_op(op, prev_ndx, deliver_type); } /* set the callstack flag */ my_op->in_register = GLOBUS_TRUE; res = driver->write_func( next_context->driver_handle, my_op->_op_ent_iovec, my_op->_op_ent_iovec_count, op); /* flip the callstack flag */ my_op->in_register = GLOBUS_FALSE; if(res == GLOBUS_SUCCESS && prev_ndx == 0) { while(op->finished_delayed) { /* reuse this blocked thread to finish the operation */ op->finished_delayed = GLOBUS_FALSE; globus_i_xio_driver_resume_op(op); } } globus_mutex_lock(&context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } if(res != GLOBUS_SUCCESS) { globus_i_xio_pass_failed(op, my_context, &close, &destroy_handle); globus_assert(!destroy_handle); } } globus_mutex_unlock(&context->mutex); } if(close) { globus_i_xio_driver_start_close(my_context->close_op, GLOBUS_FALSE); } else if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); return res; } void globus_xio_driver_finished_write( globus_xio_operation_t in_op, globus_result_t result, globus_size_t nbytes) { globus_i_xio_op_t * op; globus_i_xio_op_entry_t * my_op; globus_result_t res; globus_bool_t fire_cb = GLOBUS_TRUE; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_xio_driver_finished_write); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *)(in_op); res = (result); op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; context = op->_op_context; my_op = &op->entry[op->ndx - 1]; my_context = &context->entry[my_op->prev_ndx]; op->cached_obj = GlobusXIOResultToObj(res); globus_assert(my_context->state != GLOBUS_XIO_CONTEXT_STATE_OPENING && my_context->state != GLOBUS_XIO_CONTEXT_STATE_CLOSED); my_op->_op_ent_nbytes += nbytes; /* if not all bytes were written */ if(my_op->_op_ent_nbytes < my_op->_op_ent_wait_for && res == GLOBUS_SUCCESS) { /* if not enough bytes read set the fire_cb default to false */ fire_cb = GLOBUS_FALSE; /* repass the operation down */ res = globus_i_xio_repass_write(op); if(res != GLOBUS_SUCCESS) { fire_cb = GLOBUS_TRUE; } } if(fire_cb) { if(my_op->_op_ent_fake_iovec != NULL) { globus_free(my_op->_op_ent_fake_iovec); my_op->_op_ent_fake_iovec = NULL; } if(my_op->prev_ndx == 0 && !op->blocking && op->_op_handle) { space = op->_op_handle->space; } globus_assert(my_op->type == GLOBUS_XIO_OPERATION_TYPE_WRITE); if(my_op->in_register || space != GLOBUS_CALLBACK_GLOBAL_SPACE) { /* if this is a blocking op, we avoid the oneshot by delaying the * finish until the stack unwinds */ if(op->blocking && GlobusXIOBlockedThreadMatchesCurrentThread(op->blocked_thread)) { GlobusXIODebugDelayedFinish(); op->finished_delayed = GLOBUS_TRUE; } else { GlobusXIODebugInregisterOneShot(); globus_i_xio_register_oneshot( op->_op_handle, globus_l_xio_driver_op_write_kickout, (void *)op, space); } } else { globus_l_xio_driver_op_write_kickout(op); } } GlobusXIODebugInternalExit(); } void globus_xio_driver_write_delivered( globus_xio_operation_t in_op, int in_ndx, globus_xio_operation_type_t * deliver_type) { globus_i_xio_op_t * op; globus_i_xio_op_t * close_op; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_bool_t close = GLOBUS_FALSE; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_i_xio_handle_t * handle; GlobusXIOName(globus_xio_driver_write_delivered); GlobusXIODebugInternalEnter(); op = (in_op); context = op->_op_context; my_context = &context->entry[in_ndx]; handle = op->_op_handle; /* LOCK */ globus_mutex_lock(&context->mutex); { /* make sure it only gets delivered once */ if(deliver_type == NULL || *deliver_type == GLOBUS_XIO_OPERATION_TYPE_FINISHED) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : Already delivered\n"), _xio_name)); GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } globus_mutex_unlock(&context->mutex); goto exit; } op->entry[in_ndx].deliver_type = NULL; *deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } globus_assert(my_context->outstanding_operations > 0); my_context->outstanding_operations--; GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : Context @ 0x%x State=%d Count=%d close_start=%d\n"), _xio_name, my_context, my_context->state, my_context->outstanding_operations, my_context->close_started)); /* if we have a close delayed */ if((my_context->state == GLOBUS_XIO_CONTEXT_STATE_CLOSING || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING) && my_context->outstanding_operations == 0 && !my_context->close_started) { globus_assert(my_context->close_op != NULL); close = GLOBUS_TRUE; close_op = my_context->close_op; my_context->close_started = GLOBUS_TRUE; } } globus_mutex_unlock(&context->mutex); if(close) { globus_i_xio_driver_start_close(close_op, GLOBUS_FALSE); } exit: if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); } /************************************************************************ * read * ---- ***********************************************************************/ globus_result_t globus_xio_driver_pass_read( globus_xio_operation_t in_op, globus_xio_iovec_t * in_iovec, int in_iovec_count, globus_size_t in_wait_for, globus_xio_driver_data_callback_t in_cb, void * in_user_arg) { globus_i_xio_op_t * op; globus_i_xio_op_entry_t * my_op; globus_i_xio_context_entry_t * next_context; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; int prev_ndx; globus_result_t res = GLOBUS_SUCCESS; globus_bool_t close = GLOBUS_FALSE; globus_xio_driver_t driver; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_bool_t pass = GLOBUS_TRUE; globus_xio_operation_type_t deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; GlobusXIOName(globus_xio_driver_pass_read); GlobusXIODebugInternalEnter(); op = (in_op); context = op->_op_context; my_context = &context->entry[op->ndx]; op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; prev_ndx = op->ndx; globus_assert(op->ndx < op->stack_size); /* error checking */ globus_assert(my_context->state == GLOBUS_XIO_CONTEXT_STATE_OPEN || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED); if(op->canceled) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] :Operation canceled\n"), _xio_name)); res = GlobusXIOErrorCanceled(); } else { /* find next slot. start on next and find first interseted */ do { next_context = &context->entry[op->ndx]; driver = next_context->driver; op->ndx++; } while(driver->read_func == NULL); op->entry[prev_ndx].next_ndx = op->ndx; op->entry[prev_ndx].type = GLOBUS_XIO_OPERATION_TYPE_READ; my_op = &op->entry[op->ndx - 1]; my_op->prev_ndx = prev_ndx; my_op->_op_ent_data_cb = (in_cb); my_op->user_arg = (in_user_arg); my_op->_op_ent_iovec = (in_iovec); my_op->_op_ent_iovec_count = (in_iovec_count); my_op->_op_ent_nbytes = 0; my_op->_op_ent_wait_for = (in_wait_for); my_op->type = GLOBUS_XIO_OPERATION_TYPE_READ; globus_mutex_lock(&context->mutex); { if(op->entry[prev_ndx].deliver_type != NULL) { /* make local copy */ deliver_type = *op->entry[prev_ndx].deliver_type; /* set copy in finished to null, thus preventing Delived from being called twice */ *op->entry[prev_ndx].deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; /* set the op ppinter to NULL for completeness */ op->entry[prev_ndx].deliver_type = NULL; /* op ref count so that op stays around long enough to check that it was restarted */ GlobusXIOOpInc(op); } if(my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[%s]: Queuing read on eof list\n"), _xio_name)); op->cached_obj = GlobusXIOErrorObjEOF(); globus_list_insert(&my_context->eof_op_list, op); op->ref++; my_context->eof_operations++; pass = GLOBUS_FALSE; } else if( my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED || my_context->pending_reads > 0) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[%s]: Queuing read on pending queue\n"), _xio_name)); /* add this to the pending queue */ my_context->pending_reads++; globus_fifo_enqueue(&my_context->pending_read_queue, op); op->ref++; pass = GLOBUS_FALSE; } else { my_context->read_operations++; op->ref += 2; /* 1 for pass, 1 until finished */ } my_context->outstanding_operations++; } globus_mutex_unlock(&context->mutex); if(deliver_type != GLOBUS_XIO_OPERATION_TYPE_FINISHED) { globus_i_xio_driver_deliver_op(op, prev_ndx, deliver_type); } if(pass) { /* set the callstack flag */ my_op->in_register = GLOBUS_TRUE; res = driver->read_func( next_context->driver_handle, my_op->_op_ent_iovec, my_op->_op_ent_iovec_count, op); /* flip the callstack flag */ my_op->in_register = GLOBUS_FALSE; if(res == GLOBUS_SUCCESS && prev_ndx == 0) { while(op->finished_delayed) { /* reuse this blocked thread to finish the operation */ op->finished_delayed = GLOBUS_FALSE; globus_i_xio_driver_resume_op(op); } } globus_mutex_lock(&context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); globus_assert(!destroy_handle); } if(res != GLOBUS_SUCCESS) { globus_i_xio_pass_failed(op, my_context, &close, &destroy_handle); globus_assert(!destroy_handle); my_context->read_operations--; if(my_context->read_operations == 0 && (my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING)) { globus_l_xio_driver_purge_read_eof(my_context); } } } globus_mutex_unlock(&context->mutex); } } if(close) { globus_i_xio_driver_start_close(my_context->close_op, GLOBUS_FALSE); } GlobusXIODebugInternalExit(); return res; } void globus_xio_driver_finished_read( globus_xio_operation_t in_op, globus_result_t result, globus_size_t nbytes) { globus_i_xio_op_t * op; globus_i_xio_op_entry_t * my_op; globus_result_t res; globus_bool_t fire_cb = GLOBUS_TRUE; globus_i_xio_context_entry_t * my_context; globus_i_xio_context_t * context; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_xio_driver_finished_read); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *)(in_op); res = (result); op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; context = op->_op_context; my_op = &op->entry[op->ndx - 1]; my_context = &context->entry[my_op->prev_ndx]; globus_assert(op->ndx > 0); globus_assert(my_context->state != GLOBUS_XIO_CONTEXT_STATE_OPENING && my_context->state != GLOBUS_XIO_CONTEXT_STATE_CLOSED); my_op->_op_ent_nbytes += nbytes; if(res != GLOBUS_SUCCESS && globus_xio_error_is_eof(res)) { globus_mutex_lock(&context->mutex); { switch(my_context->state) { case GLOBUS_XIO_CONTEXT_STATE_OPEN: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED); break; case GLOBUS_XIO_CONTEXT_STATE_CLOSING: GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING); break; case GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING: case GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED: break; default: globus_assert(0); break; } my_context->read_operations--; my_context->eof_operations++; if(my_context->read_operations > 0) { op->cached_obj = GlobusXIOResultToObj(res); globus_list_insert(&my_context->eof_op_list, op); fire_cb = GLOBUS_FALSE; } } globus_mutex_unlock(&context->mutex); } /* if not all bytes were read */ else if(my_op->_op_ent_nbytes < my_op->_op_ent_wait_for && res == GLOBUS_SUCCESS) { /* if not enough bytes read set the fire_cb deafult to false */ fire_cb = GLOBUS_FALSE; res = globus_i_xio_repass_read(op); if(res != GLOBUS_SUCCESS) { fire_cb = GLOBUS_TRUE; } } if(fire_cb) { /* if a temp iovec struct was used for fullfulling waitfor, we can free it now */ if(my_op->_op_ent_fake_iovec != NULL) { globus_free(my_op->_op_ent_fake_iovec); my_op->_op_ent_fake_iovec = NULL; } if(my_op->prev_ndx == 0 && !op->blocking && op->_op_handle) { space = op->_op_handle->space; } op->cached_obj = GlobusXIOResultToObj(res); globus_assert(my_op->type == GLOBUS_XIO_OPERATION_TYPE_READ); if(my_op->in_register || space != GLOBUS_CALLBACK_GLOBAL_SPACE) { /* if this is a blocking op, we avoid the oneshot by delaying the * finish until the stack unwinds */ if(op->blocking && GlobusXIOBlockedThreadMatchesCurrentThread(op->blocked_thread)) { GlobusXIODebugDelayedFinish(); op->finished_delayed = GLOBUS_TRUE; } else { GlobusXIODebugInregisterOneShot(); globus_i_xio_register_oneshot( op->_op_handle, globus_l_xio_driver_op_read_kickout, (void *)op, space); } } else { globus_l_xio_driver_op_read_kickout(op); } } GlobusXIODebugInternalExit(); } static void globus_l_xio_pass_pending_reads( globus_i_xio_context_entry_t * my_context) { globus_i_xio_context_t * context; globus_bool_t destroy_context; globus_i_xio_op_t * op; GlobusXIOName(globus_l_xio_pass_pending_reads); GlobusXIODebugInternalEnter(); context = my_context->whos_my_daddy; destroy_context = GLOBUS_FALSE; globus_mutex_lock(&context->mutex); /* this holds a reference on read operations to prevent any eofs from * being delivered before I can dump this pending queue into the eof * queue */ my_context->read_operations++; context->ref++; while(my_context->pending_reads > 0) { /* I hold an outstanding read operation so it shouldn't be possible * to enter EOF_DELIVERED here */ globus_assert(my_context->state != GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED); if(my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING) { /* one of the reads we just dispatched caused an eof, dump * the remaining in the eof queue */ GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[%s]: Dumping pending queue into eof list\n"), _xio_name)); do { my_context->pending_reads--; op = (globus_i_xio_op_t *) globus_fifo_dequeue(&my_context->pending_read_queue); op->cached_obj = GlobusXIOErrorObjEOF(); globus_list_insert(&my_context->eof_op_list, op); my_context->eof_operations++; } while(my_context->pending_reads > 0); op = NULL; } else { my_context->pending_reads--; op = (globus_i_xio_op_t *) globus_fifo_dequeue(&my_context->pending_read_queue); my_context->read_operations++; op->ref++; /* for the pass */ } if(op) { globus_i_xio_op_entry_t * my_op; globus_i_xio_context_entry_t * next_context; globus_result_t res; globus_bool_t destroy_handle; globus_mutex_unlock(&context->mutex); my_op = &op->entry[op->ndx - 1]; next_context = &context->entry[op->ndx - 1]; my_op->in_register = GLOBUS_TRUE; if(op->canceled) { res = GlobusXIOErrorCanceled(); } else { res = next_context->driver->read_func( next_context->driver_handle, my_op->_op_ent_iovec, my_op->_op_ent_iovec_count, op); } if(res != GLOBUS_SUCCESS) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[%s]: Pending read failed, finishing now\n"), _xio_name)); globus_xio_driver_finished_read(op, res, 0); } my_op->in_register = GLOBUS_FALSE; globus_mutex_lock(&context->mutex); GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); globus_assert(!destroy_handle); } } } /* remove read operation reference and purge eofs if there are no * outstanding reads */ my_context->read_operations--; if(my_context->read_operations == 0 && (my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING)) { globus_l_xio_driver_purge_read_eof(my_context); } context->ref--; if(context->ref == 0) { destroy_context = GLOBUS_TRUE; } globus_mutex_unlock(&context->mutex); if(destroy_context) { globus_i_xio_context_destroy(context); } GlobusXIODebugInternalExit(); } void globus_xio_driver_read_delivered( globus_xio_operation_t op, int in_ndx, globus_xio_operation_type_t * deliver_type) { globus_i_xio_context_entry_t * my_context; globus_bool_t purge_eof; globus_bool_t dispatch_pending = GLOBUS_FALSE; globus_bool_t close = GLOBUS_FALSE; globus_i_xio_context_t * context; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_i_xio_handle_t * handle; GlobusXIOName(globus_xio_driver_read_delivered); GlobusXIODebugInternalEnter(); context = op->_op_context; my_context = &context->entry[in_ndx]; handle = op->_op_handle; globus_mutex_lock(&context->mutex); { /* make sure it only gets delivered once */ if(deliver_type == NULL || *deliver_type == GLOBUS_XIO_OPERATION_TYPE_FINISHED) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : Already delivered\n"), _xio_name)); GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } globus_mutex_unlock(&context->mutex); goto exit; } *deliver_type = GLOBUS_XIO_OPERATION_TYPE_FINISHED; op->entry[in_ndx].deliver_type = NULL; GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } purge_eof = GLOBUS_FALSE; if(my_context->read_operations == 0) { /* just delivered an eof op */ switch(my_context->state) { case GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED: purge_eof = GLOBUS_TRUE; GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED); break; case GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING: purge_eof = GLOBUS_TRUE; GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING); break; case GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING: case GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED: break; default: globus_assert(0); } my_context->eof_operations--; if(my_context->eof_operations == 0) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[%s]: All eof ops delivered\n"), _xio_name)); if(my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED) { GlobusXIOContextStateChange(my_context, GLOBUS_XIO_CONTEXT_STATE_OPEN); } if(my_context->pending_reads > 0) { dispatch_pending = GLOBUS_TRUE; } } } else { my_context->read_operations--; /* if no more read operations are outstanding and we are waiting * on EOF, purge eof list */ if(my_context->read_operations == 0 && (my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING)) { purge_eof = GLOBUS_TRUE; } } my_context->outstanding_operations--; if(purge_eof) { globus_l_xio_driver_purge_read_eof(my_context); } GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] : Context @ 0x%x State=%d Count=%d close_start=%d\n"), _xio_name, my_context, my_context->state, my_context->outstanding_operations, my_context->close_started)); globus_assert(my_context->outstanding_operations >= 0); if((my_context->state == GLOBUS_XIO_CONTEXT_STATE_CLOSING || my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING) && my_context->outstanding_operations == 0 && !my_context->close_started) { close = GLOBUS_TRUE; my_context->close_started = GLOBUS_TRUE; } } globus_mutex_unlock(&context->mutex); if(dispatch_pending) { globus_l_xio_pass_pending_reads(my_context); } if(close) { globus_i_xio_driver_start_close(my_context->close_op, GLOBUS_FALSE); } exit: if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugInternalExit(); } /************************************************************************ * accept * ------ ***********************************************************************/ globus_result_t globus_xio_driver_pass_accept( globus_xio_operation_t in_op, globus_xio_driver_callback_t in_cb, void * in_user_arg) { globus_i_xio_op_t * op; globus_i_xio_server_t * server; globus_i_xio_server_entry_t * my_server; globus_i_xio_op_entry_t * my_op; int prev_ndx; globus_result_t res; globus_xio_driver_t driver; GlobusXIOName(globus_xio_driver_pass_accept); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *)(in_op); globus_assert(op->ndx < op->stack_size); server = op->_op_server; op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; if(op->canceled) { GlobusXIODebugPrintf(GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[%s] :Operation canceled\n"), _xio_name)); res = GlobusXIOErrorCanceled(); } else { prev_ndx = op->ndx; do { my_op = &op->entry[op->ndx]; my_server = &server->entry[op->ndx]; driver = my_server->driver; op->ndx++; } while(driver->server_accept_func == NULL); my_op->type = GLOBUS_XIO_OPERATION_TYPE_ACCEPT; my_op->cb = (in_cb); my_op->user_arg = (in_user_arg); my_op->prev_ndx = (prev_ndx); my_op->in_register = GLOBUS_TRUE; res = driver->server_accept_func( my_server->server_handle, op); my_op->in_register = GLOBUS_FALSE; if(res == GLOBUS_SUCCESS && prev_ndx == 0) { while(op->finished_delayed) { /* reuse this blocked thread to finish the operation */ op->finished_delayed = GLOBUS_FALSE; globus_l_xio_driver_op_accept_kickout(op); } } } GlobusXIODebugInternalExit(); return res; } void globus_xio_driver_finished_accept( globus_xio_operation_t in_op, void * in_link, globus_result_t in_res) { globus_i_xio_op_t * op; globus_i_xio_op_entry_t * my_op; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_xio_driver_finished_accept); GlobusXIODebugInternalEnter(); op = (globus_i_xio_op_t *)(in_op); globus_assert(op->ndx > 0); op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; my_op = &op->entry[op->ndx - 1]; op->cached_obj = GlobusXIOResultToObj((in_res)); my_op->link = (in_link); if(my_op->prev_ndx == 0 && !op->blocking) { space = op->_op_server->space; } if(my_op->in_register || space != GLOBUS_CALLBACK_GLOBAL_SPACE) { /* if this is a blocking op, we avoid the oneshot by delaying the * finish until the stack unwinds */ if(op->blocking && GlobusXIOBlockedThreadMatchesCurrentThread(op->blocked_thread)) { GlobusXIODebugDelayedFinish(); op->finished_delayed = GLOBUS_TRUE; } else { GlobusXIODebugInregisterOneShot(); globus_i_xio_register_oneshot( NULL, globus_l_xio_driver_op_accept_kickout, (void *)op, space); } } else { globus_l_xio_driver_op_accept_kickout(op); } GlobusXIODebugInternalExit(); } globus_result_t globus_xio_driver_pass_server_init( globus_xio_operation_t op, const globus_xio_contact_t * contact_info, void * driver_server) { globus_i_xio_server_t * server; globus_result_t res; GlobusXIOName(globus_xio_driver_pass_server_init); GlobusXIODebugInternalEnter(); server = op->_op_server; op->progress = GLOBUS_TRUE; op->block_timeout = GLOBUS_FALSE; if(op->ndx < op->stack_size) { server->entry[op->ndx].server_handle = driver_server; } while(--op->ndx >= 0 && server->entry[op->ndx].driver->server_init_func == NULL) { } if(op->ndx >= 0) { res = server->entry[op->ndx].driver->server_init_func( op->entry[op->ndx].open_attr, contact_info, op); } else { res = globus_xio_contact_info_to_string( contact_info, &server->contact_string); } GlobusXIODebugInternalExit(); return res; } globus_xio-3.6/globus_xio_util.c0000666000076400007640000000553410406071562014054 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio_util.h" #include "globus_xio_types.h" #include "globus_common.h" globus_bool_t globus_xio_get_env_pair( const char * env_name, int * min, int * max) { char * min_max; GlobusXIOName(globus_xio_get_env_pair); min_max = globus_module_getenv(env_name); if(min_max && sscanf(min_max, " %d , %d", min, max) == 2) { return GLOBUS_TRUE; } return GLOBUS_FALSE; } globus_bool_t globus_xio_error_is_eof( globus_result_t res) { return globus_error_match( globus_error_peek(res), GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_EOF); } globus_bool_t globus_xio_error_is_canceled( globus_result_t res) { return globus_error_match( globus_error_peek(res), GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_CANCELED); } globus_bool_t globus_xio_error_match( globus_result_t result, int type) { return globus_error_match( globus_error_peek(result), GLOBUS_XIO_MODULE, type); } globus_result_t globus_xio_contact_copy( globus_xio_contact_t * dst, const globus_xio_contact_t * src) { globus_result_t result; GlobusXIOName(globus_xio_contact_copy); if(dst == NULL) { result = GlobusXIOErrorParameter("dst"); goto error; } if(src == NULL) { result = GlobusXIOErrorParameter("src"); goto error; } memset(dst, '\0', sizeof(globus_xio_contact_t)); if(src->unparsed) { dst->unparsed = strdup(src->unparsed); } if(src->resource) { dst->resource = strdup(src->resource); } if(src->host) { dst->host = strdup(src->host); } if(src->port) { dst->port = strdup(src->port); } if(src->scheme) { dst->scheme = strdup(src->scheme); } if(src->user) { dst->user = strdup(src->user); } if(src->pass) { dst->pass = strdup(src->pass); } if(src->subject) { dst->subject = strdup(src->subject); } return GLOBUS_SUCCESS; error: return result; } globus_xio-3.6/config.sub0000755000076400007640000007577712225614603012500 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-07-08' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ms1 \ | msp430 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m32c) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; m32c-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: globus_xio-3.6/globus_xio_driver.h0000666000076400007640000015241312225561752014404 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(GLOBUS_XIO_DRIVER_H) #define GLOBUS_XIO_DRIVER_H 1 #include "globus_common.h" #include "globus_xio_load.h" #include "globus_common.h" #include "globus_xio_types.h" #include "globus_xio.h" #include "globus_xio_util.h" #include EXTERN_C_BEGIN /************************************************************************ * attribute macros ***********************************************************************/ #define GlobusIXIOAttrGetDS(_out_ds, _in_attr, _in_driver) \ do \ { \ int _ctr; \ globus_i_xio_attr_t * _attr; \ globus_xio_driver_t _driver; \ globus_i_xio_attr_ent_t * _entry; \ void * _ds = NULL; \ \ _attr = (_in_attr); \ _driver = (_in_driver); \ \ if(_in_attr == NULL) \ { \ _out_ds = NULL; \ } \ else \ { \ _entry = _attr->entry; \ for(_ctr = 0; _ctr < _attr->ndx && _ds == NULL; _ctr++) \ { \ if(_entry[_ctr].driver == _driver) \ { \ _ds = _entry[_ctr].driver_data; \ } \ } \ _out_ds = _ds; \ } \ } while(0) /******************************************************************* * driver interface ******************************************************************/ /** * @defgroup globus_xio_driver Globus XIO Driver * * Globus XIO introduces a notion of a driver stack to its API. * With in globus_xio every IO operation must occur on a globus_xio * handle. Associated with each handle is a stack of drivers. * A driver is a module piece of code that implements the globus_xio * driver interface. The purpose of a driver is manipulate data passed * in by the user in someway. Each driver in a stack will serve its own * unique purpose. * \n * IO operations pass from driver to driver, starting at the top of the * stack and ending at the bottom. When the bottom layer driver finishes * with the operation it signals globus_xio that it has completed. * Completion notification then follows the driver stack up to the top. * * \par Driver Types: * * \par * Transport driver:\n * A transport driver is one that is responsible for actually putting * bytes onto the wire. For example: A TCP driver or a UDP driver would * be an example of transport drivers. * \n\n * Per driver stack there must be exactly one transport driver and * must be at the bottom of the stack. A transform driver is defined * by its lack of passing an operation to the next driver in the stack. * This type of driver does not rely on globus_xio for further completion * of an operation, rather it is self sufficent in this task. * * \par * Transform driver:\n * A tranform driver is any intermediate driver in the stack. These * drivers are indentified by there reliance on the driver stack to * complete the operation. These drivers must pass the operation * down the stack because they cannot complete it themselves. An * example of a transform driver would be a gsi driver. This driver * would wrap and unwrap messages, but would not be able to complete * the transport itself, so it would rely on the remaining drivers in * the stack. * * \par Driver API * The globus xio driver api is a set of functions and interfaces * to allow a developer to create a backend driver for globus_xio. * To create a driver the user must implement all of the interface * functions in the driver specification. * There are also a set of functions provide to assist the driver * author in implemention. * * \par * Quick Start:\n * Four basic driver needs the user will have to pay attention to a * few new structures and concepts. * * \par * globus_xio_operation_t\n * This structure represents a request for an operation. If * the driver can service the operation it does so and the * calls the appropriate finish_operation() function. If the * driver cannot completely service the operation it can pass() * it along to the next driver in the stack. As soon as the * operation structure is either finished or passed it is no * longer valid for use in any other function. * * \par * globus_xio_driver_handle_t\n * A driver_handle represents a open handle to the driver stack for xio. * The driver obtains a driver_handle by calling * globus_xio_driver_open(). * When the open operation completes (it callback is called) the * driver then has a driver_handle. The driver_handle * allows the user to do some * complex things that will be described later. * * \par * globus_xio_stack_t\n * This structure provides the driver with information about the * driver stack It is mainly used for creating driver_handle as a * parameter to lobus_xio_driver_open().. * * \par Typical Sequence: * Here is a typcial sequence of events for a globus_xio transform * driver: * * \par * Open\n * globus_xio_driver_open_t is called. The user calls * globus_xio_driver_open() passing it the operation and * the stack and a callback. When the open callback is called * the driver is given a new operation as a parameter. The driver * will then call globus_xio_driver_finished_open() passing * it the now initialized driver_handle and the newly received * operation. * The call to globus_xio_driver_finished_open() does two things: * 1) it tells globus_xio that this driver has finished its open * operation, and 2) it gives xio the driver_handle (which contains * information on the drivers below it). * * \par * Read/Write\n * The read or write interface funcion is called. It receives * a operation as a parameter. The driver then calls the * approriate pass operation and waits for the callback. When * the callback is received the driver calls finished_operation * passing in the operation structure it received in the callback * * \par * Close\n * The close interface function is called and is passed an * operation and a driver_handle. The driver will call * globus_xio_driver_close() passing it the operation. * When the close callback is received the driver calls * globus_xio_driver_finished_close() passing it the * operation received in the close callback and the driver_handle * received in the interface function. At this point the * driver_handle * is no longer valid.. */ /** * @addtogroup globus_xio_driver * * \par Advanced Driver Programming * The typical driver implementatin is describe above. However globus_xio * allows driver authors to do more advanced things. Some of these things * will be explored here. * * \par * Read Ahead\n * Once a driver_handle is open a driver can spawn operation structures from * it. This gives the driver the ability to request io from the driver * stack before it receives a call to its own interface io interface * function. So if a driver wishes to read ahead it does the following: * * \li it creats an operation by calling globus_xio_driver_create_operation() * and passing it the driver_handle it is intereesting in using. * * \li call globus_xio_driver_read() using this operations. When the read * callback is received the driver may call finished_operation() on the * op it receives (this ultimitely results in very little, since this * operation was started by this driver, but it is good practice and will * free up resources that would otherwise leak). * * \li Now when the user finally does receive a read interface call from * globus_xio it can imediately finish it using the operation it just * received as a parameter and updating the iovec structure to represent * the read that already occured. * * \par * Preopening handles.\n * Once the driver has received a globus_xio_driver_stack_t it can * open a driver_handle. The globus_xio_driver_stack_t comes in the * call to the interface function globus_xio_server/client_init_t(). * The driver uses this structure in a call to globus_xio_driver_open(). * When this functionality completes the driver has an initialized * driver_handle and can use it to create operations as described above. * The driver can now hang onto this driver_handle until it receives an open * interface function call. At which time it can call * globus_xio_driver_finished_open() passing in the driver_handle and thereby * glueing the pre opened driver_handle with the requested globus_xio * operation. */ /** * @defgroup driver_pgm Driver Programming * * The set of interface functions that the driver author must implement * to create a driver and the functions to assist in the creation. * * Driver attribute functions * * If the driver wishes to provide driver specific attributes to the * user it must implement the following functions: * * globus_xio_driver_attr_init_t * globus_xio_driver_attr_copy_t * globus_xio_driver_attr_cntl_t * globus_xio_driver_attr_destroy_t */ /******************************************************************* * callbacks ******************************************************************/ /** * callback interface * @ingroup driver_pgm * * This is the function signature of callbacks for the * globus_xio_driver_open/close(). * * @param op * The operation structure associated with the open or the * close requested operation. The driver should call the * appropriate finished operation to clean up this structure. * * @param result * The result of the requested data operation * * @param user_arg * The user pointer that is threaded through to the callback. */ typedef void (*globus_xio_driver_callback_t)( globus_xio_operation_t op, globus_result_t result, void * user_arg); /** * Data Callback interface * @ingroup driver_pgm * * This is the function signature of read and write operation * callbacks. * * @param op * The operation structure associated with the read or write * operation request. The driver should call the approriate * finished operation when it receives this operation. * * @param result * The result of the requested data operation * * @param nbytes * the number of bytes read or written * * @param user_arg * The user pointer that is threaded through to the callback. */ typedef void (*globus_xio_driver_data_callback_t)( globus_xio_operation_t op, globus_result_t result, globus_size_t nbytes, void * user_arg); typedef globus_result_t (*globus_xio_driver_push_driver_t)( globus_xio_driver_t driver, globus_xio_stack_t stack); globus_result_t globus_xio_driver_attr_cntl( globus_xio_operation_t op, globus_xio_driver_t driver, int cmd, ...); globus_result_t globus_xio_driver_data_descriptor_cntl( globus_xio_operation_t op, globus_xio_driver_t driver, int cmd, ...); /** * @ingroup driver_pgm * Touch driver specific information in a handle object. * * pass the driver to control a specific driver * pass NULL for driver for XIO specific cntls * pass GLOBUS_XIO_QUERY for driver to try each driver (below current) * in order */ globus_result_t globus_xio_driver_handle_cntl( globus_xio_driver_handle_t handle, globus_xio_driver_t driver, int cmd, ...); /** * @ingroup driver_pgm */ typedef globus_result_t (*globus_xio_driver_get_driver_t)( globus_xio_driver_t * out_driver); /** * @ingroup driver_pgm * Create a driver specific attribute. * * The driver should implement this function to create a driver * specific attribute and return it via the out_attr parameter. * */ typedef globus_result_t (*globus_xio_driver_attr_init_t)( void ** out_driver_attr); /** * @ingroup driver_pgm * Copy a driver attr. * * When this function is called the driver will create a copy of the attr * in parameter src and place it in the parameter dst. */ typedef globus_result_t (*globus_xio_driver_attr_copy_t)( void ** dst, void * src); /** * @ingroup driver_pgm * Destroy the driver attr. * * Clean up all resources associate with the attr. * */ typedef globus_result_t (*globus_xio_driver_attr_destroy_t)( void * driver_attr); /** * @ingroup driver_pgm * get or set information in an attr. * * The cmd parameter determines what functionality the user is requesting. * The driver is resonsible for providing documentation to the user on * all the possible values that cmd can be. * * @param driver_attr * The driver specific attr, created by * globus_xio_driver_attr_init_t. * * @param cmd * An integer representing what functionality the user is requesting. * * @param ap * variable arguments. These are determined by the driver and the * value of cmd. */ typedef globus_result_t (*globus_xio_driver_attr_cntl_t)( void * attr, int cmd, va_list ap); /** * @ingroup driver_pgm * Initialize a server object * * The driver developer should implement this function if their driver * handles server operations (pasive opens). In the tcp driver this * function should create a listener. * * @param op * An op which should be passed to globus_xio_driver_server_created. * Note, that unlike most operations, the server is created from * the bottom of the stack to the top. * * @param contact_info * This the contact info for the stack below this driver. * (entries will always be NULL for the transport driver) * * @param driver_attr * A server attr if the user specified any driver specific * attributes. This may be NULL. * * @return * Returning GLOBUS_SUCCESS for this means that * ` globus_xio_driver_pass_server_init returned success and * the driver's server was successfully initialized. */ typedef globus_result_t (*globus_xio_driver_server_init_t)( void * driver_attr, const globus_xio_contact_t * contact_info, globus_xio_operation_t op); /** * signify that the server has been created with this call. Must be called * within the call to the driver's globus_xio_driver_server_init_t * interface. This call is different than all other pass calls, as it operates * from the bottom of the stack to the top. If it returns an error, the user * should destroy their driver_server. * * @param op * The operation passed to the globus_xio_driver_server_init_t * function. * * @param contact_info * The contact info for this driver and the stack below. If the driver * has nothing to add, it should just pass the one it received on the * interface. * * The memory for this contact_info is only needed for the life of the * call, so it is acceptable for it to be declared on the stack and * it is acceptable to 'steal' pointers from the received contact_info. * * @param driver_server * The driver's server handle. Future calls to server accept or server * cntl will be passed this value. */ globus_result_t globus_xio_driver_pass_server_init( globus_xio_operation_t op, const globus_xio_contact_t * contact_info, void * driver_server); /** * @ingroup driver_pgm * destroy a server. * * When this function is called the driver should free up all resources * associated with a server. * * @param server * The server that the driver should clean up. * * @param driver_server * The reference to the iunternal server that is being declaired * invaild with this function call. */ typedef globus_result_t (*globus_xio_driver_server_destroy_t)( void * driver_server); /** * @ingroup driver_pgm * Accept a server connection * * The driver developer should implement this function if their driver * handles server operations. Once the accept operation completes, the * connection is established. The user still has an opertunity to * open the link or destroy it. They can query the link for * additional information on which to base the decision to open. * * @param driver_server * The server object from which the link connection will be * accepted. * * @param op * The requested operation. When the driver is finished acepting * the server connection it uses this structure to signal globus_xio * that it has completed the operation. */ typedef globus_result_t (*globus_xio_driver_server_accept_t)( void * driver_server, globus_xio_operation_t op); globus_result_t globus_xio_driver_pass_accept( globus_xio_operation_t op, globus_xio_driver_callback_t in_cb, void * in_user_arg); /** * @ingroup driver_pgm */ typedef void (*globus_xio_driver_cancel_callback_t)( globus_xio_operation_t op, void * user_arg, globus_xio_error_type_t reason); /** * @ingroup driver_pgm * Driver API finished accept * * This function should be called to signal globus_xio that it has * completed the accept operation requested of it. It will free up * resources associated with the accept_op and potientially cause xio * to pop the signal up the driver stack. * * @param op * The requested accept operation that has completed. * * @param driver_link * This is the initialized driver link that is that will be passed to * the open interface when this handle is opened. * * @param result * Return status of the completed operation */ void globus_xio_driver_finished_accept( globus_xio_operation_t op, void * driver_link, globus_result_t result); /** * @ingroup driver_pgm * Query a server for information. * * This function allows a user to request information from a driver * specific server handle. * * @param driver_server * the server handle. * * @param cmd * An integer telling the driver what operation to preform on this * server handle. * * @param ap * variable args. */ typedef globus_result_t (*globus_xio_driver_server_cntl_t)( void * driver_server, int cmd, va_list ap); /** * @ingroup driver_pgm */ typedef globus_result_t (*globus_xio_driver_link_cntl_t)( void * driver_link, int cmd, va_list ap); /** * @ingroup driver_pgm * destroy a link * * The driver should clean up all resources associated with the link * when this function is called. * * @param driver_link * The link to be destroyed. */ typedef globus_result_t (*globus_xio_driver_link_destroy_t)( void * driver_link); /********************************************************************** * Open *********************************************************************/ /** * Open a handle * @ingroup driver_pgm * * This is called when a user requests to open a handle. * * @param driver_link * Comes from server accept. Used to link an accepted connection to * an xio handle. xio will destroy this object upon the return of * this interface call. * * @param driver_attr * A attribute describing how to open. This points to a piece of * memory created by the globus_xio_driver_driver_attr_init_t * interface funstion. * * @param contact_info * Contains information about the requested resource. Its members * may all be null (especially when link is not null). XIO will * destroy this contact info upon return from the interface function * * @param op * The requested operation. When the driver is finished opening * the handle it uses this structure to signal globus_xio that it * has completed the operation requested. It does this by calling * globus_xio_driver_finished_open() * */ typedef globus_result_t (*globus_xio_driver_transform_open_t)( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op); /** * @ingroup driver_pgm * transport open */ typedef globus_result_t (*globus_xio_driver_transport_open_t)( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, globus_xio_operation_t op); /** * Driver API Open * @ingroup driver_pgm * * This function will pass an open request down the driver stack. * Upon completion of the open operation globus_xio will call the @a cb * function, at which point the handle structure will be intialized * and available for use. * * As soon as the function returns the handle is valid for creating * other operations. * * @param op * The operation from which the handle will be established. This * parameter is used to determine what drivers are in the stack and * other such information. * * @param contact_info * The contact info describing the resource the driver below should * open. This will normally be the same contact info that was * passed in on the open interface. * * @param cb * The function to be called wehn the open operation is complete. * * @param user_arg * a user pointer that will be threaded through to the callback. */ globus_result_t globus_xio_driver_pass_open( globus_xio_operation_t op, const globus_xio_contact_t * contact_info, globus_xio_driver_callback_t cb, void * user_arg); /** * Driver API finished open * @ingroup driver_pgm * * This function should be called to signal globus_xio that it has * completed the open operation requested of it. It will free up * resources associated with the op and potientially cause xio * to pop the signal up the driver stack. * * @param driver_handle * The driver specific handle pointer that will be passed to * future interface funstion calls. * * @param op * The requested open operation that has completed. * * @param result * Return status of the completed operation */ void globus_xio_driver_finished_open( void * driver_handle, globus_xio_operation_t op, globus_result_t result); /********************************************************************** * Context functions *********************************************************************/ /** * Driver API Create Operation * @ingroup driver_pgm * * This function will create an operation from an initialized handle * This operation can then be used for io operations related to the * handle that created them. * * @param operation * The operation to be created. When this function returns * this structure will be populated and available for use * for the driver. * * @param handle * The initialized handle representing the user handle from * which the operation will be created. * */ globus_result_t globus_xio_driver_operation_create( globus_xio_operation_t * operation, globus_xio_driver_handle_t handle); /** * @ingroup driver_pgm */ void globus_xio_driver_operation_destroy( globus_xio_operation_t operation); /** * @ingroup driver_pgm */ globus_result_t globus_xio_driver_operation_cancel( globus_xio_driver_handle_t handle, globus_xio_operation_t operation); /** * Is Operation blocking. * @ingroup driver_pgm * * If the operation is blocking the driver developer may be able to make * certian optimizations. The function returns true if the given operation * was created via a user call to a blocking funciton. */ globus_bool_t globus_xio_driver_operation_is_blocking( globus_xio_operation_t operation); /** * @ingroup driver_pgm * * this call *must* return an GLOBUS_XIO_ERROR_COMMAND error for unsupported * command numbers. (use GlobusXIOErrorInvalidCommand(cmd)) * * Drivers that have reason to support the commands listed at * @ref globus_xio_handle_cmd_t should accept the xio generic cmd numbers * and their driver specific command number. Do NOT implement those handle * cntls unless you really are the definitive source. */ typedef globus_result_t (*globus_xio_driver_handle_cntl_t)( void * handle, int cmd, va_list ap); globus_result_t globus_xio_driver_merge_handle( globus_xio_operation_t op, globus_xio_driver_handle_t handle); /********************************************************************** * Close *********************************************************************/ /** * Close an open handle * @ingroup driver_pgm * * This is called when a user requests to close a handle. The driver * implemntor should clean up all resources connected to there driver handle * when this function is called. * * @param driver_specific_handle * The driver handle to be closed. * * @param driver_attr * A driver specific attr which may be used to alter how a close * is performed (e,g, caching drivers) * * @param op * The requested operation. When the driver is finished closing * the handle it uses this structure to signal globus_xio that it * has completed the operation requested. It does this by calling * globus_xio_driver_finished_close() */ typedef globus_result_t (*globus_xio_driver_close_t)( void * driver_handle, void * driver_attr, globus_xio_operation_t op); /** * Driver API Close * @ingroup driver_pgm * * This function will pass a close request down the driver stack. Upon * completion of the close operation globus_xio will call the funciton * pointed to by the cb argument. * * @param op * The operation to pass along the driver stack for closing. * * @param cb * A pointer to the function to be called once all drivers lower * in the stack have closed. * * @param user_arg * A user pointer that will be threaded through to the callback. */ globus_result_t globus_xio_driver_pass_close( globus_xio_operation_t op, globus_xio_driver_callback_t cb, void * user_arg); /** * Driver API finished_close * @ingroup driver_pgm * * The driver calls this function after completing a close operation * on a driver_handle. Once this function returns the driver_handle is * no longer * valid. * * @param op * The close operation that has completed. * * @param result * Return status of the completed operation */ void globus_xio_driver_finished_close( globus_xio_operation_t op, globus_result_t result); /********************************************************************** * Read *********************************************************************/ /** * Read data from an open handle. * @ingroup driver_pgm * * This function is called when the user requests to read data from * a handle. The driver author shall implement all code needed to for * there driver to complete a read operations. * * @param driver_handle * The driver handle from which data should be read. * * @param iovec * An io vector pointing to the buffers to be read into. * * @param iovec_count * The number if entries in the io vector. * * @param op * The requested operation. When the driver is finished fullfilling * the requested read operation it must use this structure to * signal globus_xio that the operation is completed. This is done * by calling globus_xio_driver_finished_operation().. */ typedef globus_result_t (*globus_xio_driver_read_t)( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op); /** * Driver read * @ingroup driver_pgm * * This function passes a read operation down the driver stack. After * this function is called the op structure is no longer valid. However * when the driver stack finishes servicing the read request it will * pass a new operation structure in the funciton pointed to by cb. * Finishe read can be called on the new operation received. * * @param op * The operation structure representing this requested io * operation. * * @param iovec * A pointer to the array of iovecs. * * @param iovec_count * The number of iovecs in the array. * * @param wait_for * The minimum number of bytes to read before returning... if a driver * has no specifc requirement, he should use the user's request... * available via GlobusXIOOperationMinimumRead(op) * @param cb * The function to be called when the operation request is * completed. * * @param user_arg * A user pointer that will be threaded through to the callback. */ globus_result_t globus_xio_driver_pass_read( globus_xio_operation_t op, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t wait_for, globus_xio_driver_data_callback_t cb, void * user_arg); /** * Finished Read * @ingroup driver_pgm * * This function is called to signal globus_xio that the requested * read operation has been completed. * * @param op * The operation structure representing the requested read * operation. * * @param result * Return status of the completed operation * * @param nread * The number of bytes read */ void globus_xio_driver_finished_read( globus_xio_operation_t op, globus_result_t result, globus_size_t nread); /** * EOF state manipulation * @ingroup driver_pgm * * This function is used by drivers that allow multiple outstanding reads at * a time. It can only be called on behalf of a read operation (while in the * read interface call or the pass_read callback). * * Typical use for this would be to hold a driver specific lock and call this * when an internal eof has been received. The read operation this is called * on behalf of must be finished with an eof error or the results are * undefined. * * In general, you should not have an eof flag in your driver. Use this call * and globus_xio_driver_eof_received() instead. This is necessary to support * xio's automatic eof resetting. If your driver absolutely can not be read * after an eof has been set, then you will need your own eof flag. * * This call will typically only be used just before a finished_read() call. * * @param op * The operation structure representing the requested read * operation. */ void globus_xio_driver_set_eof_received( globus_xio_operation_t op); /** * EOF state checking * @ingroup driver_pgm * * This function is used by drivers that allow multiple outstanding reads at * a time. It can only be called on behalf of a read operation (while in the * read interface call or the pass_read callback). * * Typical use for this would be to hold a driver specific lock (the same one * used when calling globus_xio_driver_set_eof_received()) and call this to * see if an eof has been received. If so, the operation should immediately be * finished with an eof error (do not _return_ an eof error). * * This call will typically only be used in the read interface call. * * @param op * The operation structure representing the requested read * operation. * * @return * GLOBUS_TRUE if eof received, GLOBUS_FALSE otherwise. */ globus_bool_t globus_xio_driver_eof_received( globus_xio_operation_t op); /********************************************************************** * Write *********************************************************************/ /** * Write data from an open handle. * @ingroup driver_pgm * * This function is called when the user requests to write data to * a handle. The driver author shall implement all code needed to for * there driver to complete write operations. * * @param driver_handle * The driver handle to which data should be writen. * * @param iovec * An io vector pointing to the buffers to be written. * * @param iovec_count * The number if entries in the io vector. * * @param op * The requested operation. When the driver is finished fullfilling * the requested read operation it must use this structure to * signal globus_xio that the operation is completed. This is done * by calling globus_xio_driver_finished_operation().. */ typedef globus_result_t (*globus_xio_driver_write_t)( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_xio_operation_t op); /** * Driver write * @ingroup driver_pgm * * This function passes a write operation down the driver stack. After * this function is called the op structure is no longer valid. However * when the driver stack finishes servicing the write request it will * pass a new operation structure in the funciton pointed to by cb. * Finished write can be called on the new operation received. * * @param op * The operation structure representing this requested io * operation. * * @param iovec * A pointer to the array of iovecs. * * @param iovec_count * The number of iovecs in the array. * * @param wait_for * The minimum number of bytes to write before returning... if a driver * has no specifc requirement, he should use the user's request... * available via GlobusXIOOperationMinimumWrite(op) * * @param cb * The function to be called when the operation request is * completed. * * @param user_arg * A user pointer that will be threaded through to the callback. */ globus_result_t globus_xio_driver_pass_write( globus_xio_operation_t op, globus_xio_iovec_t * iovec, int iovec_count, globus_size_t wait_for, globus_xio_driver_data_callback_t cb, void * user_arg); /** * Finished Write * @ingroup driver_pgm * * This function is called to signal globus_xio that the requested * write operation has been completed. * * @param op * The operation structure representing the requested write * operation. * * @param result * Return status of the completed operation * * @param nwritten * The number of bytes written */ void globus_xio_driver_finished_write( globus_xio_operation_t op, globus_result_t result, globus_size_t nwritten); /** * Finishes an operation and merge two op structures. * (XXX not implemented yet) * @ingroup driver_pgm * * This function will join to operations together and signal globus_xio * that it has completed. This is an advanced function. Most drivers will * not require its use. This function takes an operation that was created * by this driver and passed on to drivers lower on the stack and an * operation that came in on the interface function (that has seen the top * half of the stack) and joins them together. The purpose of this function * is to join data descriptors that were prestaged and cached with those * that have later come in at the users request. See the read ahead doc * for more information. * * @param top_op * The operation that has seen the top part of the driver stack. * * @param bottom_op * The operation that has seen the bottom part of the driver stack. * * (result is always success in this case.. if there is an error, use the * other finish() call) */ globus_result_t globus_xio_driver_merge_operation( globus_xio_operation_t top_op, globus_xio_operation_t bottom_op); /********************************************************************** * data descriptors *********************************************************************/ /** * @page dd_driver Data descriptors * * globus_xio uses data descriptors to associate meta data with the * data being writen or the data read. * * Data descriptors flow into the drivers read and write interface * functions by way of the operation structure. If the driver is * interested in viewing the data decriptor it can request it from * the operation structure via a call to * globus_xio_driver_operation_get_data_descriptor() and it can view * any driver specific data descriptor via a call to * globus_xio_driver_data_descriptor_get_specific(). The driver * can modify values in the data descriptor by setting values before * passing the request down the stack. Several functions are available * to modify the data descriptors. There is no need to "set()" the * data descriptors back into the operation. The functions for manipluating * the values in a DD affect the values xio has directly. * * Data descriptors flow back to the driver in the callbacks for * the data operations. When calling finished operation on a data * operation the driver must pass in a data descriptor. It should get * this data descriptor from the io operation callback. * * Life Cycle: * * Passing in a data descriptor: * A data descriptor is first created by the globus_xio user. The user * can add driver specific data descriptors to it. Once the usre has * created and set the attributes on its data descriptor to their liking * they pass it into a globus_xio data operation (either read or write). * When the data descriptor is passed on globus_xio will make an internal * copy of it. It does this by first coping the user the level * data descriptor and then walkinging through the list of driver specific * data descriptor contianed in to and requesting the the driver make * a copy of the driver specific data descriptor. If ever a driver * specific data descriptor is NULL globus_xio need not call into its * drivers dd_copy function. If ever the user level data descriptor is * NULL globus_xio need not deal with the data descriptor functionality at * all. * * A data descriptor coming back up the stack * Once an io operation reachs the transport driver (the bottom of the * stack) it takes on a slightly different role. On the way in it * is describing what is requested to be done with the data, on the way * out it is describing what has actually been done. Once the transport * driver performs the operation it should adjust the data descriptor * to reflect what has actually happened (few drivers will need to worry * about this). Each driver on the way up can adjust the data * descriptor and its driver specific data decriptor. When xio reachs the * the top of the stack it calls a user callback. When that callback * returns all memory associated with the data descriptor is cleaned up. * The interface function globus_xio_driver_data_descriptor_free() is * used for this. */ globus_result_t globus_xio_driver_init( globus_xio_driver_t * driver, const char * driver_name, void * user_data); /** * @ingroup driver_pgm */ globus_result_t globus_xio_driver_get_user_data( globus_xio_driver_t in_driver, void ** out_user_data); /** * @ingroup driver_pgm */ globus_result_t globus_xio_operation_attr_cntl( globus_xio_operation_t op, globus_xio_attr_cmd_t cmd, ...); /** * @ingroup driver_pgm */ globus_result_t globus_xio_driver_destroy( globus_xio_driver_t driver); /** * @ingroup driver_pgm */ globus_result_t globus_xio_driver_set_transport( globus_xio_driver_t driver, globus_xio_driver_transport_open_t transport_open_func, globus_xio_driver_close_t close_func, globus_xio_driver_read_t read_func, globus_xio_driver_write_t write_func, globus_xio_driver_handle_cntl_t handle_cntl_func); /** * @ingroup driver_pgm */ globus_result_t globus_xio_driver_set_transform( globus_xio_driver_t driver, globus_xio_driver_transform_open_t transform_open_func, globus_xio_driver_close_t close_func, globus_xio_driver_read_t read_func, globus_xio_driver_write_t write_func, globus_xio_driver_handle_cntl_t handle_cntl_func, globus_xio_driver_push_driver_t push_driver_func); /** * @ingroup driver_pgm */ globus_result_t globus_xio_driver_set_server( globus_xio_driver_t driver, globus_xio_driver_server_init_t server_init_func, globus_xio_driver_server_accept_t server_accept_func, globus_xio_driver_server_destroy_t server_destroy_func, globus_xio_driver_server_cntl_t server_cntl_func, globus_xio_driver_link_cntl_t link_cntl_func, globus_xio_driver_link_destroy_t link_destroy_func); /** * @ingroup driver_pgm */ globus_result_t globus_xio_driver_set_attr( globus_xio_driver_t driver, globus_xio_driver_attr_init_t attr_init_func, globus_xio_driver_attr_copy_t attr_copy_func, globus_xio_driver_attr_cntl_t attr_cntl_func, globus_xio_driver_attr_destroy_t attr_destroy_func); /* * operation accessors */ void globus_xio_operation_block_timeout( globus_xio_operation_t op); void globus_xio_operation_unblock_timeout( globus_xio_operation_t op); void globus_xio_operation_refresh_timeout( globus_xio_operation_t op); /** returns true if operation already canceled */ globus_bool_t globus_xio_operation_enable_cancel( globus_xio_operation_t op, globus_xio_driver_cancel_callback_t cb, void * user_arg); void globus_xio_operation_disable_cancel( globus_xio_operation_t op); globus_bool_t globus_xio_operation_is_canceled( globus_xio_operation_t op); globus_size_t globus_xio_operation_get_wait_for( globus_xio_operation_t op); void * globus_xio_operation_get_driver_specific( globus_xio_operation_t op); globus_xio_driver_t globus_xio_operation_get_user_driver( globus_xio_operation_t op); /* this returns the handle to the drivers below you */ globus_xio_driver_handle_t globus_xio_operation_get_driver_handle( globus_xio_operation_t op); /* this returns the handle to your driver. * (only useful for canceling operations in your possession) * or getting user handle associated with the driver */ globus_xio_driver_handle_t globus_xio_operation_get_driver_self_handle( globus_xio_operation_t op); void * globus_xio_operation_get_data_descriptor( globus_xio_operation_t op, globus_bool_t force_create); globus_result_t globus_xio_operation_copy_stack( globus_xio_operation_t op, globus_xio_stack_t * stack); /* STRING PARSING STUFF */ /** * @ingroup driver_pgm */ typedef globus_result_t (*globus_xio_string_cntl_parse_func_t)( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); /** * @ingroup driver_pgm */ typedef struct globus_xio_string_cntl_table_s { char * key; int cmd; globus_xio_string_cntl_parse_func_t parse_func; } globus_xio_string_cntl_table_t; /** * * The set of interface functions that the driver author must implement * to create a driver and the functions to assist in the creation. * * Driver attribute functions * * If the driver wishes to provide driver specific attributes to the * user it must implement the following functions: * * globus_xio_driver_attr_init_t * globus_xio_driver_attr_copy_t * globus_xio_driver_attr_cntl_t * globus_xio_driver_attr_destroy_t */ /** * @defgroup string_driver_pgm Driver Programming: String options * * A driver can choose to expose parameters as in a string form. Providing * this feature makes dynamicly setting driver specific options much easier. * a user can then load the driverby name and set specific options by name * all at runtime with no object module references. For example, a TCP driver * can be loaded with the string: tcp, and the options can be set with: * * port=50668\#keepalive=yes\#nodelay=N * * this would set the port to 50668, keepalive to true and nodelay to false. * The particular string definition is defined by the tcp driver by properly * creating a globus_i_xio_attr_parse_table_t array. Each element of the * array is 1 options. There are 3 members of each array entry: key, cmd, and * parse function. The key is a string that defines what option is to be set. * In the above example string "port" would be 1 key. cmd tells the driver what * cntl is associated with the key. In otherwords, once the string is parsed out * what driver specific control must be called to set the requested option. For * more information on controls see @ref globus_xio_attr_cntl. The final value * in the array entry is the parsing function. The pasing function takes the * value of the = portion of the string and parses it into data types. * once parsed globus_xio_attr_cntl is called and thus the option is set. There are * many available parsing functions but the developer is free to right their own * if the provided ones are not sufficient. Sample parsing functions follow: * * - @ref globus_xio_string_cntl_bool * - @ref globus_xio_string_cntl_float * - @ref globus_xio_string_cntl_int * - @ref globus_xio_string_cntl_string * - @ref globus_xio_string_cntl_int_int * */ /** * @ingroup string_driver_pgm * */ globus_result_t globus_xio_driver_string_cntl_set_table( globus_xio_driver_t driver, globus_xio_string_cntl_table_t * table); /** * @ingroup string_driver_pgm * * New type functions call this one */ globus_result_t globus_xio_string_cntl_bouncer( globus_xio_driver_attr_cntl_t cntl_func, void * attr, int cmd, ...); /* list all of the built in parsing functions */ /** * @ingroup string_driver_pgm * * String option parsing function. */ globus_result_t globus_xio_string_cntl_bool( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); /** * @ingroup string_driver_pgm * * String option parsing function. */ globus_result_t globus_xio_string_cntl_float( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); /** * @ingroup string_driver_pgm * * String option parsing function. */ globus_result_t globus_xio_string_cntl_int( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); /** * @ingroup string_driver_pgm * * String option parsing function. */ globus_result_t globus_xio_string_cntl_string( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); /** * @ingroup string_driver_pgm * * String option parsing function. */ globus_result_t globus_xio_string_cntl_int_int( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); globus_result_t globus_xio_string_cntl_formated_off( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); globus_result_t globus_xio_string_cntl_formated_int( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); globus_result_t globus_xio_string_cntl_string_list( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func); EXTERN_C_END #endif /* GLOBUS_XIO_DRIVER_H */ globus_xio-3.6/globus_xio_types.h0000666000076400007640000001676512225561752014266 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(GLOBUS_XIO_TYPES_H) #define GLOBUS_XIO_TYPES_H 1 #include "globus_common.h" EXTERN_C_BEGIN #define GLOBUS_XIO_QUERY ((globus_xio_driver_t) 0x01) /************************************************************************* * define types ************************************************************************/ typedef struct globus_i_xio_handle_s * globus_xio_handle_t; typedef struct globus_i_xio_context_entry_s * globus_xio_driver_handle_t; typedef struct globus_i_xio_op_s * globus_xio_operation_t; typedef struct globus_i_xio_driver_s * globus_xio_driver_t; typedef struct globus_i_xio_attr_s * globus_xio_attr_t; typedef struct globus_i_xio_stack_s * globus_xio_stack_t; typedef struct globus_i_xio_server_s * globus_xio_server_t; typedef struct globus_i_xio_server_s * globus_xio_driver_server_t; typedef struct globus_i_xio_op_s * globus_xio_data_descriptor_t; typedef struct iovec globus_xio_iovec_t; /** * @ingroup GLOBUS_XIO_API * Operation types * * An enumeration of operation types. Used in the timeout callback * to indicate what operation typed timedout. */ typedef enum globus_i_xio_op_type_e { GLOBUS_XIO_OPERATION_TYPE_NONE, GLOBUS_XIO_OPERATION_TYPE_FINISHED, GLOBUS_XIO_OPERATION_TYPE_OPEN, GLOBUS_XIO_OPERATION_TYPE_CLOSE, GLOBUS_XIO_OPERATION_TYPE_READ, GLOBUS_XIO_OPERATION_TYPE_WRITE, GLOBUS_XIO_OPERATION_TYPE_ACCEPT, GLOBUS_XIO_OPERATION_TYPE_DRIVER, GLOBUS_XIO_OPERATION_TYPE_DD, GLOBUS_XIO_OPERATION_TYPE_SERVER_INIT } globus_xio_operation_type_t; typedef enum globus_i_xio_signal_type_e { GLOBUS_XIO_SIGNAL_TYPE_NONE } globus_xio_signal_type_t; typedef enum { GLOBUS_XIO_ERROR_CANCELED, GLOBUS_XIO_ERROR_EOF, GLOBUS_XIO_ERROR_COMMAND, GLOBUS_XIO_ERROR_CONTACT_STRING, GLOBUS_XIO_ERROR_PARAMETER, GLOBUS_XIO_ERROR_MEMORY, GLOBUS_XIO_ERROR_SYSTEM_ERROR, GLOBUS_XIO_ERROR_SYSTEM_RESOURCE, GLOBUS_XIO_ERROR_STACK, GLOBUS_XIO_ERROR_DRIVER, GLOBUS_XIO_ERROR_PASS, GLOBUS_XIO_ERROR_ALREADY_REGISTERED, GLOBUS_XIO_ERROR_STATE, GLOBUS_XIO_ERROR_WRAPPED, GLOBUS_XIO_ERROR_NOT_REGISTERED, GLOBUS_XIO_ERROR_NOT_ACTIVATED, GLOBUS_XIO_ERROR_UNLOADED, GLOBUS_XIO_ERROR_TIMEOUT, GLOBUS_XIO_ERROR_PARSE } globus_xio_error_type_t; /* ALL is all but ACCEPT */ typedef enum { GLOBUS_XIO_ATTR_SET_TIMEOUT_ALL, GLOBUS_XIO_ATTR_SET_TIMEOUT_OPEN, GLOBUS_XIO_ATTR_SET_TIMEOUT_CLOSE, GLOBUS_XIO_ATTR_SET_TIMEOUT_READ, GLOBUS_XIO_ATTR_SET_TIMEOUT_WRITE, GLOBUS_XIO_ATTR_SET_TIMEOUT_ACCEPT, GLOBUS_XIO_ATTR_SET_SPACE, GLOBUS_XIO_ATTR_CLOSE_NO_CANCEL, GLOBUS_XIO_ATTR_SET_CREDENTIAL, GLOBUS_XIO_ATTR_GET_CREDENTIAL } globus_xio_attr_cmd_t; /** doxygen varargs filter stuff * GlobusVarArgDefine( * handle, globus_result_t, globus_xio_handle_cntl, handle, driver) */ /** * Common driver handle cntls. * @ingroup GLOBUS_XIO_API * */ typedef enum { /* Make sure this enum starts at a high number */ /**GlobusVarArgEnum(handle) * Get local connection info. * @ingroup GLOBUS_XIO_API * * @param contact_string_out * A pointer to a contact string for the local end of a connected * handle. Where possible, it will be in symbolic form (FQDN). * * The user must free the returned string. * * @see globus_xio_server_get_contact_string() */ /* char ** contact_string_out */ GLOBUS_XIO_GET_LOCAL_CONTACT = 12345, /**GlobusVarArgEnum(handle) * Get local connection info. * @ingroup GLOBUS_XIO_API * * @param contact_string_out * A pointer to a contact string for the local end of a connected * handle. Where possible, it will be in numeric form. (IP) * * The user must free the returned string. */ /* char ** contact_string_out */ GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT, /**GlobusVarArgEnum(handle) * Get remote connection info. * @ingroup GLOBUS_XIO_API * * @param contact_string_out * A pointer to a contact string for the remote end of a connected * handle. Where possible, it will be in symbolic form (FQDN). * * The user must free the returned string. */ /* char ** contact_string_out */ GLOBUS_XIO_GET_REMOTE_CONTACT, /**GlobusVarArgEnum(handle) * Get remote connection info. * @ingroup GLOBUS_XIO_API * * @param contact_string_out * A pointer to a contact string for the remote end of a connected * handle. Where possible, it will be in numeric form. (IP) * * The user must free the returned string. */ /* char ** contact_string_out */ GLOBUS_XIO_GET_REMOTE_NUMERIC_CONTACT, /** GlobusVarArgEnum(handle) * Reposition read/write offset. * @ingroup GLOBUS_XIO_API * * @param offset * Specify the desired offset. */ /* globus_off_t offset */ GLOBUS_XIO_SEEK, /** GlobusVarArgEnum(handle) * Set the driver specific configuration string. The format of the * string is defined by the driver. It is typically a set of key=value * pairs * @ingroup GLOBUS_XIO_API * * @param config_string * The driver specific parameter string. */ /* char * config_string */ GLOBUS_XIO_SET_STRING_OPTIONS } globus_xio_handle_cmd_t; typedef enum { GLOBUS_XIO_DD_SET_OFFSET, GLOBUS_XIO_DD_GET_OFFSET } globus_xio_dd_cmd_t; typedef enum { GLOBUS_XIO_CANCEL_OPEN = 0x01, GLOBUS_XIO_CANCEL_CLOSE = 0x02, GLOBUS_XIO_CANCEL_READ = 0x04, GLOBUS_XIO_CANCEL_WRITE = 0x08 } globus_xio_cancel_t; typedef enum { GLOBUS_XIO_DEBUG_ERROR = 1, GLOBUS_XIO_DEBUG_WARNING = 2, GLOBUS_XIO_DEBUG_TRACE = 4, GLOBUS_XIO_DEBUG_INTERNAL_TRACE = 8, GLOBUS_XIO_DEBUG_INFO = 16, GLOBUS_XIO_DEBUG_STATE = 32, GLOBUS_XIO_DEBUG_INFO_VERBOSE = 64 } globus_xio_debug_levels_t; typedef struct { char * unparsed; char * resource; char * host; char * port; char * scheme; char * user; char * pass; char * subject; } globus_xio_contact_t; typedef struct globus_xio_driver_list_ent_s { globus_xio_driver_t driver; char * driver_name; char * opts; void * user_arg; globus_bool_t loaded; }globus_xio_driver_list_ent_t; EXTERN_C_END #endif globus_xio-3.6/configure.in.in0000666000076400007640000000352512121617052013411 00000000000000dnl AC_REVISION($Revision: 1.10.14.1 $) AC_INIT(Makefile.am) GLOBUS_INIT AM_PROG_LIBTOOL dnl config header goes here dnl check for -lsocket -lnsl CHECK_NEED_LNSL CHECK_NEED_LSOCKET GPT_SET_LIBS(["$EXTERNAL_LIBS -lm"]) dnl Initialize the automake rules the last argument AM_INIT_AUTOMAKE($GPT_NAME, $GPT_VERSION) dnl Build hooks for all 'builtin' drivers echo -n "Checking for builtin drivers... " XIO_BUILTIN_DIRS= XIO_BUILTIN_DOXY_DIRS= XIO_BUILTIN_LIBS= BUILTIN_EXTENSIONS_DEC= BUILTIN_EXTENSIONS_DEF= builtins=`ls builtins | grep -v CVS | grep -v Makefile` if test "X$builtins" != "X" ; then echo for builtin in $builtins ; do if test -f builtins/$builtin/Makefile.in ; then XIO_BUILTIN_DIRS="$XIO_BUILTIN_DIRS $builtin" XIO_BUILTIN_DOXY_DIRS="$XIO_BUILTIN_DOXY_DIRS ../builtins/${builtin}" lib_name="builtins/${builtin}/libglobus_xio_${builtin}_driver.la" XIO_BUILTIN_LIBS="$XIO_BUILTIN_LIBS $lib_name" BUILTIN_EXTENSIONS_DEC="${BUILTIN_EXTENSIONS_DEC}GlobusXIODeclareModule(${builtin}); " BUILTIN_EXTENSIONS_DEF="$BUILTIN_EXTENSIONS_DEF {GlobusXIOExtensionName(${builtin}), GlobusXIOMyModule(${builtin})}," echo "Including driver: $builtin" fi done else echo "none found" fi AC_SUBST(XIO_BUILTIN_DIRS) AC_SUBST(XIO_BUILTIN_LIBS) AC_SUBST(BUILTIN_EXTENSIONS_DEC) AC_SUBST(BUILTIN_EXTENSIONS_DEF) CFLAGS="$CFLAGS -DGLOBUS_BUILTIN" LAC_DOXYGEN("../ $XIO_BUILTIN_DOXY_DIRS", "*.doc", "${GLOBUS_LOCATION:-/usr}/sbin/globus-vararg-enums-doxygen-filter.pl") AC_CONFIG_HEADERS(config.h) AC_CHECK_FUNCS(sysconf) GLOBUS_FINALIZE AC_OUTPUT( Makefile pkgdata/Makefile pkgdata/pkg_data_src.gpt builtins/Makefile doxygen/Makefile doxygen/Doxyfile doxygen/Doxyfile-internal version.h extensions.h dnl NOTE: do not put anything below this line! globus_xio-3.6/Makefile.am0000666000076400007640000000363011614562634012537 00000000000000include $(top_srcdir)/globus_automake_pre include $(top_srcdir)/globus_automake_pre_top SUBDIRS=\ builtins \ . \ pkgdata \ doxygen Sources= \ globus_xio_handle.c \ globus_xio_driver.c \ globus_xio_attr.c \ globus_xio_timeout.c \ globus_xio_server.c \ globus_xio_pass.c \ globus_xio_util.c \ globus_xio_wrapblock.c \ globus_xio_system_select.c \ globus_xio_system_win32.c \ globus_i_xio_win32_complete.c \ globus_i_xio_win32_file.c \ globus_i_xio_win32_mode.c \ globus_i_xio_win32_socket.c \ globus_i_xio_system_common.c \ globus_xio_load.c include_HEADERS = \ globus_xio_types.h \ globus_xio_util.h \ globus_xio_load.h \ globus_xio_driver.h \ globus_xio.h \ globus_xio_wrapblock.h \ globus_xio_system.h noinst_HEADERS = \ globus_i_xio.h \ globus_i_xio_system_common.h lib_LTLIBRARIES = libglobus_xio.la INCLUDES = $(GPT_INCLUDES) libglobus_xio_la_SOURCES = $(Sources) libglobus_xio_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_la_LIBADD = \ $(GPT_LIB_LINKS) \ $(XIO_BUILTIN_LIBS) doc_DATA = GLOBUS_LICENSE EXTRA_DIST = \ globus_xio_system_win32.c \ globus_i_xio_win32.h \ globus_i_xio_win32_complete.c \ globus_i_xio_win32_file.c \ globus_i_xio_win32_mode.c \ globus_i_xio_win32_socket.c \ version.h.in \ extensions.h.in \ configure.in.in \ $(doc_DATA) include $(top_srcdir)/globus_automake_post include $(top_srcdir)/globus_automake_post_top globus_xio-3.6/globus_i_xio_system_common.c0000666000076400007640000005670210766024167016316 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_i_xio_system_common.h" #ifndef WIN32 #define GlobusLXIOSystemWouldBlock(err) \ (err == EAGAIN || err == EWOULDBLOCK) #else #define GlobusLXIOSystemWouldBlock(err) \ (err == EAGAIN || err == EWOULDBLOCK || err == WSAEWOULDBLOCK) #endif GlobusDebugDefine(GLOBUS_XIO_SYSTEM); globus_memory_t globus_i_xio_system_op_info_memory; globus_memory_t globus_i_xio_system_iov_memory; static globus_bool_t globus_l_xio_system_memory_initialized; int globus_i_xio_system_common_activate(void) { GlobusXIOName(globus_i_xio_system_common_activate); GlobusDebugInit(GLOBUS_XIO_SYSTEM, TRACE DATA INFO RAW); GlobusXIOSystemDebugEnter(); /* I am going to leave this memory around after deactivation. To safely * destroy them, I would need a lot more synchronization of kicked out * callbacks */ if(globus_module_activate(GLOBUS_XIO_MODULE) != GLOBUS_SUCCESS) { goto error_activate; } if(!globus_l_xio_system_memory_initialized) { globus_l_xio_system_memory_initialized = GLOBUS_TRUE; globus_memory_init( &globus_i_xio_system_op_info_memory, sizeof(globus_i_xio_system_op_info_t), 10); globus_memory_init( &globus_i_xio_system_iov_memory, sizeof(struct iovec) * 10, 10); } GlobusXIOSystemDebugExit(); return GLOBUS_SUCCESS; error_activate: GlobusXIOSystemDebugExitWithError(); GlobusDebugDestroy(GLOBUS_XIO_SYSTEM); return GLOBUS_FAILURE; } int globus_i_xio_system_common_deactivate(void) { GlobusXIOName(globus_i_xio_system_common_deactivate); GlobusXIOSystemDebugEnter(); globus_module_deactivate(GLOBUS_XIO_MODULE); GlobusXIOSystemDebugExit(); GlobusDebugDestroy(GLOBUS_XIO_SYSTEM); return GLOBUS_SUCCESS; } #ifndef WIN32 globus_result_t globus_i_xio_system_try_read( globus_xio_system_file_t fd, void * buf, globus_size_t buflen, globus_size_t * nbytes) { globus_ssize_t rc = 0; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_read); GlobusXIOSystemDebugEnterFD(fd); /* calls to this with buflen == 0 are requesting select only */ if(buflen) { do { rc = read(fd, buf, buflen); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("read", errno); goto error_errno; } } else if(rc == 0) /* what about UDP? */ { result = GlobusXIOErrorEOF(); goto error_eof; } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Read %d bytes (buflen = %d)\n", _xio_name, rc, buflen)); GlobusXIOSystemDebugRawBuffer(rc, buf); } *nbytes = rc; GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: error_eof: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_i_xio_system_try_readv( globus_xio_system_file_t fd, const globus_xio_iovec_t * iov, int iovc, globus_size_t * nbytes) { globus_ssize_t rc; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_readv); GlobusXIOSystemDebugEnterFD(fd); do { #ifdef HAVE_READV rc = readv(fd, iov, (iovc > IOV_MAX) ? IOV_MAX : iovc); #else rc = read(fd, iov[0].iov_base,iov[0].iov_len); #endif GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("readv", errno); goto error_errno; } } else if(rc == 0) { result = GlobusXIOErrorEOF(); goto error_eof; } *nbytes = rc; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Read %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawIovec(rc, iov); GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: error_eof: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } #endif globus_result_t globus_i_xio_system_try_recv( globus_xio_system_socket_t fd, void * buf, globus_size_t buflen, int flags, globus_size_t * nbytes) { globus_ssize_t rc = 0; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_recv); GlobusXIOSystemDebugEnterFD(fd); if(buflen) { do { rc = recv(fd, buf, buflen, flags); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("recv", errno); goto error_errno; } } else if(rc == 0) { result = GlobusXIOErrorEOF(); goto error_eof; } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Read %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawBuffer(rc, buf); } *nbytes = rc; GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: error_eof: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_i_xio_system_try_recvfrom( globus_xio_system_socket_t fd, void * buf, globus_size_t buflen, int flags, globus_sockaddr_t * from, globus_size_t * nbytes) { globus_ssize_t rc = 0; globus_result_t result; globus_socklen_t len; GlobusXIOName(globus_i_xio_system_try_recvfrom); GlobusXIOSystemDebugEnterFD(fd); if(buflen) { do { len = sizeof(globus_sockaddr_t); rc = recvfrom( fd, buf, buflen, flags, (struct sockaddr *) from, &len); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("recvfrom", errno); goto error_errno; } } else if(rc == 0) { result = GlobusXIOErrorEOF(); goto error_eof; } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Read %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawBuffer(rc, buf); } *nbytes = rc; GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: error_eof: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_i_xio_system_try_recvmsg( globus_xio_system_socket_t fd, struct msghdr * msghdr, int flags, globus_size_t * nbytes) { globus_ssize_t rc; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_recvmsg); GlobusXIOSystemDebugEnterFD(fd); #ifdef WIN32 { DWORD received = 0; DWORD oflags = flags; INT size = msghdr->msg_namelen; rc = WSARecvFrom( fd, (WSABUF *) msghdr->msg_iov, msghdr->msg_iovlen, &received, &oflags, msghdr->msg_name, &size, 0, 0); if(rc != 0) { GlobusXIOSystemUpdateErrno(); rc = -1; } else { rc = received; } } #elif defined(HAVE_RECVSMSG) { globus_size_t orig_iovc; orig_iovc = msghdr->msg_iovlen; msghdr->msg_iovlen = orig_iovc > IOV_MAX ? IOV_MAX : orig_iovc; do { rc = recvmsg(fd, msghdr, flags); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); msghdr->msg_iovlen = orig_iovc; } #else { /* XXX this is not an acceptable work around for udp sockets */ do { if (msghdr->msg_name) { rc = recvfrom( fd, msghdr->msg_iov[0].iov_base, msghdr->msg_iov[0].iov_len, flags, (struct sockaddr *) msghdr->msg_name, &msghdr->msg_namelen); } else { rc = recv( fd, msghdr->msg_iov[0].iov_base, msghdr->msg_iov[1].iov_len, flags); } GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); } #endif if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("recvmsg", errno); goto error_errno; } } else if(rc == 0) { result = GlobusXIOErrorEOF(); goto error_eof; } *nbytes = rc; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Read %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawIovec(rc, msghdr->msg_iov); GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: error_eof: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } #ifndef WIN32 globus_result_t globus_i_xio_system_try_write( globus_xio_system_file_t fd, void * buf, globus_size_t buflen, globus_size_t * nbytes) { globus_ssize_t rc = 0; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_write); GlobusXIOSystemDebugEnterFD(fd); /* calls to this with buflen == 0 are requesting select only */ if(buflen) { do { rc = write(fd, buf, buflen); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("write", errno); goto error_errno; } } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Wrote %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawBuffer(rc, buf); } *nbytes = rc; GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_i_xio_system_try_writev( globus_xio_system_file_t fd, const globus_xio_iovec_t * iov, int iovc, globus_size_t * nbytes) { globus_ssize_t rc; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_writev); GlobusXIOSystemDebugEnterFD(fd); do { #ifdef HAVE_WRITEV rc = writev(fd, iov, (iovc > IOV_MAX) ? IOV_MAX : iovc); #else rc = write(fd, iov[0].iov_base, iov[0].iov_len); #endif GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("writev", errno); goto error_errno; } } *nbytes = rc; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Wrote %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawIovec(rc, iov); GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } #endif globus_result_t globus_i_xio_system_try_send( globus_xio_system_socket_t fd, void * buf, globus_size_t buflen, int flags, globus_size_t * nbytes) { globus_ssize_t rc = 0; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_send); GlobusXIOSystemDebugEnterFD(fd); if(buflen) { do { rc = send(fd, buf, buflen, flags); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("send", errno); goto error_errno; } } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Wrote %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawBuffer(rc, buf); } *nbytes = rc; GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_i_xio_system_try_sendto( globus_xio_system_socket_t fd, void * buf, globus_size_t buflen, int flags, const globus_sockaddr_t * to, globus_size_t * nbytes) { globus_ssize_t rc = 0; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_sendto); GlobusXIOSystemDebugEnterFD(fd); if(buflen) { do { rc = sendto( fd, buf, buflen, flags, (struct sockaddr *) to, GlobusLibcSockaddrLen(to)); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("sendto", errno); goto error_errno; } } GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Wrote %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawBuffer(rc, buf); } *nbytes = rc; GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } globus_result_t globus_i_xio_system_try_sendmsg( globus_xio_system_socket_t fd, struct msghdr * msghdr, int flags, globus_size_t * nbytes) { globus_ssize_t rc; globus_result_t result; GlobusXIOName(globus_i_xio_system_try_sendmsg); GlobusXIOSystemDebugEnterFD(fd); #ifdef WIN32 { DWORD sent = 0; rc = WSASendTo( fd, (WSABUF *) msghdr->msg_iov, msghdr->msg_iovlen, &sent, flags, msghdr->msg_name, msghdr->msg_namelen, 0, 0); if(rc != 0) { GlobusXIOSystemUpdateErrno(); rc = -1; } else { rc = sent; } } #elif defined(HAVE_SENDMSG) { globus_size_t orig_iovc; orig_iovc = msghdr->msg_iovlen; msghdr->msg_iovlen = orig_iovc > IOV_MAX ? IOV_MAX : orig_iovc; do { rc = sendmsg(fd, msghdr, flags); GlobusXIOSystemUpdateErrno(); } while(rc < 0 && errno == EINTR); msghdr->msg_iovlen = orig_iovc; } #else { /* XXX this is not an acceptable work around for udp sockets */ do { if (msghdr->msg_name) { rc = sendto( fd, msghdr->msg_iov[0].iov_base, msghdr->msg_iov[0].iov_len, flags, (struct sockaddr *) msghdr->msg_name, msghdr->msg_namelen); } else { rc = send( fd, msghdr->msg_iov[0].iov_base, msghdr->msg_iov[0].iov_len, flags); } GlobusXIOSystemUpdateErrno(); } while (rc < 0 && errno == EINTR); } #endif if(rc < 0) { if(GlobusLXIOSystemWouldBlock(errno)) { rc = 0; } else { result = GlobusXIOErrorSystemError("sendmsg", errno); goto error_errno; } } *nbytes = rc; GlobusXIOSystemDebugPrintf( GLOBUS_I_XIO_SYSTEM_DEBUG_DATA, ("[%s] Wrote %d bytes\n", _xio_name, rc)); GlobusXIOSystemDebugRawIovec(rc, msghdr->msg_iov); GlobusXIOSystemDebugExitFD(fd); return GLOBUS_SUCCESS; error_errno: *nbytes = 0; GlobusXIOSystemDebugExitWithErrorFD(fd); return result; } #ifndef WIN32 globus_result_t globus_i_xio_system_file_try_read( globus_xio_system_file_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t * nbytes) { globus_result_t result; GlobusXIOName(globus_i_xio_system_file_try_read); GlobusXIOSystemDebugEnter(); if(iovc == 1) { result = globus_i_xio_system_try_read( handle, iov->iov_base, iov->iov_len, nbytes); } else { result = globus_i_xio_system_try_readv(handle, iov, iovc, nbytes); } GlobusXIOSystemDebugExit(); return result; } globus_result_t globus_i_xio_system_file_try_write( globus_xio_system_file_t handle, const globus_xio_iovec_t * iov, int iovc, globus_size_t * nbytes) { globus_result_t result; GlobusXIOName(globus_i_xio_system_file_try_write); GlobusXIOSystemDebugEnter(); if(iovc == 1) { result = globus_i_xio_system_try_write( handle, iov->iov_base, iov->iov_len, nbytes); } else { result = globus_i_xio_system_try_writev(handle, iov, iovc, nbytes); } GlobusXIOSystemDebugExit(); return result; } #endif globus_result_t globus_i_xio_system_socket_try_read( globus_xio_system_socket_t handle, const globus_xio_iovec_t * iov, int iovc, int flags, globus_sockaddr_t * from, globus_size_t * nbytes) { globus_result_t result; GlobusXIOName(globus_i_xio_system_socket_try_read); GlobusXIOSystemDebugEnter(); #if !defined(WIN32) && !defined(TARGET_ARCH_NETOS) /* posix can use readv for sockets */ if(!flags && !from && iovc > 1) { result = globus_i_xio_system_try_readv(handle, iov, iovc, nbytes); } else #endif if(iovc == 1) { if(from) { result = globus_i_xio_system_try_recvfrom( handle, iov->iov_base, iov->iov_len, flags, from, nbytes); } else { result = globus_i_xio_system_try_recv( handle, iov->iov_base, iov->iov_len, flags, nbytes); } } else { struct msghdr msghdr; memset(&msghdr, 0, sizeof(msghdr)); msghdr.msg_iov = (struct iovec *) iov; msghdr.msg_iovlen = iovc; if(from) { msghdr.msg_name = from; msghdr.msg_namelen = sizeof(globus_sockaddr_t); } result = globus_i_xio_system_try_recvmsg( handle, &msghdr, flags, nbytes); } GlobusXIOSystemDebugExit(); return result; } globus_result_t globus_i_xio_system_socket_try_write( globus_xio_system_socket_t handle, const globus_xio_iovec_t * iov, int iovc, int flags, globus_sockaddr_t * to, globus_size_t * nbytes) { globus_result_t result; GlobusXIOName(globus_i_xio_system_socket_try_write); GlobusXIOSystemDebugEnter(); #if !defined(WIN32) && !defined(TARGET_ARCH_NETOS) /* posix can use writev for sockets */ if(!flags && !to && iovc > 1) { result = globus_i_xio_system_try_writev(handle, iov, iovc, nbytes); } else #endif if(iovc == 1) { if(to) { result = globus_i_xio_system_try_sendto( handle, iov->iov_base, iov->iov_len, flags, to, nbytes); } else { result = globus_i_xio_system_try_send( handle, iov->iov_base, iov->iov_len, flags, nbytes); } } else { struct msghdr msghdr; memset(&msghdr, 0, sizeof(msghdr)); msghdr.msg_iov = (struct iovec *) iov; msghdr.msg_iovlen = iovc; if(to) { msghdr.msg_name = (struct sockaddr *) to; msghdr.msg_namelen = GlobusLibcSockaddrLen(to); } result = globus_i_xio_system_try_sendmsg( handle, &msghdr, flags, nbytes); } GlobusXIOSystemDebugExit(); return result; } globus_xio-3.6/globus_automake_post_top0000644000076400007640000000063512225575522015533 00000000000000EXTRA_DIST += bootstrap \ globus_automake_pre \ globus_automake_post \ globus_automake_pre_top \ globus_automake_post_top \ dirt.sh \ gptdata.sh dist-hook: $(GPT_LOCATION)/sbin/gpt_create_automake_rules --excludes=doxygen -srcdir=$(top_distdir) DISTCLEANFILES = globus-script-initializer globus-perl-initializer \ globus-script-libdir-choice globus-perl-libdir-choice globus_xio-3.6/globus_xio_wrapblock.h0000666000076400007640000000314210405464615015065 00000000000000#if !defined(GLOBUS_XIO_WRAPBLOCK_H) #define GLOBUS_XIO_WRAPBLOCK_H 1 #include "globus_xio.h" EXTERN_C_BEGIN typedef globus_result_t (*globus_xio_wrapblock_open_func_t)( const globus_xio_contact_t * contact_info, void * driver_link, void * driver_attr, void ** driver_handle); typedef globus_result_t (*globus_xio_wrapblock_write_func_t)( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_size_t * nbytes); typedef globus_result_t (*globus_xio_wrapblock_read_func_t)( void * driver_specific_handle, const globus_xio_iovec_t * iovec, int iovec_count, globus_size_t * nbytes); typedef globus_result_t (*globus_xio_wrapblock_close_func_t)( void * driver_specific_handle, void * attr); typedef globus_result_t (*globus_xio_wrapblock_accept_func_t)( void * driver_server, void ** out_link); globus_result_t globus_xio_wrapblock_init( globus_xio_driver_t driver, globus_xio_wrapblock_open_func_t open, globus_xio_wrapblock_close_func_t close, globus_xio_wrapblock_read_func_t read, globus_xio_wrapblock_write_func_t write, globus_xio_wrapblock_accept_func_t accept); EXTERN_C_END #endif globus_xio-3.6/config.h.in0000664000076400007640000000300612225614600012507 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ #undef HAVE_SYSCONF /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION globus_xio-3.6/ltmain.sh0000644000076400007640000060342611312032604012310 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.22 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) extracted_serial=`expr $extracted_serial + 1` my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. # for path in $notinst_path; do # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` # done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: globus_xio-3.6/globus_i_xio.h0000666000076400007640000010663711374254655013355 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(GLOBUS_I_XIO_H) #define GLOBUS_I_XIO_H 1 #include "globus_xio.h" #include "globus_xio_driver.h" #include "globus_common.h" #include "globus_xio_util.h" #include "globus_xio_load.h" #define GLOBUS_XIO_ATTR_ARRAY_BASE_SIZE 16 #define GLOBUS_XIO_HANDLE_DEFAULT_OPERATION_COUNT 4 /*************************************************************************** * internal macros * --------------- **************************************************************************/ #define GlobusXIOCurrentBlockedThread(blocked_thread) \ if (globus_i_am_only_thread()) \ { \ blocked_thread.thread = globus_thread_self(); \ } \ else \ { \ blocked_thread.depth = globus_callback_space_get_depth( \ GLOBUS_CALLBACK_GLOBAL_SPACE); \ } #define GlobusXIOBlockedThreadMatchesCurrentThread(a) \ (globus_i_am_only_thread() \ ? (a.depth == \ globus_callback_space_get_depth(GLOBUS_CALLBACK_GLOBAL_SPACE)) \ : globus_thread_equal(a.thread, globus_thread_self())) GlobusDebugDeclare(GLOBUS_XIO); #define GlobusXIODebugPrintf(level, message) \ GlobusDebugPrintf(GLOBUS_XIO, level, message) #define GlobusXIOOpInc(_in_op) \ do \ { \ (_in_op)->ref++; \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_STATE, \ ("[%s:%d] Op @ 0x%x ref increased to %d:\n", _xio_name, __LINE__, \ (_in_op), (_in_op)->ref)); \ } while(0) #define GlobusXIOOpDec(_in_op) \ do \ { \ (_in_op)->ref--; \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_STATE, \ ("[%s:%d] Op @ 0x%x ref decreased to %d:\n", _xio_name, __LINE__, \ (_in_op), (_in_op)->ref)); \ } while(0) #define GlobusXIOObjToResult(_in_obj) \ (_in_obj == NULL ? GLOBUS_SUCCESS : globus_error_put(_in_obj)) #define GlobusXIOResultToObj(_in_res) \ (_in_res == GLOBUS_SUCCESS ? NULL : globus_error_get(_in_res)) #define GlobusXIOHandleStateChange(_h, _new) \ do \ { \ globus_i_xio_handle_t * _l_h; \ \ _l_h = (_h); \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_STATE, \ ("[%s:%d] Handle @ 0x%x state change:\n" \ " From:%s\n" \ " to: %s\n", \ _xio_name, \ __LINE__, \ _l_h, \ globus_i_xio_handle_state_name_table[_l_h->state], \ globus_i_xio_handle_state_name_table[_new])); \ _l_h->state = _new; \ } while(0) #define GlobusXIOOpStateChange(_op, _new) \ do \ { \ globus_i_xio_op_t * _l_op; \ \ _l_op = (_op); \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_STATE, \ ("[%s:%d] Op @ 0x%x state change:\n" \ " From:%s\n" \ " to: %s\n", \ _xio_name, \ __LINE__, \ _l_op, \ globus_i_xio_op_state_name_table[_l_op->state], \ globus_i_xio_op_state_name_table[_new])); \ _l_op->state = _new; \ } while(0) #define GlobusXIOContextStateChange(_c, _new) \ do \ { \ globus_i_xio_context_entry_t * _l_context; \ \ _l_context = (_c); \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_STATE, \ ("[%s:%d] Context @ 0x%x state change:\n" \ " From:%s\n" \ " to: %s\n", \ _xio_name, \ __LINE__, \ _l_context, \ globus_i_xio_context_state_name_table[_l_context->state], \ globus_i_xio_context_state_name_table[_new])); \ _l_context->state = _new; \ } while(0) #define GlobusXIODebugEnter() \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_TRACE, \ ("[%s] Entering\n", _xio_name)) #define GlobusXIODebugExit() \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_TRACE, \ ("[%s] Exiting\n", _xio_name)) #define GlobusXIODebugExitWithError() \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_TRACE, \ ("[%s] Exiting with error\n", _xio_name)) #define GlobusXIODebugInternalEnter() \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_INTERNAL_TRACE, \ ("[%s] I Entering\n", _xio_name)) #define GlobusXIODebugInternalExit() \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_INTERNAL_TRACE, \ ("[%s] I Exiting\n", _xio_name)) #define GlobusXIODebugInternalExitWithError() \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_INTERNAL_TRACE, \ ("[%s] I Exiting with error\n", _xio_name)) #define GlobusXIODebugInregisterOneShot() \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_INFO, \ ("[%s] Registering one shot due to in_register.\n", _xio_name)) #define GlobusXIODebugDelayedFinish() \ GlobusXIODebugPrintf( \ GLOBUS_XIO_DEBUG_INFO, \ ("[%s] Delaying finish due to in_register and blocking op.\n", \ _xio_name)) #define GlobusXIOOperationCreate(_out_op, _in_c) \ do \ { \ globus_i_xio_op_t * _X_op; \ globus_i_xio_context_t * _X_c; \ \ _X_c = (_in_c); \ _X_op = (globus_i_xio_op_t * ) \ globus_memory_pop_node(&_X_c->op_memory); \ if(_X_op != NULL) \ { \ /* sets deliver_op to NONE */ \ memset(_X_op, '\0', sizeof(globus_i_xio_op_t) + \ (sizeof(globus_i_xio_op_entry_t) * (_X_c->stack_size - 1))); \ _X_op->_op_context = _X_c; \ _X_op->stack_size = _X_c->stack_size; \ _X_op->progress = GLOBUS_TRUE; \ _X_op->_op_ent_offset = -1; \ } \ _out_op = _X_op; \ } while(0) /* if index == the level at which a cancel was requested then we reset the * canceled flag for the operation. */ #define GlobusIXIOClearCancel(op) \ do \ { \ globus_i_xio_op_t * _op = (op); \ /* op->ndx is source_ndx + 1, canceled is source_ndx + 2 */ \ /* so, source_ndx == op->ndx + 1 */ \ /* see globus_i_xio_operation_cancel */ \ if(_op->canceled) \ { \ globus_mutex_lock(&_op->_op_context->cancel_mutex); \ if(_op->canceled == _op->ndx + 1) \ { \ _op->canceled = 0; \ } \ globus_mutex_unlock(&_op->_op_context->cancel_mutex); \ } \ } while(0) /*************************************************************************** * state and type enumerations * --------------------------- **************************************************************************/ /* forward declare for setting cred */ typedef struct gss_cred_id_desc_struct * gss_cred_id_t; extern char * globus_i_xio_context_state_name_table[]; typedef enum globus_i_xio_context_state_e { GLOBUS_XIO_CONTEXT_STATE_NONE, GLOBUS_XIO_CONTEXT_STATE_OPENING, GLOBUS_XIO_CONTEXT_STATE_OPEN, GLOBUS_XIO_CONTEXT_STATE_OPEN_FAILED, GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED, GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED, GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING, GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING, GLOBUS_XIO_CONTEXT_STATE_CLOSING, GLOBUS_XIO_CONTEXT_STATE_OPENING_AND_CLOSING, GLOBUS_XIO_CONTEXT_STATE_CLOSED } globus_i_xio_context_state_t; extern char * globus_i_xio_handle_state_name_table[]; typedef enum globus_i_xio_handle_state_e { GLOBUS_XIO_HANDLE_STATE_NONE, GLOBUS_XIO_HANDLE_STATE_CLIENT, GLOBUS_XIO_HANDLE_STATE_ACCEPTED, GLOBUS_XIO_HANDLE_STATE_OPENING, GLOBUS_XIO_HANDLE_STATE_OPENING_FAILED, GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING, GLOBUS_XIO_HANDLE_STATE_OPEN, GLOBUS_XIO_HANDLE_STATE_OPEN_FAILED, GLOBUS_XIO_HANDLE_STATE_CLOSING, GLOBUS_XIO_HANDLE_STATE_CLOSED } globus_i_xio_handle_state_t; extern char * globus_i_xio_op_state_name_table[]; typedef enum globus_i_xio_op_state_e { GLOBUS_XIO_OP_STATE_NONE, GLOBUS_XIO_OP_STATE_OPERATING, GLOBUS_XIO_OP_STATE_TIMEOUT_PENDING, GLOBUS_XIO_OP_STATE_FINISH_WAITING, GLOBUS_XIO_OP_STATE_FINISHED } globus_i_xio_op_state_t; typedef enum globus_xio_server_state_e { GLOBUS_XIO_SERVER_STATE_NONE, GLOBUS_XIO_SERVER_STATE_OPEN, GLOBUS_XIO_SERVER_STATE_ACCEPTING, GLOBUS_XIO_SERVER_STATE_COMPLETING, GLOBUS_XIO_SERVER_STATE_CLOSE_PENDING, GLOBUS_XIO_SERVER_STATE_CLOSING, GLOBUS_XIO_SERVER_STATE_CLOSED } globus_xio_server_state_t; /*************************************************************************** * Internally exposed data structures * ---------------------------------- **************************************************************************/ struct globus_i_xio_context_s; struct globus_i_xio_op_s; typedef struct globus_i_xio_monitor_s { int count; } globus_i_xio_monitor_t; void globus_i_xio_monitor_init( globus_i_xio_monitor_t * monitor); void globus_i_xio_monitor_destroy( globus_i_xio_monitor_t * monitor); typedef struct globus_i_xio_attr_ent_s { globus_xio_driver_t driver; void * driver_data; } globus_i_xio_attr_ent_t; typedef struct globus_i_xio_attr_s { globus_bool_t unloaded; globus_xio_timeout_callback_t open_timeout_cb; globus_reltime_t open_timeout_period; globus_xio_timeout_callback_t read_timeout_cb; globus_reltime_t read_timeout_period; globus_xio_timeout_callback_t write_timeout_cb; globus_reltime_t write_timeout_period; globus_xio_timeout_callback_t close_timeout_cb; globus_reltime_t close_timeout_period; globus_xio_timeout_server_callback_t accept_timeout_cb; globus_reltime_t accept_timeout_period; globus_bool_t cancel_open; globus_bool_t cancel_close; globus_bool_t cancel_read; globus_bool_t cancel_write; globus_bool_t no_cancel; void * timeout_arg; gss_cred_id_t user_open_cred; char * user_open_sbj; char * user_open_username; char * user_open_pw; globus_callback_space_t space; int max; int ndx; globus_i_xio_attr_ent_t * entry; } globus_i_xio_attr_t; typedef struct globus_i_xio_stack_s { int size; globus_list_t * driver_stack; globus_xio_driver_t pushing_driver; } globus_i_xio_stack_t; typedef struct globus_i_xio_server_entry_s { globus_xio_driver_t driver; void * server_handle; } globus_i_xio_server_entry_t; /* * */ typedef struct globus_i_xio_server_s { globus_i_xio_monitor_t * sd_monitor; globus_xio_server_state_t state; globus_xio_timeout_server_callback_t accept_timeout; globus_reltime_t accept_timeout_period; struct globus_i_xio_op_s * op; globus_xio_server_callback_t cb; void * user_arg; int outstanding_operations; int ref; globus_mutex_t mutex; globus_callback_space_t space; globus_bool_t blocking; char * contact_string; int stack_size; globus_i_xio_server_entry_t entry[1]; } globus_i_xio_server_t; typedef struct globus_i_xio_handle_s { globus_i_xio_monitor_t * sd_monitor; globus_list_t * cb_list; int ref; struct globus_i_xio_context_s * context; globus_i_xio_handle_state_t state; /* since only 1 open or close can be outstanding at a time we don't need a list */ globus_list_t * write_op_list; globus_list_t * read_op_list; struct globus_i_xio_op_s * open_op; struct globus_i_xio_op_s * close_op; void * timeout_arg; globus_callback_space_t space; globus_xio_timeout_callback_t open_timeout_cb; globus_reltime_t open_timeout_period; globus_xio_timeout_callback_t read_timeout_cb; globus_reltime_t read_timeout_period; globus_xio_timeout_callback_t write_timeout_cb; globus_reltime_t write_timeout_period; globus_xio_timeout_callback_t close_timeout_cb; globus_reltime_t close_timeout_period; } globus_i_xio_handle_t; /* * represents an entry in the array of open handles. * * each entry is maped to a driver in the stack */ typedef struct globus_i_xio_context_entry_s { globus_xio_driver_t driver; void * driver_handle; /* each level must implement the entire state machine */ globus_i_xio_context_state_t state; int outstanding_operations; int read_operations; int eof_operations; int pending_reads; /* is this hacky? */ globus_bool_t close_started; struct globus_i_xio_op_s * open_op; struct globus_i_xio_op_s * close_op; globus_list_t * eof_op_list; globus_fifo_t pending_read_queue; struct globus_i_xio_context_s * whos_my_daddy; } globus_i_xio_context_entry_t; /* * a stretchy array */ typedef struct globus_i_xio_context_s { /* handle has a reference and every entry has a reference */ int ref; int stack_size; globus_memory_t op_memory; globus_mutex_t mutex; globus_mutex_t cancel_mutex; globus_i_xio_context_entry_t entry[1]; } globus_i_xio_context_t; /* MACROS for accessing the op_entry structure unin elements */ #define _op_ent_data_cb type_u.handle_s.data_cb #define _op_ent_wait_for type_u.handle_s.wait_for_bytes #define _op_ent_offset type_u.handle_s.offset #define _op_ent_nbytes type_u.handle_s.nbytes #define _op_ent_iovec type_u.handle_s.iovec #define _op_ent_iovec_count type_u.handle_s.iovec_count #define _op_ent_fake_iovec type_u.handle_s.fake_iovec /* * represents a entry in an array of operations. each entry * is mapped to a driver at the same index. */ typedef struct globus_i_xio_op_entry_s { /* callback info arrays */ globus_xio_operation_type_t type; globus_xio_driver_callback_t cb; void * user_arg; union { /* handle op entries */ struct { globus_xio_driver_data_callback_t data_cb; globus_size_t wait_for_bytes; globus_size_t nbytes; globus_xio_iovec_t * iovec; int iovec_count; globus_xio_iovec_t * fake_iovec; } handle_s; } type_u; globus_bool_t in_register; globus_bool_t is_limited; void * dd; void * link; void * open_attr; void * close_attr; int prev_ndx; int next_ndx; globus_xio_operation_type_t * deliver_type; } globus_i_xio_op_entry_t; #define _op_data_cb data_cb #define _op_iovec_cb iovec_cb #define _op_cb callback_u.cb #define _op_accept_cb callback_u.accept_cb #define _op_handle type_u.handle_s.handle #define _op_iovec type_u.handle_s.iovec #define _op_iovec_count type_u.handle_s.iovec_count #define _op_mem_iovec type_u.handle_s.mem_iovec #define _op_context type_u.handle_s.context #define _op_nbytes type_u.handle_s.nbytes #define _op_wait_for type_u.handle_s.wait_for #define _op_handle_timeout_cb type_u.handle_s.timeout_cb #define _op_server type_u.server_s.server #define _op_server_timeout_cb type_u.server_s.timeout_cb /** * Information about the what thread is being blocked by a callback. In the * non-threaded case, this will be the callback_depth, otherwise the thread_id */ typedef union { globus_thread_t thread; int depth; } globus_i_xio_blocked_thread_t; /* * represents a requested io operation (open close read or write). */ typedef struct globus_i_xio_op_s { /* operation type */ globus_xio_operation_type_t type; globus_i_xio_op_state_t state; globus_bool_t is_user_dd; /* * user callbacks. only 1 will be used per operation */ union { globus_xio_callback_t cb; globus_xio_accept_callback_t accept_cb; }callback_u; globus_xio_data_callback_t data_cb; globus_xio_iovec_callback_t iovec_cb; void * user_arg; /* * Union operation members that will not overlap together */ union { /* handle op stuff */ struct { globus_i_xio_handle_t * handle; globus_xio_iovec_t * iovec; int iovec_count; globus_xio_iovec_t mem_iovec; globus_size_t nbytes; /* convience pointer, really owned by handle */ globus_i_xio_context_t * context; /* data descriptor */ globus_size_t wait_for; globus_off_t offset; globus_xio_timeout_callback_t timeout_cb; } handle_s; /* server op stuff */ struct { globus_i_xio_server_t * server; globus_xio_timeout_server_callback_t timeout_cb; } server_s; } type_u; /* flag to determine if timeout should happen */ globus_bool_t progress; /* reference count for destruction */ int ref; /* members for cancelation */ globus_xio_driver_cancel_callback_t cancel_cb; void * cancel_arg; int canceled; globus_bool_t block_timeout; globus_bool_t restarted; globus_bool_t blocking; globus_i_xio_blocked_thread_t blocked_thread; globus_bool_t finished_delayed; /* just stash away the cred to open so that the driver can interigate it. */ gss_cred_id_t user_open_cred; char * user_open_sbj; char * user_open_username; char * user_open_pw; /* result code saved in op for kickouts */ globus_object_t * cached_obj; /* size of the arrays */ int stack_size; /* current index in the driver stack */ int ndx; /* entry for each thing driver in the stack */ globus_i_xio_op_entry_t entry[1]; } globus_i_xio_op_t; typedef struct globus_i_xio_driver_s { char * name; void * user_data; void * wrap_data; /* these are filled in by the driver loader */ globus_xio_driver_hook_t * hook; globus_extension_handle_t extension_handle; globus_bool_t extension_activated; globus_xio_string_cntl_table_t * string_table; /* * main io interface functions */ globus_xio_driver_transform_open_t transform_open_func; globus_xio_driver_transport_open_t transport_open_func; globus_xio_driver_close_t close_func; globus_xio_driver_read_t read_func; globus_xio_driver_write_t write_func; globus_xio_driver_handle_cntl_t handle_cntl_func; globus_xio_driver_push_driver_t push_driver_func; /* * server */ globus_xio_driver_server_init_t server_init_func; globus_xio_driver_server_accept_t server_accept_func; globus_xio_driver_server_destroy_t server_destroy_func; globus_xio_driver_server_cntl_t server_cntl_func; globus_xio_driver_link_cntl_t link_cntl_func; globus_xio_driver_link_destroy_t link_destroy_func; /* * driver attr functions. All or none may be NULL * * data descriptor is done with attr */ globus_xio_driver_attr_init_t attr_init_func; globus_xio_driver_attr_copy_t attr_copy_func; globus_xio_driver_attr_cntl_t attr_cntl_func; globus_xio_driver_attr_destroy_t attr_destroy_func; } globus_i_xio_driver_t; /* * wrapper struct */ typedef struct globus_i_xio_blocking_s { globus_mutex_t mutex; globus_cond_t cond; globus_bool_t done; globus_size_t nbytes; globus_i_xio_op_t * op; globus_xio_handle_t accepted_handle; globus_xio_data_descriptor_t data_desc; globus_object_t * error_obj; } globus_i_xio_blocking_t; typedef struct globus_i_xio_restart_s { globus_i_xio_op_t * op; globus_bool_t restarted; } globus_i_xio_restart_t; globus_i_xio_blocking_t * globus_i_xio_blocking_alloc(); void globus_i_xio_blocking_destroy( globus_i_xio_blocking_t * info); /************************************************************************* * internal function signatures ************************************************************************/ globus_result_t globus_i_xio_server_close( globus_xio_server_t xio_server, globus_xio_server_callback_t cb, void * user_arg); void globus_l_xio_driver_purge_read_eof( globus_i_xio_context_entry_t * my_context); void globus_l_xio_driver_op_write_kickout( void * user_arg); void globus_l_xio_driver_op_read_kickout( void * user_arg); globus_result_t globus_i_xio_driver_start_close( globus_i_xio_op_t * op, globus_bool_t can_fail); void globus_l_xio_driver_op_close_kickout( void * user_arg); void globus_l_xio_driver_op_accept_kickout( void * user_arg); void globus_l_xio_driver_open_op_kickout( void * user_arg); void globus_i_xio_driver_resume_op( globus_i_xio_op_t * op); /* * time stuff */ typedef globus_bool_t (*globus_i_xio_timer_cb_t)( void * datum); typedef struct globus_i_xio_op_timer_s { globus_reltime_t minimal_delay; globus_mutex_t mutex; globus_cond_t cond; globus_list_t * op_list; globus_bool_t running; globus_callback_handle_t periodic_handle; } globus_i_xio_timer_t; void globus_i_xio_timer_init( globus_i_xio_timer_t * timer); void globus_i_xio_timer_destroy( globus_i_xio_timer_t * timer); void globus_i_xio_timer_register_timeout( globus_i_xio_timer_t * timer, void * datum, globus_bool_t * progress_ptr, globus_i_xio_timer_cb_t timeout_cb, globus_reltime_t * timeout); globus_bool_t globus_i_xio_timer_unregister_timeout( globus_i_xio_timer_t * timer, void * datum); globus_i_xio_context_t * globus_i_xio_context_create( int stack_size); void globus_i_xio_context_destroy( globus_i_xio_context_t * xio_context); void globus_i_xio_will_block_cb( int space, globus_thread_callback_index_t ndx, void * user_args); void globus_i_xio_pass_failed( globus_i_xio_op_t * op, globus_i_xio_context_entry_t * my_context, globus_bool_t * close, globus_bool_t * destroy_handle); void globus_i_xio_handle_destroy( globus_i_xio_handle_t * handle); void globus_i_xio_handle_dec( globus_i_xio_handle_t * handle, globus_bool_t * destroy_handle); void globus_i_xio_op_destroy( globus_i_xio_op_t * op, globus_bool_t * destroy_handle); globus_result_t globus_i_xio_repass_write( globus_i_xio_op_t * op); globus_result_t globus_i_xio_repass_read( globus_i_xio_op_t * op); void globus_i_xio_register_oneshot( globus_i_xio_handle_t * handle, globus_callback_func_t cb, void * user_arg, globus_callback_space_t space); typedef struct globus_i_xio_space_info_s { globus_bool_t unregister; globus_i_xio_handle_t * handle; globus_callback_handle_t ch; globus_callback_func_t func; void * user_arg; } globus_i_xio_space_info_t; void globus_i_xio_close_handles( globus_xio_driver_t driver); globus_result_t globus_i_xio_operation_cancel( globus_i_xio_op_t * op, int source_ndx); void globus_i_xio_driver_deliver_op( globus_i_xio_op_t * op, int ndx, globus_xio_operation_type_t deliver_type); void globus_xio_driver_open_delivered( globus_xio_operation_t in_op, int in_ndx, globus_xio_operation_type_t * deliver_type); void globus_xio_driver_write_delivered( globus_xio_operation_t in_op, int in_ndx, globus_xio_operation_type_t * deliver_type); void globus_xio_driver_read_delivered( globus_xio_operation_t op, int in_ndx, globus_xio_operation_type_t * deliver_type); globus_result_t globus_i_xio_driver_dd_cntl( globus_i_xio_op_t * op, globus_xio_driver_t driver, globus_xio_operation_type_t type, int cmd, va_list ap); globus_result_t globus_i_xio_driver_handle_cntl( globus_i_xio_context_t * context, int start_ndx, globus_xio_driver_t driver, int cmd, va_list ap); globus_result_t globus_i_xio_driver_attr_cntl( globus_i_xio_attr_t * attr, globus_xio_driver_t driver, int cmd, va_list ap); globus_result_t globus_i_xio_string_cntl_parser( const char * env_str, globus_xio_string_cntl_table_t * table, void * attr, globus_xio_driver_attr_cntl_t attr_func); extern globus_i_xio_timer_t globus_i_xio_timeout_timer; extern globus_list_t * globus_i_xio_outstanding_handles_list; extern globus_list_t * globus_i_xio_outstanding_servers_list; extern globus_list_t * globus_i_xio_outstanding_attrs_list; extern globus_list_t * globus_i_xio_outstanding_dds_list; extern globus_mutex_t globus_i_xio_mutex; extern globus_cond_t globus_i_xio_cond; #endif /* GLOBUS_I_XIO_H */ globus_xio-3.6/globus_xio_attr.c0000666000076400007640000011570711374254655014070 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_common.h" #include "globus_i_xio.h" globus_list_t * globus_i_xio_outstanding_attrs_list; globus_list_t * globus_i_xio_outstanding_dds_list; /******************************************************************* * internal functions ******************************************************************/ /******************************************************************* * api functions * ------------- * * In these we just check parameters, allocate memory and call the * internal functions. ******************************************************************/ /* * */ globus_result_t globus_xio_attr_init( globus_xio_attr_t * attr) { globus_result_t res; globus_i_xio_attr_t * xio_attr; GlobusXIOName(globus_xio_attr_init); GlobusXIODebugEnter(); if(attr == NULL) { res = GlobusXIOErrorParameter("attr"); goto err; } /* allocate the attr */ xio_attr = (globus_i_xio_attr_t *) globus_calloc(sizeof(globus_i_xio_attr_t), 1); if(xio_attr == NULL) { res = GlobusXIOErrorMemory("attr"); goto err; } xio_attr->entry = (globus_i_xio_attr_ent_t *) globus_calloc(sizeof(globus_i_xio_attr_ent_t) * GLOBUS_XIO_ATTR_ARRAY_BASE_SIZE, 1); if(xio_attr->entry == NULL) { *attr = GLOBUS_NULL; globus_free(xio_attr); res = GlobusXIOErrorMemory("attr->entry"); goto err; } /* zero it out */ xio_attr->max = GLOBUS_XIO_ATTR_ARRAY_BASE_SIZE; xio_attr->space = GLOBUS_CALLBACK_GLOBAL_SPACE; globus_mutex_lock(&globus_i_xio_mutex); { globus_list_insert(&globus_i_xio_outstanding_attrs_list, xio_attr); } globus_mutex_unlock(&globus_i_xio_mutex); *attr = xio_attr; GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_xio_driver_list_ent_t * globus_xio_driver_list_find_driver( globus_list_t * driver_list, const char * driver_name) { globus_xio_driver_list_ent_t * ent; globus_list_t * list; for(list = driver_list; !globus_list_empty(list); list = globus_list_rest(list)) { ent = (globus_xio_driver_list_ent_t *) globus_list_first(list); if(strcmp(ent->driver_name, driver_name) == 0) { return ent; } } return NULL; } void globus_xio_driver_list_destroy( globus_list_t * driver_list, globus_bool_t unload) { globus_xio_driver_list_ent_t * ent; globus_list_t * list; for(list = driver_list; !globus_list_empty(list); list = globus_list_rest(list)) { ent = (globus_xio_driver_list_ent_t *) globus_list_first(list); if(ent->driver_name != NULL) { globus_free(ent->driver_name); } if(ent->opts != NULL) { globus_free(ent->opts); } if(unload) { globus_xio_driver_unload(ent->driver); } globus_free(ent); } } globus_result_t globus_xio_driver_list_to_stack_attr( globus_list_t * driver_list, globus_xio_stack_t stack, globus_xio_attr_t attr) { globus_xio_driver_list_ent_t * ent; globus_list_t * list; for(list = driver_list; !globus_list_empty(list); list = globus_list_rest(list)) { ent = (globus_xio_driver_list_ent_t *) globus_list_first(list); globus_xio_stack_push_driver(stack, ent->driver); if(ent->opts != NULL) { /* ignore error */ globus_xio_attr_cntl( attr, ent->driver, GLOBUS_XIO_SET_STRING_OPTIONS, ent->opts); } } return GLOBUS_SUCCESS; } globus_result_t globus_xio_driver_safe_table_from_string( char * driver_string, globus_hashtable_t * safe_table) { globus_result_t result; globus_xio_driver_list_ent_t * d_ent; globus_list_t * driver_list = NULL; /* take advantage of xio function to load drivers */ result = globus_xio_driver_list_from_string( driver_string, &driver_list, NULL); if(result != GLOBUS_SUCCESS) { goto error; } while(!globus_list_empty(driver_list)) { d_ent = (globus_xio_driver_list_ent_t *) globus_list_remove(&driver_list, driver_list); globus_hashtable_insert(safe_table, d_ent->driver_name, d_ent); } return GLOBUS_SUCCESS; error: return result; } globus_result_t globus_xio_driver_list_create_ent( const char * driver_desc, globus_xio_driver_t driver_in, globus_bool_t load, globus_xio_driver_list_ent_t ** ent_out) { globus_xio_driver_t driver; globus_xio_driver_list_ent_t * list_ent; char * driver_name; char * opts; globus_result_t result; driver_name = strdup(driver_desc); opts = strchr(driver_name, ':'); if(opts != NULL) { *opts = '\0'; opts++; } if(load) { result = globus_xio_driver_load(driver_name, &driver); if(result != GLOBUS_SUCCESS) { goto error_load; } } else { driver = driver_in; } list_ent = (globus_xio_driver_list_ent_t *) globus_calloc(1, sizeof(globus_xio_driver_list_ent_t)); list_ent->opts = globus_libc_strdup(opts); list_ent->driver = driver; list_ent->driver_name = driver_name; list_ent->loaded = load; *ent_out = list_ent; return GLOBUS_SUCCESS; error_load: globus_free(driver_name); return result; } /* driver list stuff */ globus_result_t globus_xio_driver_list_from_string( char * driver_string, globus_list_t ** driver_list, globus_hashtable_t * safe_table) { globus_result_t result; globus_bool_t done = GLOBUS_FALSE; globus_bool_t loaded; char * opts; char * ptr; char * driver_str; char * driver_name; char * tmp_str; globus_xio_driver_t driver; globus_list_t * list = NULL; globus_xio_driver_list_ent_t * list_ent; GlobusXIOName(globus_xio_driver_list_from_string); *driver_list = NULL; if(driver_string == NULL) { result = GlobusXIOErrorParameter("driver_string"); goto error_param; } driver_str = globus_libc_strdup(driver_string); tmp_str = driver_str; while(!done) { loaded = GLOBUS_FALSE; driver_name = tmp_str; ptr = strchr(driver_name, ','); if(ptr != NULL) { *ptr = '\0'; tmp_str = ptr+1; } else { done = GLOBUS_TRUE; } opts = strchr(driver_name, ':'); if(opts != NULL) { *opts = '\0'; opts++; /* decode the string */ globus_url_string_hex_decode(opts); } /* check against the safe list */ if(safe_table != NULL) { char * err_str; list_ent = (globus_xio_driver_list_ent_t *) globus_hashtable_lookup(safe_table, driver_name); if(list_ent == NULL) { err_str = globus_common_create_string( "%s driver not whitelisted", driver_name); result = GlobusXIOErrorParameter(err_str); globus_free(err_str); goto error_load; } driver = list_ent->driver; } else { result = globus_xio_driver_load(driver_name, &driver); if(result != GLOBUS_SUCCESS) { goto error_load; } loaded = GLOBUS_TRUE; } list_ent = (globus_xio_driver_list_ent_t *) globus_calloc(1, sizeof(globus_xio_driver_list_ent_t)); list_ent->opts = globus_libc_strdup(opts); list_ent->driver = driver; list_ent->driver_name = globus_libc_strdup(driver_name); list_ent->loaded = loaded; globus_list_insert(&list, list_ent); } globus_free(driver_str); /* reverse list */ while(!globus_list_empty(list)) { globus_list_insert(driver_list, globus_list_first(list)); globus_list_remove(&list, list); } return GLOBUS_SUCCESS; error_load: globus_free(driver_str); while(!globus_list_empty(list)) { list_ent = (globus_xio_driver_list_ent_t *) globus_list_remove(&list, list); if(list_ent->loaded) { globus_xio_driver_unload(list_ent->driver); } globus_free(list_ent->driver_name); if(list_ent->opts != NULL) { globus_free(list_ent->opts); } globus_free(list_ent); } error_param: return result; } /* * */ globus_result_t globus_xio_attr_cntl( globus_xio_attr_t user_attr, globus_xio_driver_t driver, int cmd, ...) { va_list ap; globus_result_t res; globus_i_xio_attr_t * attr; GlobusXIOName(globus_xio_attr_cntl); GlobusXIODebugEnter(); if(user_attr == NULL) { res = GlobusXIOErrorParameter("user_attr"); goto err; } attr = user_attr; # ifdef HAVE_STDARG_H { va_start(ap, cmd); } # else { va_start(ap); } # endif res = globus_i_xio_driver_attr_cntl(attr, driver, cmd, ap); if(res != GLOBUS_SUCCESS) { va_end(ap); goto err; } va_end(ap); GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } /* * */ globus_result_t globus_xio_attr_destroy( globus_xio_attr_t attr) { int ctr; globus_result_t res = GLOBUS_SUCCESS; globus_result_t tmp_res; GlobusXIOName(globus_xio_attr_destroy); GlobusXIODebugEnter(); if(attr == NULL) { res = GlobusXIOErrorParameter("attr"); goto err; } globus_mutex_lock(&globus_i_xio_mutex); { if(!attr->unloaded) { for(ctr = 0; ctr < attr->ndx; ctr++) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_xio_attr_destroy]: destroying attr @0x%x " "driver @0x%x, %s\n"), attr, attr->entry[ctr].driver, attr->entry[ctr].driver->name)); /* report the last seen error but be sure to attempt to clean them all */ tmp_res = attr->entry[ctr].driver->attr_destroy_func( attr->entry[ctr].driver_data); if(tmp_res != GLOBUS_SUCCESS) { res = tmp_res; } } globus_list_remove( &globus_i_xio_outstanding_attrs_list, globus_list_search( globus_i_xio_outstanding_attrs_list, attr)); } } globus_mutex_unlock(&globus_i_xio_mutex); if(attr->user_open_sbj) { globus_free(attr->user_open_sbj); } if(attr->user_open_username) { globus_free(attr->user_open_username); } if(attr->user_open_pw) { globus_free(attr->user_open_pw); } globus_callback_space_destroy(attr->space); globus_free(attr->entry); globus_free(attr); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_attr_copy( globus_xio_attr_t * dst, globus_xio_attr_t src) { globus_i_xio_attr_t * xio_attr_src; globus_i_xio_attr_t * xio_attr_dst; globus_result_t res; int ctr; int ctr2; GlobusXIOName(globus_xio_attr_copy); GlobusXIODebugEnter(); if(dst == NULL) { res = GlobusXIOErrorParameter("dst"); goto err; } if(src == NULL) { res = GlobusXIOErrorParameter("src"); goto err; } xio_attr_src = src; xio_attr_dst = (globus_i_xio_attr_t *) globus_malloc(sizeof(globus_i_xio_attr_t)); /* check for memory alloc failure */ if(xio_attr_dst == NULL) { res = GlobusXIOErrorMemory("xio_attr_dst"); goto err; } memset(xio_attr_dst, 0, sizeof(globus_i_xio_attr_t)); xio_attr_dst->entry = (globus_i_xio_attr_ent_t *) globus_malloc(sizeof(globus_i_xio_attr_ent_t) * GLOBUS_XIO_ATTR_ARRAY_BASE_SIZE); if(xio_attr_dst->entry == NULL) { globus_free(xio_attr_dst); res = GlobusXIOErrorMemory("xio_attr_dst->entry"); goto err; } memset(xio_attr_dst->entry, 0, sizeof(globus_i_xio_attr_ent_t) * GLOBUS_XIO_ATTR_ARRAY_BASE_SIZE); /* copy all general attrs */ xio_attr_dst->max = xio_attr_src->max; xio_attr_dst->ndx = xio_attr_src->ndx; xio_attr_dst->space = xio_attr_src->space; globus_callback_space_reference(xio_attr_dst->space); xio_attr_dst->open_timeout_cb = xio_attr_src->open_timeout_cb; xio_attr_dst->open_timeout_period = xio_attr_src->open_timeout_period; xio_attr_dst->read_timeout_cb = xio_attr_src->read_timeout_cb; xio_attr_dst->read_timeout_period = xio_attr_src->read_timeout_period; xio_attr_dst->write_timeout_cb = xio_attr_src->write_timeout_cb; xio_attr_dst->write_timeout_period = xio_attr_src->write_timeout_period; xio_attr_dst->close_timeout_cb = xio_attr_src->close_timeout_cb; xio_attr_dst->close_timeout_period = xio_attr_src->close_timeout_period; xio_attr_dst->accept_timeout_cb = xio_attr_src->accept_timeout_cb; xio_attr_dst->accept_timeout_period = xio_attr_src->accept_timeout_period; xio_attr_dst->cancel_open = xio_attr_src->cancel_open; xio_attr_dst->cancel_close = xio_attr_src->cancel_close; xio_attr_dst->cancel_read = xio_attr_src->cancel_read; xio_attr_dst->cancel_write = xio_attr_src->cancel_write; xio_attr_dst->no_cancel = xio_attr_src->no_cancel; xio_attr_dst->timeout_arg = xio_attr_src->timeout_arg; for(ctr = 0; ctr < xio_attr_dst->ndx; ctr++) { xio_attr_dst->entry[ctr].driver = xio_attr_src->entry[ctr].driver; res = xio_attr_dst->entry[ctr].driver->attr_copy_func( &xio_attr_dst->entry[ctr].driver_data, xio_attr_src->entry[ctr].driver_data); if(res != GLOBUS_SUCCESS) { for(ctr2 = 0; ctr2 < ctr; ctr2++) { /* ignore result here */ xio_attr_dst->entry[ctr].driver->attr_destroy_func( xio_attr_dst->entry[ctr].driver_data); } globus_free(xio_attr_dst->entry); globus_free(xio_attr_dst); goto err; } } globus_mutex_lock(&globus_i_xio_mutex); { globus_list_insert(&globus_i_xio_outstanding_attrs_list, xio_attr_dst); } globus_mutex_unlock(&globus_i_xio_mutex); *dst = xio_attr_dst; GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } /******************************************************************* * data descriptor stuff ******************************************************************/ /* * the main difference between a dd and an attr is that the DD * has the driver specific data in order of the drivers in the handle * * the same internal data structures are used. the only difference * in accessing these data structures is the assumptoin of order. */ /* * */ globus_result_t globus_xio_data_descriptor_init( globus_xio_data_descriptor_t * data_desc, globus_xio_handle_t handle) { globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_op_t * op; globus_i_xio_context_t * context; GlobusXIOName(globus_xio_data_descriptor_init); GlobusXIODebugEnter(); if(data_desc == NULL) { res = GlobusXIOErrorParameter("data_desc"); goto err_parm; } if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto err; } context = handle->context; globus_mutex_lock(&context->mutex); { GlobusXIOOperationCreate(op, context); if(op != NULL) { op->type = GLOBUS_XIO_OPERATION_TYPE_DD; handle->ref++; GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO_VERBOSE, (_XIOSL("[globus_xio_data_descriptor_init] :: handle ref at %d.\n"), handle->ref)); op->_op_handle = handle; op->ref = 1; op->is_user_dd = GLOBUS_TRUE; } else { res = GlobusXIOErrorMemory("xio_dd"); } } globus_mutex_unlock(&context->mutex); if(res != GLOBUS_SUCCESS) { goto err; } *data_desc = op; globus_mutex_lock(&globus_i_xio_mutex); { globus_list_insert(&globus_i_xio_outstanding_dds_list, op); } globus_mutex_unlock(&globus_i_xio_mutex); GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: *data_desc = NULL; err_parm: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_data_descriptor_destroy( globus_xio_data_descriptor_t data_desc) { globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_op_t * op; globus_i_xio_handle_t * handle; globus_bool_t destroy_handle = GLOBUS_FALSE; globus_list_t * node; GlobusXIOName(globus_xio_data_descriptor_destroy); GlobusXIODebugEnter(); if(data_desc == NULL) { res = GlobusXIOErrorParameter("data_desc"); goto err; } op = (globus_i_xio_op_t *) data_desc; globus_mutex_lock(&globus_i_xio_mutex); { /* make sure we haven't destroyed it already */ node = globus_list_search(globus_i_xio_outstanding_dds_list, op); if(node) { globus_list_remove(&globus_i_xio_outstanding_dds_list, node); } } globus_mutex_unlock(&globus_i_xio_mutex); if(node == NULL) { res = GlobusXIOErrorParameter("data_desc already destroyed"); goto err; } handle = op->_op_handle; globus_mutex_lock(&handle->context->mutex); { GlobusXIOOpDec(op); if(op->ref == 0) { globus_i_xio_op_destroy(op, &destroy_handle); } } globus_mutex_unlock(&handle->context->mutex); if(destroy_handle) { globus_i_xio_handle_destroy(handle); } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_data_descriptor_cntl( globus_xio_data_descriptor_t data_desc, globus_xio_driver_t driver, int cmd, ...) { globus_result_t res; globus_i_xio_op_t * op; va_list ap; GlobusXIOName(globus_xio_data_descriptor_cntl); GlobusXIODebugEnter(); if(data_desc == NULL) { res = GlobusXIOErrorParameter("data_desc"); goto err; } op = (globus_i_xio_op_t *) data_desc; # ifdef HAVE_STDARG_H { va_start(ap, cmd); } # else { va_start(ap); } # endif res = globus_i_xio_driver_dd_cntl(op, driver, op->type, cmd, ap); va_end(ap); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_data_descriptor_copy( globus_xio_data_descriptor_t * dst, globus_xio_data_descriptor_t src) { globus_i_xio_op_t * op_src; globus_i_xio_op_t * op_dst; globus_result_t res; int ctr; int ctr2; GlobusXIOName(globus_xio_data_descriptor_copy); GlobusXIODebugEnter(); if(dst == NULL) { res = GlobusXIOErrorParameter("dst"); goto err; } if(src == NULL) { res = GlobusXIOErrorParameter("src"); goto err; } op_src = src; res = globus_xio_data_descriptor_init(&op_dst, op_src->_op_handle); if(res != GLOBUS_SUCCESS) { goto err; } for(ctr = 0; ctr < op_src->stack_size; ctr++) { res = op_dst->_op_context->entry[ctr].driver->attr_copy_func( &op_dst->entry[ctr].dd, op_src->entry[ctr].dd); if(res != GLOBUS_SUCCESS) { for(ctr2 = 0; ctr2 < ctr; ctr2++) { /* ignore result here */ op_dst->_op_context->entry[ctr].driver->attr_destroy_func( op_dst->entry[ctr].dd); } globus_memory_push_node(&op_dst->_op_context->op_memory, op_dst); goto err_destroy_op; } } *dst = op_dst; GlobusXIODebugExit(); return GLOBUS_SUCCESS; err_destroy_op: globus_xio_data_descriptor_destroy(op_dst); err: GlobusXIODebugExitWithError(); return res; } /************************************************************************ * stack functions ***********************************************************************/ globus_result_t globus_xio_stack_init( globus_xio_stack_t * stack, globus_xio_attr_t stack_attr) { globus_i_xio_stack_t * xio_stack; GlobusXIOName(globus_xio_stack_init); GlobusXIODebugEnter(); if(stack == NULL) { GlobusXIODebugExitWithError(); return GlobusXIOErrorParameter("stack"); } xio_stack = globus_malloc(sizeof(globus_i_xio_stack_t)); memset(xio_stack, '\0', sizeof(globus_i_xio_stack_t)); *stack = xio_stack; GlobusXIODebugExit(); return GLOBUS_SUCCESS; } globus_result_t globus_xio_stack_copy( globus_xio_stack_t * dst, globus_xio_stack_t src) { globus_i_xio_stack_t * xio_stack_src; globus_i_xio_stack_t * xio_stack_dst; globus_result_t res; GlobusXIOName(globus_xio_stack_push_driver); GlobusXIODebugEnter(); if(dst == NULL) { res = GlobusXIOErrorParameter("dst"); goto err; } if(src == NULL) { res = GlobusXIOErrorParameter("src"); goto err; } xio_stack_src = src; xio_stack_dst = (globus_i_xio_stack_t *) globus_calloc(1, sizeof(globus_i_xio_stack_t)); /* check for memory alloc failure */ if(xio_stack_dst == NULL) { res = GlobusXIOErrorMemory("xio_stack_dst"); goto err; } xio_stack_dst->size = xio_stack_src->size; xio_stack_dst->driver_stack = globus_list_copy( xio_stack_src->driver_stack); *dst = xio_stack_dst; GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_stack_push_driver( globus_xio_stack_t stack, globus_xio_driver_t driver) { globus_xio_driver_t p_d; globus_i_xio_stack_t * xio_stack; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_stack_push_driver); GlobusXIODebugEnter(); if(stack == NULL) { res = GlobusXIOErrorParameter("stack"); goto err; } if(driver == NULL) { res = GlobusXIOErrorParameter("driver"); goto err; } xio_stack = (globus_i_xio_stack_t *) stack; /* if in the transport position and has a push stack */ if(driver->push_driver_func != NULL && xio_stack->pushing_driver != driver) { p_d = xio_stack->pushing_driver; xio_stack->pushing_driver = driver; res = driver->push_driver_func(driver, xio_stack); xio_stack->pushing_driver = p_d; if(res != GLOBUS_SUCCESS) { goto err; } } /* if a transport driver position */ else if(xio_stack->size == 0) { if(driver->transport_open_func == NULL) { res = GlobusXIOErrorInvalidDriver( _XIOSL("open function not defined")); goto err; } else { xio_stack->size++; globus_list_insert(&xio_stack->driver_stack, driver); } } else if(driver->transport_open_func != NULL) { res = GlobusXIOErrorInvalidDriver( _XIOSL("transport can only be at bottom of stack")); goto err; } else { xio_stack->size++; globus_list_insert(&xio_stack->driver_stack, driver); } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_stack_destroy( globus_xio_stack_t stack) { globus_result_t res; GlobusXIOName(globus_xio_stack_destroy); GlobusXIODebugEnter(); if(stack == NULL) { res = GlobusXIOErrorParameter("stack"); goto err; } globus_list_free(stack->driver_stack); globus_free(stack); GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } /* STRING PARSING ATTR SETTING */ globus_result_t globus_i_xio_string_cntl_parser( const char * env_str, globus_xio_string_cntl_table_t * table, void * attr, globus_xio_driver_attr_cntl_t cntl_func) { int i; char * key; char * val; char * tmp_s; globus_list_t * list; globus_object_t * error = NULL; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_i_xio_string_cntl_parser); list = globus_list_from_string(env_str, ';', NULL); while(!globus_list_empty(list)) { key = (char *) globus_list_remove(&list, list); tmp_s = strchr(key, '='); if(tmp_s != NULL) { *tmp_s = '\0'; val = tmp_s + 1; for(i = 0; table[i].key != NULL; i++) { /* if we have a match */ if(strcmp(table[i].key, key) == 0) { res = table[i].parse_func( attr, key, val, table[i].cmd, cntl_func); if(res != GLOBUS_SUCCESS) { /* restore '=' */ *tmp_s = '='; res = GlobusXIOErrorWrapFailedWithMessage( res, "String cntl '%s' failed", key); } break; } } if(!table[i].key) { res = GlobusXIOErrorParameter(key); } } else { res = GlobusXIOErrorParameter(key); } if(res != GLOBUS_SUCCESS) { if(!error) { error = globus_error_construct_multiple( GLOBUS_XIO_MODULE, GLOBUS_XIO_ERROR_PARAMETER, "One or more of the string cntls failed"); } globus_error_mutliple_add_chain( error, globus_error_get(res), NULL); } globus_free(key); } return globus_error_put(error); } globus_result_t globus_xio_string_cntl_bouncer( globus_xio_driver_attr_cntl_t cntl_func, void * attr, int cmd, ...) { globus_result_t result; va_list ap; va_start(ap, cmd); result = cntl_func(attr, cmd, ap); va_end(ap); return result; } static int globus_xio_string_cntl_tb_kmgint( const char * arg, globus_off_t * out_i) { int i; int sc; GlobusXIOName(globus_xio_string_cntl_tb_kmgint); GlobusXIODebugEnter(); sc = sscanf(arg, "%d", &i); if(sc != 1) { return 1; } if(strchr(arg, 'K') != NULL) { *out_i = (globus_off_t)i * 1024; } else if(strchr(arg, 'M') != NULL) { *out_i = (globus_off_t)i * 1024 * 1024; } else if(strchr(arg, 'G') != NULL) { *out_i = (globus_off_t)i * 1024 * 1024 * 1024; } else if(strchr(arg, 'g') != NULL) { *out_i = (globus_off_t)i * 1024 * 1024 * 1024; *out_i = *out_i / 8; } else if(strchr(arg, 'm') != NULL) { *out_i = (globus_off_t)i * 1024 * 1024; *out_i = *out_i / 8; } else if(strchr(arg, 'k') != NULL) { *out_i = (globus_off_t)i * 1024; *out_i = *out_i / 8; } else if(strchr(arg, 'b') != NULL) { *out_i = (globus_off_t)i; *out_i = *out_i / 8; } else { *out_i = (globus_off_t)i; } return 0; } globus_result_t globus_xio_string_cntl_formated_off( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { int sc; globus_off_t o; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_string_cntl_formated_off); GlobusXIODebugEnter(); sc = globus_xio_string_cntl_tb_kmgint(val, &o); if(sc != 0) { result = GlobusXIOErrorParse(val); } else { result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, o); } GlobusXIODebugExit(); return result; } globus_result_t globus_xio_string_cntl_formated_int( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { int sc; int i; globus_off_t o; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_string_cntl_formated_int); GlobusXIODebugEnter(); sc = globus_xio_string_cntl_tb_kmgint(val, &o); if(sc != 0) { result = GlobusXIOErrorParse(val); } else { i = (int) o; result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, i); } GlobusXIODebugExit(); return result; } globus_result_t globus_xio_string_cntl_int( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { int sc; int i; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_string_cntl_int); GlobusXIODebugEnter(); sc = sscanf(val, "%d", &i); if(sc != 1) { result = GlobusXIOErrorParse(val); } else { result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, i); } GlobusXIODebugExit(); return result; } globus_result_t globus_xio_string_cntl_int_int( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { int sc; int i; int j; char * tmp_s; char * new_val; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_string_cntl_int_int); GlobusXIODebugEnter(); /* turn all non digits into spaces for the scanf easiness */ tmp_s = strdup(val); if(tmp_s == NULL) { result = GlobusXIOErrorParse(val); return result; } new_val = tmp_s; while(*tmp_s != '\0') { if(!isdigit(*tmp_s)) { *tmp_s = ' '; } tmp_s++; } sc = sscanf(new_val, "%d %d", &i, &j); free(new_val); if(sc != 2) { result = GlobusXIOErrorParse(val); } else { result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, i, j); } GlobusXIODebugExit(); return result; } globus_result_t globus_xio_string_cntl_float( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { int sc; float f; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_string_cntl_float); GlobusXIODebugEnter(); sc = sscanf(val, "%f", &f); if(sc != 1) { result = GlobusXIOErrorParse(val); } else { result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, f); } GlobusXIODebugExit(); return result; } globus_result_t globus_xio_string_cntl_string( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_string_cntl_string); GlobusXIODebugEnter(); result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, val); GlobusXIODebugExit(); return result; } globus_result_t globus_xio_string_cntl_bool( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { int sc; int i; globus_bool_t found = GLOBUS_FALSE; globus_bool_t b; globus_result_t result = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_string_cntl_bool); GlobusXIODebugEnter(); if(strcasecmp(val, "yes") == 0) { b = GLOBUS_TRUE; found = GLOBUS_TRUE; } else if(strcasecmp(val, "y") == 0) { b = GLOBUS_TRUE; found = GLOBUS_TRUE; } else if(strcasecmp(val, "true") == 0) { b = GLOBUS_TRUE; found = GLOBUS_TRUE; } else if(strcasecmp(val, "t") == 0) { b = GLOBUS_TRUE; found = GLOBUS_TRUE; } else if(strcasecmp(val, "no") == 0) { b = GLOBUS_FALSE; found = GLOBUS_TRUE; } else if(strcasecmp(val, "n") == 0) { b = GLOBUS_FALSE; found = GLOBUS_TRUE; } else if(strcasecmp(val, "false") == 0) { b = GLOBUS_FALSE; found = GLOBUS_TRUE; } else if(strcasecmp(val, "f") == 0) { b = GLOBUS_FALSE; found = GLOBUS_TRUE; } else { sc = sscanf(val, "%d", &i); if(sc == 1) { b = i; found = GLOBUS_TRUE; } } if(found) { result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, b); } else { result = GlobusXIOErrorParse(val); } GlobusXIODebugExit(); return result; } globus_result_t globus_xio_string_cntl_string_list( void * attr, const char * key, const char * val, int cmd, globus_xio_driver_attr_cntl_t cntl_func) { int i = 0; globus_list_t * val_list; globus_list_t * list; char ** argv; int argc; globus_result_t result; int del; /* delimitor is the first character */ if(val == NULL) { return GLOBUS_SUCCESS; } del = (int)*val; val++; val_list = globus_list_from_string(val, del, NULL); list = val_list; argc = globus_list_size(list); argv = (char **) calloc(argc+1, sizeof(char *)); i = argc - 1; while(!globus_list_empty(list)) { argv[i] = (char *)globus_list_first(list); list = globus_list_rest(list); i--; } result = globus_xio_string_cntl_bouncer(cntl_func, attr, cmd, argv); globus_list_destroy_all(val_list, globus_libc_free); globus_free(argv); return result; } globus_xio-3.6/Makefile.in0000664000076400007640000010747312225614604012552 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(am__configure_deps) $(include_HEADERS) \ $(noinst_HEADERS) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/extensions.h.in \ $(srcdir)/version.h.in $(top_srcdir)/configure \ $(top_srcdir)/globus_automake_post \ $(top_srcdir)/globus_automake_post_top \ $(top_srcdir)/globus_automake_pre \ $(top_srcdir)/globus_automake_pre_top acconfig.h config.guess \ config.sub install-sh ltmain.sh missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = version.h extensions.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \ "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_xio_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__objects_1 = globus_xio_handle.lo globus_xio_driver.lo \ globus_xio_attr.lo globus_xio_timeout.lo globus_xio_server.lo \ globus_xio_pass.lo globus_xio_util.lo globus_xio_wrapblock.lo \ globus_xio_system_select.lo globus_xio_system_win32.lo \ globus_i_xio_win32_complete.lo globus_i_xio_win32_file.lo \ globus_i_xio_win32_mode.lo globus_i_xio_win32_socket.lo \ globus_i_xio_system_common.lo globus_xio_load.lo am_libglobus_xio_la_OBJECTS = $(am__objects_1) libglobus_xio_la_OBJECTS = $(am_libglobus_xio_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libglobus_xio_la_SOURCES) DIST_SOURCES = $(libglobus_xio_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive docDATA_INSTALL = $(INSTALL_DATA) DATA = $(doc_DATA) includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILTIN_EXTENSIONS_DEC = @BUILTIN_EXTENSIONS_DEC@ BUILTIN_EXTENSIONS_DEF = @BUILTIN_EXTENSIONS_DEF@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS = @CROSS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIRT_BRANCH_ID = @DIRT_BRANCH_ID@ DIRT_TIMESTAMP = @DIRT_TIMESTAMP@ DOT = @DOT@ DOXYFILE = @DOXYFILE@ DOXYGEN = @DOXYGEN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_PROGRAMS_FALSE = @ENABLE_PROGRAMS_FALSE@ ENABLE_PROGRAMS_TRUE = @ENABLE_PROGRAMS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ F77FLAGS = @F77FLAGS@ F90 = @F90@ F90FLAGS = @F90FLAGS@ FFLAGS = @FFLAGS@ FILELIST_FILE = @FILELIST_FILE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GPT_AGE_VERSION = @GPT_AGE_VERSION@ GPT_CFLAGS = @GPT_CFLAGS@ GPT_CONFIG_CFLAGS = @GPT_CONFIG_CFLAGS@ GPT_CONFIG_INCLUDES = @GPT_CONFIG_INCLUDES@ GPT_CONFIG_LIBS = @GPT_CONFIG_LIBS@ GPT_CONFIG_PKG_LIBS = @GPT_CONFIG_PKG_LIBS@ GPT_EXTERNAL_INCLUDES = @GPT_EXTERNAL_INCLUDES@ GPT_EXTERNAL_LIBS = @GPT_EXTERNAL_LIBS@ GPT_INCLUDES = @GPT_INCLUDES@ GPT_IS_2 = @GPT_IS_2@ GPT_LDFLAGS = @GPT_LDFLAGS@ GPT_LIBS = @GPT_LIBS@ GPT_LIB_LINKS = @GPT_LIB_LINKS@ GPT_LINKTYPE = @GPT_LINKTYPE@ GPT_LOCATION = @GPT_LOCATION@ GPT_MAJOR_VERSION = @GPT_MAJOR_VERSION@ GPT_MINOR_VERSION = @GPT_MINOR_VERSION@ GPT_PGM_LINKS = @GPT_PGM_LINKS@ GPT_PKGCONFIG_DEPENDENCIES = @GPT_PKGCONFIG_DEPENDENCIES@ GPT_PKG_CFLAGS = @GPT_PKG_CFLAGS@ HAVE_DOT = @HAVE_DOT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSURE = @INSURE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XIO_BUILTIN_DIRS = @XIO_BUILTIN_DIRS@ XIO_BUILTIN_LIBS = @XIO_BUILTIN_LIBS@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ aclocaldir = @aclocaldir@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cross_compiling = @cross_compiling@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygendir = @doxygendir@ exec_prefix = @exec_prefix@ flavorincludedir = @flavorincludedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lac_doxygen_examples = @lac_doxygen_examples@ lac_doxygen_file_patterns = @lac_doxygen_file_patterns@ lac_doxygen_input_filter = @lac_doxygen_input_filter@ lac_doxygen_installdox = @lac_doxygen_installdox@ lac_doxygen_internal_tagfiles = @lac_doxygen_internal_tagfiles@ lac_doxygen_output_tagfile = @lac_doxygen_output_tagfile@ lac_doxygen_predefines = @lac_doxygen_predefines@ lac_doxygen_project = @lac_doxygen_project@ lac_doxygen_srcdirs = @lac_doxygen_srcdirs@ lac_doxygen_tagfiles = @lac_doxygen_tagfiles@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ perlmoduledir = @perlmoduledir@ pkgconfdir = @pkgconfdir@ pkgconffile = @pkgconffile@ pkgconffile_in = @pkgconffile_in@ pkgdir = @pkgdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ setupdir = @setupdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ testdir = @testdir@ scriptsysconfdir = ${sysconfdir} amdirdir = ${datadir}/globus_amdir LINK_BAK = orig AUTOMAKE_OPTIONS = no-dependencies SUBDIRS = \ builtins \ . \ pkgdata \ doxygen Sources = \ globus_xio_handle.c \ globus_xio_driver.c \ globus_xio_attr.c \ globus_xio_timeout.c \ globus_xio_server.c \ globus_xio_pass.c \ globus_xio_util.c \ globus_xio_wrapblock.c \ globus_xio_system_select.c \ globus_xio_system_win32.c \ globus_i_xio_win32_complete.c \ globus_i_xio_win32_file.c \ globus_i_xio_win32_mode.c \ globus_i_xio_win32_socket.c \ globus_i_xio_system_common.c \ globus_xio_load.c include_HEADERS = \ globus_xio_types.h \ globus_xio_util.h \ globus_xio_load.h \ globus_xio_driver.h \ globus_xio.h \ globus_xio_wrapblock.h \ globus_xio_system.h noinst_HEADERS = \ globus_i_xio.h \ globus_i_xio_system_common.h lib_LTLIBRARIES = libglobus_xio.la INCLUDES = $(GPT_INCLUDES) libglobus_xio_la_SOURCES = $(Sources) libglobus_xio_la_LDFLAGS = $(GPT_LDFLAGS) libglobus_xio_la_LIBADD = \ $(GPT_LIB_LINKS) \ $(XIO_BUILTIN_LIBS) doc_DATA = GLOBUS_LICENSE EXTRA_DIST = globus_xio_system_win32.c globus_i_xio_win32.h \ globus_i_xio_win32_complete.c globus_i_xio_win32_file.c \ globus_i_xio_win32_mode.c globus_i_xio_win32_socket.c \ version.h.in extensions.h.in configure.in.in $(doc_DATA) \ bootstrap globus_automake_pre globus_automake_post \ globus_automake_pre_top globus_automake_post_top dirt.sh \ gptdata.sh DISTCLEANFILES = globus-script-initializer globus-perl-initializer \ globus-script-libdir-choice globus-perl-libdir-choice all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/globus_automake_pre $(top_srcdir)/globus_automake_pre_top $(top_srcdir)/globus_automake_post $(top_srcdir)/globus_automake_post_top $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/acconfig.h cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 version.h: $(top_builddir)/config.status $(srcdir)/version.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ extensions.h: $(top_builddir)/config.status $(srcdir)/extensions.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libglobus_xio.la: $(libglobus_xio_la_OBJECTS) $(libglobus_xio_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libglobus_xio_la_LDFLAGS) $(libglobus_xio_la_OBJECTS) $(libglobus_xio_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(mkdir_p) "$(DESTDIR)$(docdir)" @list='$(doc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \ $(docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ rm -f "$(DESTDIR)$(docdir)/$$f"; \ done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/. $(distdir)/doxygen $(distdir)/pkgdata @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -755 -exec chmod a+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-docDATA install-includeHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-docDATA uninstall-includeHEADERS \ uninstall-info-am uninstall-libLTLIBRARIES uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libLTLIBRARIES \ clean-libtool clean-recursive ctags ctags-recursive dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-shar dist-tarZ \ dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-docDATA install-exec install-exec-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-docDATA \ uninstall-includeHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES dist-hook: $(GPT_LOCATION)/sbin/gpt_create_automake_rules --excludes=doxygen -srcdir=$(top_distdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # BEGIN GPT AUTOMAKE RULES link-am: unlink-am: filelist-am: link: link-recursive link-docDATA link-includeHEADERS link-libLTLIBRARIES : unlink: unlink-recursive unlink-docDATA unlink-includeHEADERS unlink-libLTLIBRARIES : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-docDATA unlink-docDATA filelist-docDATA link-includeHEADERS unlink-includeHEADERS filelist-includeHEADERS link-libLTLIBRARIES unlink-libLTLIBRARIES filelist-libLTLIBRARIES filelist: filelist-recursive filelist-docDATA filelist-includeHEADERS filelist-libLTLIBRARIES : link-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(docdir) @list='$(doc_DATA)'; for p in $$list; do \ mydir=`pwd`; \ target_p=$(DESTDIR)$(docdir)/$$p; \ if test -f $(srcdir)/$$p; then \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$fullsrcdir/$$p $$target_p"; \ ln -s $$fullsrcdir/$$p $$target_p; \ fi; \ else if test -f $$p; then \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$mydir/$$p $$target_p"; \ ln -s $$mydir/$$p $$target_p; \ fi; \ fi; fi; \ done unlink-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; for p in $$list; do \ target_p=$(DESTDIR)$(docdir)/$$p; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-docDATA: @list='$(doc_DATA)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ dirname='doc'; \ origp="$$p" ; \ p="`echo $(docdir)/$$p | sed -e 's!^$(prefix)!!'`"; \ case "$$dirname-$$origp" in \ *-pkg_data_*.gpt) \ type=`echo $$origp | sed -e 's!^pkg_data_!!' -e 's!.gpt$$!!'`; \ echo "$$p" >> "$${filelistdir}/$${type}.filelist" ; \ ;; \ *-*.filelist) \ echo "$$p" >> "$${filelistdir}/$${origp}" ; \ ;; \ *-*.pc) \ echo "$$p" >> "$${filelistdir}/$(GLOBUS_FLAVOR_NAME)_dev.filelist"; \ ;; \ *-*.pm) \ echo "$$p" >> "$${filelistdir}/$(GLOBUS_FLAVOR_NAME)_rtl.filelist"; \ ;; \ *doc-*) \ echo "$$p" >> "$${filelistdir}/noflavor_doc.filelist"; \ ;; \ *) \ echo "$$p" >> "$${filelistdir}/noflavor_data.filelist"; \ ;; \ esac ; \ done link-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ mydir=`pwd`; \ target_p="$(DESTDIR)$(includedir)/$$p"; \ cd $(srcdir); \ fullsrcdir=`pwd`; \ cd $$mydir; \ if test -f "$$p"; then d="$$mydir/"; else d="$$fullsrcdir/"; fi; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$d$$p $$target_p"; \ ln -s $$d$$p $$target_p; \ fi; \ done unlink-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ target_p="$(DESTDIR)$(includedir)/$$p"; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ fi; \ done filelist-includeHEADERS: @list='$(include_HEADERS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(includedir)/$$p | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ done link-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ mydir=`pwd`; \ target_p=$(DESTDIR)$(libdir)/$$p; \ target_dir="$(DESTDIR)$(libdir)/"; \ root_p=`echo $$p | sed "s,.la,,"`; \ liblist=`ls $$mydir/.libs/$$root_p.so*`; for so in $$liblist; do \ if test ! -h $$so; then \ so_name=`echo $$so | sed "s,$$mydir/.libs/,,"`; \ so_list="$$so_list $$so_name"; \ fi; \ done; \ if test -f $$target_p -a ! -h $$target_p; then \ echo "mv $$target_p $$target_p.$(LINK_BAK)"; \ mv $$target_p $$target_p.$(LINK_BAK); \ for so in $$so_list; do \ echo "mv $$target_dir/$$so $$target_dir/$$so.$(LINK_BAK)"; \ mv $$target_dir/$$so $$target_dir/$$so.$(LINK_BAK); \ done; \ fi; \ if test ! -h $$target_p; then \ echo "ln -s $$mydir/$$p $$target_p"; \ ln -s $$mydir/$$p $$target_p; \ for so in $$so_list; do \ echo "ln -s $$mydir/.libs/$$so $$target_dir/$$so"; \ ln -s $$mydir/.libs/$$so $$target_dir/$$so; \ done; \ fi; \ else :; fi; \ done unlink-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ target_p=$(DESTDIR)$(libdir)/$$p; \ target_dir="$(DESTDIR)$(libdir)/"; \ root_p=`echo $$p | sed "s,.la,,"`; \ so_list=`ls $$target_dir/$$root_p.so*.$(LINK_BAK)`; \ if test -h $$target_p; then \ echo "rm $$target_p"; \ rm $$target_p; \ for so in $$so_list; do \ so_name=`echo $$so | sed "s,.$(LINK_BAK),,"`; \ echo "rm $$so_name"; \ rm $$so_name; \ done; \ fi; \ if test -f $$target_p.$(LINK_BAK); then \ echo "mv $$target_p.$(LINK_BAK) $$target_p"; \ mv $$target_p.$(LINK_BAK) $$target_p; \ for so in $$so_list; do \ so_name=`echo $$so | sed "s,.$(LINK_BAK),,"`; \ mv $$so_name.$(LINK_BAK) $$so_name; \ done; \ fi; \ done filelist-libLTLIBRARIES: $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ $(GPT_LOCATION)/sbin/gpt_get_lib_names $$p $(DESTDIR)$(libdir) -old | sed -e 's!^$(DESTDIR)$(exec_prefix)!!' -e 's!$(exec_prefix)!!' >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_dev.filelist"; \ $(GPT_LOCATION)/sbin/gpt_get_lib_names $$p $(DESTDIR)$(libdir) -dynamic | sed -e 's!^$(DESTDIR)$(exec_prefix)!!' -e 's!$(exec_prefix)!!' >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_rtl.filelist"; \ done link-recursive unlink-recursive filelist-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" globus_xio-3.6/globus_xio_server.c0000666000076400007640000017162611374254655014426 00000000000000/* * Copyright 1999-2006 University of Chicago * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "globus_xio.h" #include "globus_i_xio.h" #include /* * note: * * Cancel Process * -------------- * The only exception to when the accept can finish before the callback occurs * is when a cancel happens. In the case the driver should stop what it is * doing and finish with a canceled error. All drivers above it will get * this error and should finish in the same manner, by cleaning up resources * involved with this accpet and the calling finish with the cancel error. * Once the error reaches the top xio will find all drivers were not notified * of the cancel and ask them to destroy their links. * * Errors * ------ * There are two times when an error can happens. The first is in the * callback. The process for dealing with this is exctly as a canceled * accept... The top callback comes back with an error and all successfully * created driver links are destroyed. * * The second case is if the Pass fails. Once a driver calls pass it must * only return the error code that pass returns. If that error code is * GLOBUS_SUCESS then the driver should expect a callback, if it is not * the driver will not receive the callback for which it registered. This * rule allows the framework to know that if it receives an error from * pass at the top level that no driver has an outstanding callback. * */ #define GlobusIXIOServerDec(free, _in_s) \ do \ { \ globus_i_xio_server_t * _s; \ \ _s = (_in_s); \ _s->ref--; \ if(_s->ref == 0) \ { \ /* if the handle ref gets down to zero we must be in one \ * of the followninf staes. The statement is that the handle \ * only goes away when it is closed or a open fails \ */ \ globus_assert(_s->state == GLOBUS_XIO_SERVER_STATE_CLOSED); \ free = GLOBUS_TRUE; \ } \ else \ { \ free = GLOBUS_FALSE; \ } \ } while (0) globus_list_t * globus_i_xio_outstanding_servers_list; /************************************************************************** * Internal functions * ------------------ *************************************************************************/ static globus_result_t globus_l_xio_close_server( globus_i_xio_server_t * xio_server); static void globus_l_xio_server_destroy( globus_i_xio_server_t * xio_server) { GlobusXIOName(globus_l_xio_server_destroy); GlobusXIODebugInternalEnter(); globus_mutex_lock(&globus_i_xio_mutex); { globus_mutex_lock(&xio_server->mutex); { if(xio_server->sd_monitor != NULL) { GlobusXIODebugPrintf( GLOBUS_XIO_DEBUG_INFO, (_XIOSL("[globus_i_xio_handle_destroy]" " :: signalling handle unload.\n"))); xio_server->sd_monitor->count--; if(xio_server->sd_monitor->count == 0) { globus_cond_signal(&globus_i_xio_cond); } } else { globus_list_remove( &globus_i_xio_outstanding_servers_list, globus_list_search( globus_i_xio_outstanding_servers_list, xio_server)); } } globus_mutex_unlock(&xio_server->mutex); } globus_mutex_unlock(&globus_i_xio_mutex); globus_callback_space_destroy(xio_server->space); globus_mutex_destroy(&xio_server->mutex); if(xio_server->contact_string) { globus_free(xio_server->contact_string); } globus_free(xio_server); GlobusXIODebugInternalExit(); } static void globus_i_xio_server_post_accept( globus_i_xio_op_t * xio_op); static void globus_i_xio_server_will_block_cb( globus_thread_callback_index_t wb_ndx, globus_callback_space_t space, void * user_args) { globus_i_xio_op_t * xio_op; GlobusXIOName(globus_i_xio_server_will_block_cb); GlobusXIODebugInternalEnter(); xio_op = (globus_i_xio_op_t *) user_args; xio_op->restarted = GLOBUS_TRUE; GlobusXIOOpInc(xio_op); globus_thread_blocking_callback_disable(&wb_ndx); globus_i_xio_server_post_accept(xio_op); GlobusXIODebugInternalExit(); } static globus_result_t globus_l_xio_server_handle_create( globus_xio_handle_t * handle, globus_xio_server_t server) { globus_i_xio_handle_t * ihandle; globus_i_xio_context_t * context; int ndx; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_l_xio_server_handle_create); GlobusXIODebugInternalEnter(); if(handle == NULL) { res = GlobusXIOErrorParameter("handle"); goto error_context; } /* allocate and initialize context */ context = globus_i_xio_context_create(server->stack_size); if(context == NULL) { res = GlobusXIOErrorMemory("context"); goto error_context; } /* allocate and intialize the handle structure */ ihandle = (globus_i_xio_handle_t *) globus_calloc(1, sizeof(globus_i_xio_handle_t)); if(ihandle == NULL) { res = GlobusXIOErrorMemory("ihandle"); goto error_handle; } /* initialize the handle */ ihandle->ref = 1; /* itself */ ihandle->context = context; ihandle->state = GLOBUS_XIO_HANDLE_STATE_ACCEPTED; ihandle->space = GLOBUS_CALLBACK_GLOBAL_SPACE; for(ndx = 0; ndx < server->stack_size; ndx++) { context->entry[ndx].driver = server->entry[ndx].driver; } *handle = ihandle; GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; error_handle: globus_i_xio_context_destroy(context); error_context: GlobusXIODebugInternalExitWithError(); return res; } /* * this is the only mechanism for delivering a callback to the user */ void globus_l_xio_server_accept_kickout( void * user_arg) { int ctr; int wb_ndx; globus_i_xio_server_t * xio_server; globus_i_xio_op_t * xio_op; globus_xio_handle_t accepted_handle = NULL; globus_result_t res; globus_bool_t destroy_server = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_server_accept_kickout); GlobusXIODebugInternalEnter(); xio_op = (globus_i_xio_op_t *) user_arg; xio_server = xio_op->_op_server; /* create the structure if successful, otherwise the handle is null */ res = GlobusXIOObjToResult(xio_op->cached_obj); if(res == GLOBUS_SUCCESS) { res = globus_l_xio_server_handle_create(&accepted_handle, xio_server); if(res == GLOBUS_SUCCESS) { /* stick the link in the new handle's context */ for(ctr = 0; ctr < xio_op->stack_size; ctr++) { accepted_handle->context->entry[ctr].driver_handle = xio_op->entry[ctr].link; } globus_mutex_lock(&globus_i_xio_mutex); { globus_list_insert( &globus_i_xio_outstanding_handles_list, accepted_handle); } globus_mutex_unlock(&globus_i_xio_mutex); } } /* if failed clean up the operation */ if(res != GLOBUS_SUCCESS) { for(ctr = 0; ctr < xio_op->stack_size; ctr++) { if(xio_op->entry[ctr].link != NULL) { globus_assert( xio_server->entry[ctr].driver->link_destroy_func != NULL && "If the driver link is non-NULL the link_destroy_func must be defined"); /* ignore result code. user should be more interested in result from callback */ xio_server->entry[ctr].driver->link_destroy_func( xio_op->entry[ctr].link); } } } globus_thread_blocking_space_callback_push( globus_i_xio_server_will_block_cb, (void *) xio_op, xio_op->blocking ? GLOBUS_CALLBACK_GLOBAL_SPACE: xio_server->space, &wb_ndx); /* call the users callback */ xio_op->_op_accept_cb( xio_server, accepted_handle, res, xio_op->user_arg); globus_thread_blocking_callback_pop(&wb_ndx); if(xio_op->restarted) { globus_mutex_lock(&xio_server->mutex); { GlobusXIOOpDec(xio_op); if(xio_op->ref == 0) { /* remove the reference for the op on the server */ GlobusIXIOServerDec(destroy_server, xio_server); globus_free(xio_op); } } globus_mutex_unlock(&xio_server->mutex); if(destroy_server) { globus_l_xio_server_destroy(xio_server); } return; } globus_i_xio_server_post_accept(xio_op); GlobusXIODebugInternalExit(); } void globus_i_xio_server_post_accept( globus_i_xio_op_t * xio_op) { globus_bool_t destroy_server = GLOBUS_FALSE; globus_i_xio_server_t * xio_server; GlobusXIOName(globus_i_xio_server_post_accept); GlobusXIODebugInternalEnter(); xio_server = xio_op->_op_server; /* if user called register accept in the callback we will be back from the completeing state and into the accepting state */ /* lock up and do some clean up */ globus_mutex_lock(&xio_server->mutex); { globus_assert(xio_op->state == GLOBUS_XIO_OP_STATE_FINISH_WAITING); xio_server->outstanding_operations--; switch(xio_server->state) { case GLOBUS_XIO_SERVER_STATE_COMPLETING: xio_server->op = NULL; xio_server->state = GLOBUS_XIO_SERVER_STATE_OPEN; break; case GLOBUS_XIO_SERVER_STATE_CLOSE_PENDING: if(xio_server->outstanding_operations == 0) { xio_server->state = GLOBUS_XIO_SERVER_STATE_CLOSING; globus_l_xio_close_server(xio_server); } break; case GLOBUS_XIO_SERVER_STATE_CLOSED: case GLOBUS_XIO_SERVER_STATE_CLOSING: xio_server->op = NULL; break; /* This can happen if when the callback is called the user registers another accept and that accept callback is called before the first callback returns. */ case GLOBUS_XIO_SERVER_STATE_OPEN: break; case GLOBUS_XIO_SERVER_STATE_ACCEPTING: break; default: globus_assert(0 && "Unexpected state after accept callback"); break; } /* decrement reference for the callback if timeout has happened or isn't registered this will go to zero */ GlobusXIOOpDec(xio_op); if(xio_op->ref == 0) { GlobusIXIOServerDec(destroy_server, xio_server); globus_free(xio_op); } } globus_mutex_unlock(&xio_server->mutex); if(destroy_server) { globus_l_xio_server_destroy(xio_server); } GlobusXIODebugInternalExit(); } /* * internal top level accept callback */ void globus_i_xio_server_accept_callback( globus_xio_operation_t op, globus_result_t result, void * user_arg) { globus_i_xio_server_t * xio_server; globus_i_xio_op_t * xio_op; globus_bool_t accept = GLOBUS_TRUE; GlobusXIOName(globus_i_xio_server_accept_callback); GlobusXIODebugInternalEnter(); xio_op = op; xio_server = xio_op->_op_server; globus_mutex_lock(&xio_server->mutex); { /* if in this state it means that the user either has or is about to get a cancel callback. we must delay the delivery of this callback until that returns */ xio_op->cached_obj = GlobusXIOResultToObj(result); if(xio_op->state == GLOBUS_XIO_OP_STATE_TIMEOUT_PENDING) { accept = GLOBUS_FALSE; } else { /* if there is an outstanding accept callback */ if(xio_op->_op_server_timeout_cb != NULL) { if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, xio_op)) { GlobusXIOOpDec(xio_op); globus_assert(xio_op->ref > 0); } } } xio_op->state = GLOBUS_XIO_OP_STATE_FINISH_WAITING; switch(xio_server->state) { case GLOBUS_XIO_SERVER_STATE_ACCEPTING: xio_server->state = GLOBUS_XIO_SERVER_STATE_COMPLETING; break; /* nothing to do for this case */ case GLOBUS_XIO_SERVER_STATE_CLOSE_PENDING: break; default: globus_assert(0); } } globus_mutex_unlock(&xio_server->mutex); /* we may be delaying the callback until cancel returns */ if(accept) { globus_l_xio_server_accept_kickout((void *)xio_op); } GlobusXIODebugInternalExit(); } static globus_bool_t globus_l_xio_accept_timeout_callback( void * user_arg) { globus_i_xio_op_t * xio_op; globus_i_xio_server_t * xio_server; globus_bool_t rc; globus_bool_t cancel; globus_bool_t accept = GLOBUS_FALSE; globus_bool_t timeout = GLOBUS_FALSE; globus_bool_t destroy_server = GLOBUS_FALSE; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_l_xio_accept_timeout_callback); GlobusXIODebugInternalEnter(); xio_op = (globus_i_xio_op_t *) user_arg; xio_server = xio_op->_op_server; globus_mutex_lock(&xio_server->mutex); { switch(xio_op->state) { /* * this case happens when a serverwas successfully created but * we were unable to unregister the callback and when the first * pass fails and we are unable to cancel the timeout callback */ case GLOBUS_XIO_OP_STATE_FINISHED: case GLOBUS_XIO_OP_STATE_FINISH_WAITING: /* decerement the reference for the timeout callback */ GlobusXIOOpDec(xio_op); if(xio_op->ref == 0) { /* remove the reference for the op on the server */ GlobusIXIOServerDec(destroy_server, xio_server); globus_free(xio_op); } /* remove it from the timeout list */ rc = GLOBUS_TRUE; break; /* this case happens when we actually want to cancel the operation The timeout code should insure that prograess is false if this gets called in this state */ case GLOBUS_XIO_OP_STATE_OPERATING: /* it is up to the timeout callback to set this to true */ rc = GLOBUS_FALSE; /* cancel the sucker */ globus_assert(xio_op->_op_server_timeout_cb != NULL); if(!xio_op->block_timeout) { timeout = GLOBUS_TRUE; /* we don't need to cache the server object in local stack because state insures that it will not go away */ /* put in canceling state to delay the accept callback */ xio_op->state = GLOBUS_XIO_OP_STATE_TIMEOUT_PENDING; } break; /* fail on any ohter case */ default: globus_assert(0); } } globus_mutex_unlock(&xio_server->mutex); /* if in cancel state, verfiy with user that they want to cancel */ if(timeout) { cancel = xio_op->_op_server_timeout_cb( xio_server, xio_op->type); } /* all non time out casses can just return */ else { if(destroy_server) { globus_l_xio_server_destroy(xio_server); } goto exit; } globus_mutex_lock(&xio_server->mutex); { /* if canceling set the res and we will remove this timer event */ if(cancel) { rc = GLOBUS_TRUE; /* Assume all timeouts originate from user */ xio_op->canceled = 1; if(xio_op->cancel_cb) { globus_i_xio_op_entry_t * my_op; my_op = &xio_op->entry[xio_op->ndx - 1]; my_op->in_register = GLOBUS_TRUE; xio_op->cancel_cb( xio_op, xio_op->cancel_arg, GLOBUS_XIO_ERROR_TIMEOUT); my_op->in_register = GLOBUS_FALSE; } } /* if an accept callback has already arriverd set flag to later call accept callback and set rc to remove timed event */ if(xio_op->state == GLOBUS_XIO_OP_STATE_FINISH_WAITING) { accept = GLOBUS_TRUE; rc = GLOBUS_TRUE; } /* if no accept is waiting, set state back to operating */ else { xio_op->state = GLOBUS_XIO_OP_STATE_OPERATING; } /* if we are remvoing the timed event */ if(rc) { /* decremenet the op reference count and insist that it is not zero yet */ xio_op->_op_handle_timeout_cb = NULL; GlobusXIOOpDec(xio_op); globus_assert(xio_op->ref > 0); } } globus_mutex_unlock(&xio_server->mutex); /* if the accpet was pending we must call it */ if(accept) { if(!xio_op->blocking) { space = xio_server->space; } if(space != GLOBUS_CALLBACK_GLOBAL_SPACE) { /* register a oneshot callback */ globus_i_xio_register_oneshot( NULL, globus_l_xio_server_accept_kickout, (void *)xio_op, space); } /* in all other cases we can just call callback */ else { globus_l_xio_server_accept_kickout((void *)xio_op); } } exit: GlobusXIODebugInternalExit(); return rc; } void globus_l_xio_server_close_kickout( void * user_arg) { globus_i_xio_server_t * xio_server; globus_bool_t destroy_server = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_server_close_kickout); GlobusXIODebugInternalEnter(); xio_server = (globus_i_xio_server_t *) user_arg; if(xio_server->cb) { xio_server->cb(xio_server, xio_server->user_arg); } globus_mutex_lock(&xio_server->mutex); { xio_server->state = GLOBUS_XIO_SERVER_STATE_CLOSED; /* dec refrence count then free. this makes sure we don't free while in a user callback */ GlobusIXIOServerDec(destroy_server, xio_server); } globus_mutex_unlock(&xio_server->mutex); if(destroy_server) { globus_l_xio_server_destroy(xio_server); } GlobusXIODebugInternalExit(); } /* * this is called locked */ globus_result_t globus_l_xio_close_server( globus_i_xio_server_t * xio_server) { int ctr; globus_result_t res = GLOBUS_SUCCESS; globus_result_t tmp_res; globus_callback_space_t space = GLOBUS_CALLBACK_GLOBAL_SPACE; GlobusXIOName(globus_l_xio_close_server); GlobusXIODebugInternalEnter(); for(ctr = 0; ctr < xio_server->stack_size; ctr++) { if(xio_server->entry[ctr].driver->server_destroy_func != NULL) { /* possible to lose a driver res, but you know.. so what? */ tmp_res = xio_server->entry[ctr].driver->server_destroy_func( xio_server->entry[ctr].server_handle); if(tmp_res != GLOBUS_SUCCESS) { res = GlobusXIOErrorWrapFailed("server_destroy", tmp_res); } } } if(!xio_server->blocking) { space = xio_server->space; } globus_i_xio_register_oneshot( NULL, globus_l_xio_server_close_kickout, (void *)xio_server, space); GlobusXIODebugInternalExit(); return res; } void globus_l_xio_server_close_cb( globus_xio_server_t server, void * user_arg) { globus_i_xio_blocking_t * info; info = (globus_i_xio_blocking_t *) user_arg; globus_mutex_lock(&info->mutex); { info->done = GLOBUS_TRUE; globus_cond_signal(&info->cond); } globus_mutex_unlock(&info->mutex); } void globus_l_server_accept_cb( globus_xio_server_t server, globus_xio_handle_t handle, globus_result_t result, void * user_arg) { globus_i_xio_blocking_t * info; GlobusXIOName(globus_l_xio_server_register_accept); GlobusXIODebugInternalEnter(); info = (globus_i_xio_blocking_t *) user_arg; globus_mutex_lock(&info->mutex); { info->error_obj = GlobusXIOResultToObj(result); info->accepted_handle = handle; info->done = GLOBUS_TRUE; globus_cond_signal(&info->cond); } globus_mutex_unlock(&info->mutex); GlobusXIODebugInternalExit(); } globus_result_t globus_l_xio_server_register_accept( globus_i_xio_op_t * xio_op) { globus_i_xio_server_t * xio_server; globus_result_t res = GLOBUS_SUCCESS; globus_bool_t free_server = GLOBUS_FALSE; GlobusXIOName(globus_l_xio_server_register_accept); GlobusXIODebugInternalEnter(); xio_server = xio_op->_op_server; globus_mutex_lock(&xio_server->mutex); { if(xio_server->state != GLOBUS_XIO_SERVER_STATE_OPEN && xio_server->state != GLOBUS_XIO_SERVER_STATE_COMPLETING) { res = GlobusXIOErrorInvalidState(xio_server->state); goto state_err; } xio_server->state = GLOBUS_XIO_SERVER_STATE_ACCEPTING; xio_server->outstanding_operations++; xio_op->type = GLOBUS_XIO_OPERATION_TYPE_ACCEPT; xio_op->state = GLOBUS_XIO_OP_STATE_OPERATING; xio_op->ref = 1; xio_op->cancel_cb = NULL; xio_op->canceled = 0; xio_op->progress = GLOBUS_TRUE; xio_op->_op_server_timeout_cb = xio_server->accept_timeout; xio_op->ndx = 0; xio_op->stack_size = xio_server->stack_size; xio_op->entry[0].prev_ndx = -1; xio_server->op = xio_op; /*i deal with timeout if there is one */ if(xio_op->_op_server_timeout_cb != NULL) { GlobusXIOOpInc(xio_op); globus_i_xio_timer_register_timeout( &globus_i_xio_timeout_timer, xio_op, &xio_op->progress, globus_l_xio_accept_timeout_callback, &xio_server->accept_timeout_period); } /* add a reference to the server for the op */ xio_server->ref++; } globus_mutex_unlock(&xio_server->mutex); /* add reference count for the pass. does not need to be done locked since no one has op until it is passed */ GlobusXIOOpInc(xio_op); res = globus_xio_driver_pass_accept(xio_op, globus_i_xio_server_accept_callback, NULL); if(res != GLOBUS_SUCCESS) { goto err; } globus_mutex_lock(&xio_server->mutex); { GlobusXIOOpDec(xio_op); if(xio_op->ref == 0) { GlobusIXIOServerDec(free_server, xio_server); globus_assert(!free_server); globus_free(xio_op); } } globus_mutex_unlock(&xio_server->mutex); GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; err: globus_mutex_lock(&xio_server->mutex); { GlobusXIOOpDec(xio_op); /* dec for the register */ globus_assert(xio_op->ref > 0); /* set op to invalid type */ xio_op->state = GLOBUS_XIO_OP_STATE_FINISHED; /* if a timeout was registered we must unregister it */ if(xio_op->_op_server_timeout_cb != NULL) { if(globus_i_xio_timer_unregister_timeout( &globus_i_xio_timeout_timer, xio_op)) { GlobusXIOOpDec(xio_op); globus_assert(xio_op->ref > 0); } } /* we dont dec the op here because its owned by the caller */ GlobusIXIOServerDec(free_server, xio_server); globus_assert(!free_server); } state_err: globus_mutex_unlock(&xio_server->mutex); GlobusXIODebugInternalExitWithError(); return res; } /************************************************************************** * API functions * ------------- *************************************************************************/ /* * initialize a server structure */ globus_result_t globus_xio_server_create( globus_xio_server_t * server, globus_xio_attr_t server_attr, globus_xio_stack_t stack) { globus_list_t * list; globus_i_xio_server_t * xio_server = NULL; globus_result_t res; int ctr; int stack_size; void * ds_attr = NULL; globus_i_xio_op_t * xio_op = NULL; globus_xio_contact_t contact_info; GlobusXIOName(globus_xio_server_create); GlobusXIODebugEnter(); if(server == NULL) { res = GlobusXIOErrorParameter("server"); goto err_parm; } if(stack == NULL) { res = GlobusXIOErrorParameter("stack"); goto err_parm; } if(globus_list_empty(stack->driver_stack)) { res = GlobusXIOErrorParameter("stack is empty"); goto err_parm; } /* take what the user stack has at the time of registration */ stack_size = globus_list_size(stack->driver_stack); xio_op = (globus_i_xio_op_t *) globus_calloc(1, sizeof(globus_i_xio_op_t) + (sizeof(globus_i_xio_op_entry_t) * (stack_size - 1))); if(xio_op == NULL) { res = GlobusXIOErrorMemory("operation"); goto err; } xio_server = (globus_i_xio_server_t *) globus_calloc(1, sizeof(globus_i_xio_server_t) + (sizeof(globus_i_xio_server_entry_t) * (stack_size - 1))); if(xio_server == NULL) { res = GlobusXIOErrorMemory("server"); goto err; } xio_server->stack_size = globus_list_size(stack->driver_stack); xio_server->ref = 1; xio_server->state = GLOBUS_XIO_SERVER_STATE_OPEN; xio_server->space = GLOBUS_CALLBACK_GLOBAL_SPACE; globus_mutex_init(&xio_server->mutex, NULL); xio_server->accept_timeout = NULL; /* timeout handling */ if(server_attr != NULL) { if(server_attr->accept_timeout_cb) { xio_server->accept_timeout = server_attr->accept_timeout_cb; GlobusTimeReltimeCopy( xio_server->accept_timeout_period, server_attr->accept_timeout_period); } xio_server->space = server_attr->space; } globus_callback_space_reference(xio_server->space); /* Only using this op for its index, really... things like state * don't matter to me. I will also be using the open_attr * field for the server attr. */ xio_op->type = GLOBUS_XIO_OPERATION_TYPE_SERVER_INIT; xio_op->_op_server = xio_server; xio_op->stack_size = xio_server->stack_size; /* walk through the stack and add each entry to the array */ ctr = 0; for(list = stack->driver_stack; !globus_list_empty(list); list = globus_list_rest(list)) { xio_server->entry[ctr].driver = (globus_xio_driver_t) globus_list_first(list); if(server_attr != NULL) { GlobusIXIOAttrGetDS(ds_attr, server_attr, \ xio_server->entry[ctr].driver); xio_op->entry[ctr].open_attr = ds_attr; } ctr++; } xio_op->ndx = xio_op->stack_size; memset(&contact_info, 0, sizeof(contact_info)); res = globus_xio_driver_pass_server_init(xio_op, &contact_info, NULL); if(res != GLOBUS_SUCCESS) { goto err; } globus_free(xio_op); globus_mutex_lock(&globus_i_xio_mutex); { globus_list_insert(&globus_i_xio_outstanding_servers_list, xio_server); } globus_mutex_unlock(&globus_i_xio_mutex); *server = xio_server; GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: if(xio_op) { globus_free(xio_op); } if(xio_server) { globus_mutex_destroy(&xio_server->mutex); globus_callback_space_destroy(xio_server->space); globus_free(xio_server); } *server = NULL; err_parm: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_server_get_contact_string( globus_xio_server_t server, char ** contact_string) { globus_result_t res; GlobusXIOName(globus_xio_server_get_contact_string); GlobusXIODebugEnter(); if(contact_string == NULL) { res = GlobusXIOErrorParameter("contact_string"); goto err; } *contact_string = NULL; if(server == NULL) { res = GlobusXIOErrorParameter("server"); goto err; } if(server->contact_string) { *contact_string = globus_libc_strdup(server->contact_string); if(!*contact_string) { res = GlobusXIOErrorMemory("contact_string"); goto err; } } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } /* * */ globus_result_t globus_xio_server_cntl( globus_xio_server_t server, globus_xio_driver_t driver, int cmd, ...) { globus_bool_t found = GLOBUS_FALSE; int ctr; globus_result_t res = GLOBUS_SUCCESS; va_list ap; globus_i_xio_server_t * xio_server; GlobusXIOName(globus_xio_server_cntl); GlobusXIODebugEnter(); if(server == NULL) { res = GlobusXIOErrorParameter("server"); goto err; } xio_server = (globus_i_xio_server_t *) server; globus_mutex_lock(&xio_server->mutex); { if(driver == NULL) { /* do general things */ } else { for(ctr = 0; !found && ctr < xio_server->stack_size; ctr++) { if(xio_server->entry[ctr].driver == driver) { found = GLOBUS_TRUE; va_start(ap, cmd); res = xio_server->entry[ctr].driver->server_cntl_func( xio_server->entry[ctr].server_handle, cmd, ap); va_end(ap); } } if(!found) { res = GlobusXIOErrorInvalidDriver(_XIOSL("not found")); } } } globus_mutex_unlock(&xio_server->mutex); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } /* * register an accept */ globus_result_t globus_xio_server_register_accept( globus_xio_server_t server, globus_xio_accept_callback_t cb, void * user_arg) { int tmp_size; globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_server_t * xio_server; globus_i_xio_op_t * xio_op = NULL; GlobusXIOName(globus_xio_server_register_accept); GlobusXIODebugEnter(); if(server == NULL) { return GlobusXIOErrorParameter("server"); } xio_server = (globus_i_xio_server_t *) server; tmp_size = sizeof(globus_i_xio_op_t) + (sizeof(globus_i_xio_op_entry_t) * (xio_server->stack_size - 1)); xio_op = (globus_i_xio_op_t *) globus_malloc(tmp_size); if(xio_op == NULL) { res = GlobusXIOErrorMemory("operation"); goto err; } memset(xio_op, '\0', tmp_size); xio_op->_op_accept_cb = cb; xio_op->user_arg = user_arg; xio_op->_op_server = xio_server; xio_op->stack_size = xio_server->stack_size; res = globus_l_xio_server_register_accept(xio_op); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: if(xio_op != NULL) { globus_free(xio_op); } GlobusXIODebugExitWithError(); return res; } /* * cancel the server */ globus_result_t globus_xio_server_cancel_accept( globus_xio_server_t server) { globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_server_t * xio_server; GlobusXIOName(globus_xio_server_cancel_accept); GlobusXIODebugEnter(); xio_server = (globus_i_xio_server_t *) server; globus_mutex_lock(&xio_server->mutex); { if(xio_server->state != GLOBUS_XIO_SERVER_STATE_ACCEPTING && xio_server->state != GLOBUS_XIO_SERVER_STATE_COMPLETING) { res = GlobusXIOErrorInvalidState(xio_server->state); } else if(xio_server->op->canceled) { res = GlobusXIOErrorCanceled(); } else { /* the callback is called locked. within it the driver is allowed limited functionality. by calling this locked can more efficiently pass the operation down the stack */ /* Cancel originates from user */ xio_server->op->canceled = 1; if(xio_server->op->cancel_cb) { globus_i_xio_op_entry_t * my_op; my_op = &xio_server->op->entry[xio_server->op->ndx - 1]; my_op->in_register = GLOBUS_TRUE; xio_server->op->cancel_cb(xio_server->op, xio_server->op->cancel_arg, GLOBUS_XIO_ERROR_CANCELED); my_op->in_register = GLOBUS_FALSE; } } } globus_mutex_unlock(&xio_server->mutex); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } globus_result_t globus_xio_server_accept( globus_xio_handle_t * out_handle, globus_xio_server_t server) { int tmp_size; globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_server_t * xio_server; globus_i_xio_op_t * xio_op; globus_i_xio_blocking_t * info; GlobusXIOName(globus_xio_server_accept); GlobusXIODebugEnter(); if(out_handle == NULL) { res = GlobusXIOErrorParameter("out_handle"); goto err; } *out_handle = NULL; if(server == NULL) { res = GlobusXIOErrorParameter("server"); goto err; } xio_server = (globus_i_xio_server_t *) server; tmp_size = sizeof(globus_i_xio_op_t) + (sizeof(globus_i_xio_op_entry_t) * (xio_server->stack_size - 1)); xio_op = (globus_i_xio_op_t *) globus_malloc(tmp_size); if(xio_op == NULL) { res = GlobusXIOErrorMemory("operation"); goto err; } memset(xio_op, '\0', tmp_size); info = globus_i_xio_blocking_alloc(); if(info == NULL) { res = GlobusXIOErrorMemory("internal strucature"); goto info_alloc_err; } xio_op->_op_accept_cb = globus_l_server_accept_cb; xio_op->user_arg = info; xio_op->_op_server = xio_server; xio_op->stack_size = xio_server->stack_size; xio_op->blocking = GLOBUS_TRUE; GlobusXIOCurrentBlockedThread(xio_op->blocked_thread); res = globus_l_xio_server_register_accept(xio_op); if(res != GLOBUS_SUCCESS) { goto register_error; } globus_mutex_lock(&info->mutex); { while(!info->done) { globus_cond_wait(&info->cond, &info->mutex); } } globus_mutex_unlock(&info->mutex); if(info->error_obj != NULL) { res = GlobusXIOObjToResult(info->error_obj); globus_i_xio_blocking_destroy(info); goto err; } *out_handle = info->accepted_handle; globus_i_xio_blocking_destroy(info); GlobusXIODebugExit(); return GLOBUS_SUCCESS; register_error: globus_i_xio_blocking_destroy(info); info_alloc_err: globus_free(xio_op); err: GlobusXIODebugExitWithError(); return res; } /* called locked */ globus_result_t globus_i_xio_server_close( globus_xio_server_t xio_server, globus_xio_server_callback_t cb, void * user_arg) { globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_i_xio_server_close); GlobusXIODebugInternalEnter(); if(xio_server->state == GLOBUS_XIO_SERVER_STATE_CLOSE_PENDING || xio_server->state == GLOBUS_XIO_SERVER_STATE_CLOSING || xio_server->state == GLOBUS_XIO_SERVER_STATE_CLOSED) { res = GlobusXIOErrorInvalidState(xio_server->state); } else { /* the callback is called locked. within it the driver is allowed limited functionality. by calling this locked can more efficiently pass the operation down the stack */ if(xio_server->op != NULL) { /* cancel originates from user */ xio_server->op->canceled = 1; if(xio_server->op->cancel_cb) { globus_i_xio_op_entry_t * my_op; my_op = &xio_server->op->entry[xio_server->op->ndx - 1]; my_op->in_register = GLOBUS_TRUE; xio_server->op->cancel_cb(xio_server->op, xio_server->op->cancel_arg, GLOBUS_XIO_ERROR_CANCELED); my_op->in_register = GLOBUS_FALSE; } } xio_server->cb = cb; xio_server->user_arg = user_arg; switch(xio_server->state) { case GLOBUS_XIO_SERVER_STATE_ACCEPTING: case GLOBUS_XIO_SERVER_STATE_COMPLETING: xio_server->state = GLOBUS_XIO_SERVER_STATE_CLOSE_PENDING; break; case GLOBUS_XIO_SERVER_STATE_OPEN: xio_server->state = GLOBUS_XIO_SERVER_STATE_CLOSING; globus_l_xio_close_server(xio_server); break; default: globus_assert(0); } } GlobusXIODebugInternalExit(); return res; } /* * destroy the server */ globus_result_t globus_xio_server_register_close( globus_xio_server_t server, globus_xio_server_callback_t cb, void * user_arg) { globus_i_xio_server_t * xio_server; globus_result_t res = GLOBUS_SUCCESS; GlobusXIOName(globus_xio_server_register_close); GlobusXIODebugEnter(); if(server == NULL) { res = GlobusXIOErrorParameter("server"); goto err; } xio_server = (globus_i_xio_server_t *) server; globus_mutex_lock(&xio_server->mutex); { if(xio_server->sd_monitor != NULL) { res = GlobusXIOErrorUnloaded(); } else { res = globus_i_xio_server_close(xio_server, cb, user_arg); } } globus_mutex_unlock(&xio_server->mutex); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } /* * destroy the server */ globus_result_t globus_xio_server_close( globus_xio_server_t server) { globus_i_xio_server_t * xio_server; globus_result_t res = GLOBUS_SUCCESS; globus_i_xio_blocking_t * info; GlobusXIOName(globus_xio_server_close); GlobusXIODebugEnter(); if(server == NULL) { res = GlobusXIOErrorParameter("server"); goto err; } info = globus_i_xio_blocking_alloc(); if(info == GLOBUS_NULL) { res = GlobusXIOErrorMemory("internal"); goto err; } xio_server = (globus_i_xio_server_t *) server; globus_mutex_lock(&info->mutex); { xio_server->blocking = GLOBUS_TRUE; res = globus_xio_server_register_close(xio_server, globus_l_xio_server_close_cb, info); if(res == GLOBUS_SUCCESS) { while(!info->done) { globus_cond_wait(&info->cond, &info->mutex); } } } globus_mutex_unlock(&info->mutex); globus_i_xio_blocking_destroy(info); if(res != GLOBUS_SUCCESS) { goto err; } GlobusXIODebugExit(); return GLOBUS_SUCCESS; err: GlobusXIODebugExitWithError(); return res; } #define GlobusLXioFreeNull(_member) \ { \ if((_member)) \ { \ globus_free((_member)); \ } \ } void globus_xio_contact_destroy( globus_xio_contact_t * contact_info) { GlobusXIOName(globus_xio_contact_destroy); GlobusXIODebugInternalEnter(); GlobusLXioFreeNull(contact_info->unparsed); GlobusLXioFreeNull(contact_info->resource); GlobusLXioFreeNull(contact_info->host); GlobusLXioFreeNull(contact_info->port); GlobusLXioFreeNull(contact_info->scheme); GlobusLXioFreeNull(contact_info->user); GlobusLXioFreeNull(contact_info->pass); GlobusLXioFreeNull(contact_info->subject); GlobusXIODebugInternalExit(); } static void globus_l_xio_decode_hex( char * s) { char * d; char t; if(!s || !(s = strchr(s, '%'))) { return; } d = s; while(*s) { t = *s; if(t == '%') { if(*(s + 1) == '%') { s++; } else if(isxdigit(*(s + 1)) && isxdigit(*(s + 2))) { char hexstring[3]; hexstring[0] = *(++s); hexstring[1] = *(++s); hexstring[2] = 0; t = (char) strtol(hexstring, NULL, 16); } } *d = t; s++; d++; } *d = 0; } /** * if enc is NULL, no encoding will be done, string will just be duplicated. * If it is non-NULL (but possibly empty) all characters in the * string, the '%', and 01-1F and 7F-FF will be encoded with the %hh method. * * every string returned by this func must be freed */ static char * globus_l_xio_encode_hex( const char * s, const char * enc) { char * e; char * encoded; static char hexchars[] = "0123456789ABCDEF"; if(!s) { return NULL; } if(!enc) { return globus_libc_strdup(s); } encoded = (char *) globus_malloc((3 * strlen(s) + 1) * sizeof(char)); if(encoded) { e = encoded; while(*s) { unsigned n = (unsigned) *s; if(n <= 0x1F || n >= 0x7F || *s == '%' || (*enc && strchr(enc, n))) { *(e++) = '%'; *(e++) = hexchars[n >> 4]; *(e++) = hexchars[n & 15]; s++; } else { *(e++) = *(s++); } } *e = 0; } return encoded; } /** * * -unparsed (up till end) * * if("://" before "/") * -scheme (up till "://") * if(^ "/") * -path (up till end) * else * if("@" before "/" or "<") * -user (up till ":" or "@") * if(^ ":") * -pass (up till "@") * if(^ "<") * -subject (up till ">:") * if(^ "[") * -host (up till "]") * else * -host (up till ":" or "/") * if(^ ":") * -port (up till "/") * if(^ "/") * -path (up till end) * else * if(^ "file:") * -path (up till end) * else if(":" before end and no invalid host chars) * -host (up till ":") * -port (up till end) * else * -path (up till end) * * XXX if its possible for plain filenames to contain a :, it really should be * preceded with file: */ globus_result_t globus_xio_contact_parse( globus_xio_contact_t * contact_info, const char * contact_string) { char * working; char * save = NULL; char * s; char * p; globus_bool_t decode = GLOBUS_TRUE; globus_result_t result; GlobusXIOName(globus_xio_contact_parse); GlobusXIODebugInternalEnter(); memset(contact_info, 0, sizeof(globus_xio_contact_t)); if(contact_string && *contact_string) { contact_info->unparsed = globus_libc_strdup(contact_string); if(!contact_info->unparsed) { goto error_alloc; } save = globus_libc_strdup(contact_string); if(!save) { goto error_alloc; } working = save; /* look for scheme */ for(s = working; *s && *s != ':' && *s != '/'; s++); if(*s == ':' && *(s + 1) == '/' && *(s + 2) == '/') { *s = 0; contact_info->scheme = globus_libc_strdup(working); if(!contact_info->scheme) { goto error_alloc; } working = s + 3; if(*working != '/') { /* look for user:pass */ for(s = working; *s && *s != '@' && *s != '<' && *s != '/'; s++); if(*s == '@') { p = s + 1; *s = 0; if((s = strchr(working, ':'))) { *(s++) = 0; if(*s) { contact_info->pass = globus_libc_strdup(s); if(!contact_info->pass) { goto error_alloc; } } } if(*working) { contact_info->user = globus_libc_strdup(working); if(!contact_info->user) { goto error_alloc; } } working = p; } /* look for subject */ if(*working == '<') { working++; s = strchr(working, '>'); if(!s) { result = GlobusXIOErrorContactString(_XIOSL("expecting >")); goto error_format; } *s = 0; if(*working) { contact_info->subject = globus_libc_strdup(working); if(!contact_info->subject) { goto error_alloc; } } working = s + 1; if(*working == ':') { working++; } } /* find host:port */ if(*working == '[') { working++; s = strchr(working, ']'); if(!s) { result = GlobusXIOErrorContactString("expecting ]"); goto error_format; } *(s++) = 0; } else { for(s = working; *s && *s != ':' && *s != '/'; s++); } if(*s == ':') { *(s++) = 0; if((p = strchr(s, '/'))) { *p = 0; } if(*s) { contact_info->port = globus_libc_strdup(s); if(!contact_info->port) { goto error_alloc; } } if(p) { s = p + 1; } else { /* no path, just end it here */ *s = 0; } } else if(*s == '/') { *(s++) = 0; } else if(*s) { result = GlobusXIOErrorContactString(_XIOSL("expecting : or /")); goto error_format; } if(*working) { contact_info->host = globus_libc_strdup(working); if(!contact_info->host) { goto error_alloc; } } working = s; } else { working++; } /* copy path portion */ if(*working) { contact_info->resource = globus_libc_strdup(working); if(!contact_info->resource) { goto error_alloc; } } } else { /* see if its file or host:port form */ if(strncmp(working, "file:", 5) == 0) { working += 5; if(*working) { contact_info->resource = globus_libc_strdup(working); if(!contact_info->resource) { goto error_alloc; } } contact_info->scheme = globus_libc_strdup("file"); if(!contact_info->scheme) { goto error_alloc; } } else if((s = strrchr(working, ':')) && !strpbrk(working, "\\/")) { *(s++) = 0; if(*s) { contact_info->port = globus_libc_strdup(s); if(!contact_info->port) { goto error_alloc; } } if(*working == '[') { working++; s = strchr(working, ']'); if(!s) { result = GlobusXIOErrorContactString(_XIOSL("expecting ]")); goto error_format; } *s = 0; } if(*working) { contact_info->host = globus_libc_strdup(working); if(!contact_info->host) { goto error_alloc; } } } else { decode = GLOBUS_FALSE; contact_info->resource = globus_libc_strdup(working); if(!contact_info->resource) { goto error_alloc; } contact_info->scheme = globus_libc_strdup("file"); if(!contact_info->scheme) { goto error_alloc; } } } /* don't decode anything that wasn't passed in as part of a url */ if(decode) { globus_l_xio_decode_hex(contact_info->resource); globus_l_xio_decode_hex(contact_info->host); globus_l_xio_decode_hex(contact_info->port); globus_l_xio_decode_hex(contact_info->scheme); globus_l_xio_decode_hex(contact_info->user); globus_l_xio_decode_hex(contact_info->pass); globus_l_xio_decode_hex(contact_info->subject); } /* XXX validate some of the fields */ globus_free(save); } GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; error_alloc: result = GlobusXIOErrorMemory("contact_info"); error_format: if(save) { globus_free(save); } globus_xio_contact_destroy(contact_info); GlobusXIODebugInternalExitWithError(); return result; } /* this is more than enough for the 7 possible fields now * be sure to update this if it can get bigger */ #define GLOBUS_L_XIO_LAYOUT_SIZE 20 /** * if an element within encode_chars is NULL, no encoding will be done for that * element. If it is non-NULL (but possibly empty) all characters in the * string, the '%', and 00-1F and 7F-FF will be encoded with the %hh method. */ globus_result_t globus_xio_contact_info_to_encoded_string( const globus_xio_contact_t * contact_info, const globus_xio_contact_t * encode_chars, char ** contact_string) { globus_bool_t path_only = GLOBUS_FALSE; globus_bool_t host_port_only = GLOBUS_FALSE; globus_xio_contact_t local_info; const char * layout[GLOBUS_L_XIO_LAYOUT_SIZE]; int i = GLOBUS_L_XIO_LAYOUT_SIZE; GlobusXIOName(globus_xio_contact_info_to_string); GlobusXIODebugInternalEnter(); if(encode_chars) { memset(&local_info, 0, sizeof(local_info)); local_info.resource = globus_l_xio_encode_hex( contact_info->resource, encode_chars->resource); local_info.host = globus_l_xio_encode_hex( contact_info->host, encode_chars->host); local_info.port = globus_l_xio_encode_hex( contact_info->port, encode_chars->port); local_info.scheme = globus_l_xio_encode_hex( contact_info->scheme, encode_chars->scheme); local_info.user = globus_l_xio_encode_hex( contact_info->user, encode_chars->user); local_info.pass = globus_l_xio_encode_hex( contact_info->pass, encode_chars->pass); local_info.subject = globus_l_xio_encode_hex( contact_info->subject, encode_chars->subject); contact_info = &local_info; } if(contact_info->resource && !contact_info->scheme && !contact_info->host) { path_only = GLOBUS_TRUE; } if(contact_info->host && contact_info->port && !contact_info->scheme && !contact_info->resource && !contact_info->user && !contact_info->subject) { host_port_only = GLOBUS_TRUE; } if(contact_info->resource) { if(path_only) { layout[--i] = contact_info->resource; } else { if(*contact_info->resource == '/') { layout[--i] = contact_info->resource + 1; layout[--i] = "/%2F"; } else { layout[--i] = contact_info->resource; layout[--i] = "/"; } } } if(contact_info->host) { if(contact_info->port) { layout[--i] = contact_info->port; layout[--i] = ":"; } if(strchr(contact_info->host, ':')) { layout[--i] = "]"; layout[--i] = contact_info->host; layout[--i] = "["; } else { layout[--i] = contact_info->host; } if(contact_info->subject) { layout[--i] = ">"; layout[--i] = contact_info->subject; layout[--i] = "<"; } if(contact_info->user) { layout[--i] = "@"; if(contact_info->pass) { layout[--i] = contact_info->pass; layout[--i] = ":"; } layout[--i] = contact_info->user; } } if(contact_info->scheme) { layout[--i] = "://"; layout[--i] = contact_info->scheme; } else if(!path_only && !host_port_only) { layout[--i] = "xio://"; } *contact_string = globus_libc_join( &layout[i], GLOBUS_L_XIO_LAYOUT_SIZE - i); if(encode_chars) { globus_xio_contact_destroy(&local_info); } GlobusXIODebugInternalExit(); return GLOBUS_SUCCESS; } globus_result_t globus_xio_contact_info_to_string( const globus_xio_contact_t * contact_info, char ** contact_string) { return globus_xio_contact_info_to_encoded_string( contact_info, NULL, contact_string); } globus_result_t globus_xio_contact_info_to_url( const globus_xio_contact_t * contact_info, char ** contact_string) { globus_xio_contact_t encode_chars; memset(&encode_chars, 0, sizeof(encode_chars)); encode_chars.resource = " \"#$&+,:;<=>?@[\\]^`{|}~!*"; encode_chars.user = "<> @:/\"'#"; encode_chars.pass = "<> @:/\"'#"; encode_chars.subject = "<> \"'#"; return globus_xio_contact_info_to_encoded_string( contact_info, &encode_chars, contact_string); } globus_xio-3.6/configure0000775000076400007640000252572312225614605012421 00000000000000#! /bin/sh # From configure.in Revision: 1.10.14.1 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="Makefile.am" ac_default_prefix=${GLOBUS_LOCATION:-/usr} # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT docdir GPT_LOCATION GPT_PKGCONFIG_DEPENDENCIES GPT_IS_2 GPT_CFLAGS GPT_PKG_CFLAGS GPT_INCLUDES GPT_EXTERNAL_INCLUDES GPT_EXTERNAL_LIBS GPT_LIBS GPT_LDFLAGS GPT_CONFIG_CFLAGS GPT_CONFIG_INCLUDES GPT_CONFIG_LIBS GPT_CONFIG_PKG_LIBS GPT_PGM_LINKS GPT_LIB_LINKS GPT_LINKTYPE builddir pkgconfdir pkgconffile pkgconffile_in WITHOUT_FLAVORS_TRUE WITHOUT_FLAVORS_FALSE GLOBUS_FLAVOR_NAME datarootdir CC CPP CFLAGS CPPFLAGS LD LDFLAGS CXX CXXCPP CXXFLAGS INSURE DOXYGEN F77 F77FLAGS F90 F90FLAGS AR ARFLAGS RANLIB PERL CROSS cross_compiling OBJEXT EXEEXT OBJECT_MODE setupdir testdir flavorincludedir pkgdir aclocaldir perlmoduledir doxygendir FILELIST_FILE GPT_MAJOR_VERSION GPT_MINOR_VERSION GPT_AGE_VERSION DIRT_TIMESTAMP DIRT_BRANCH_ID ENABLE_PROGRAMS_TRUE ENABLE_PROGRAMS_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os ac_ct_CC SED EGREP LN_S ECHO ac_ct_AR ac_ct_RANLIB STRIP ac_ct_STRIP ac_ct_CXX FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE XIO_BUILTIN_DIRS XIO_BUILTIN_LIBS BUILTIN_EXTENSIONS_DEC BUILTIN_EXTENSIONS_DEF DOXYFILE DOT HAVE_DOT lac_doxygen_srcdirs lac_doxygen_input_filter lac_doxygen_project lac_doxygen_output_tagfile lac_doxygen_tagfiles lac_doxygen_internal_tagfiles lac_doxygen_installdox lac_doxygen_file_patterns lac_doxygen_examples lac_doxygen_predefines LIBOBJS LTLIBOBJS' ac_subst_files='GLOBUS_LIBDIR_CHOICE GLOBUS_PERL_LIBDIR_CHOICE GLOBUS_SCRIPT_INITIALIZER GLOBUS_PERL_INITIALIZER' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static-only Don't do any dynamic linking --disable-programs Don't compile/link programs --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-doxygen=PATH Use Doxygen to generate doxygen. If specified, PATH is the path to the doxygen executable; otherwise it is autodiscovered --enable-internal-doc Generate Doxygen documentation for internal functions. Requires --enable-doxygen Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-flavor=FLAVOR Specify the globus build flavor or without-flavor for a flavor independent --with-docdir=DIR Install documentation in DIR [DATADIR/doc/PACKAGE] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # checking for the GLOBUS_LOCATION GLOBUS_LOCATION="${GLOBUS_LOCATION:-/usr}" GPT_LOCATION="${GPT_LOCATION:-${GLOBUS_LOCATION}}" # This is created in globus-bootstrap.sh . "${srcdir}/gptdata.sh" if test "x$GPT_BUILD_WITH_FLAVORS" = "xno"; then GLOBUS_FLAVOR_NAME="noflavor" fi eval_path() { _pathval="$1" _old_pathval="" while test "$_pathval" != "$_old_pathval"; do _old_pathval="$_pathval" eval "_pathval=\"$_pathval\"" done echo "$_pathval" } # Check whether --with-flavor or --without-flavor was given. if test "${with_flavor+set}" = set; then withval="$with_flavor" case $withval in no) NO_FLAVOR="yes" ;; yes) echo "Please specify a globus build flavor" >&2 exit 1 ;; *) if test "x$GLOBUS_FLAVOR_NAME" = "xnoflavor"; then echo "Warning: package doesn't build with flavors $withval ignored" >&2 echo "Warning: $withval ignored" >&2 else GLOBUS_FLAVOR_NAME=$withval if test ! -f "${GLOBUS_LOCATION}/share/globus/flavors/flavor_$GLOBUS_FLAVOR_NAME.gpt"; then echo "ERROR: Flavor $GLOBUS_FLAVOR_NAME has not been installed" >&2 exit 1 fi fi ;; esac else if test "x$GLOBUS_FLAVOR_NAME" = "x"; then echo "Please specify a globus build flavor" >&2 exit 1 fi fi; GPT_LOCATION="${GPT_LOCATION:-${GLOBUS_LOCATION:-/usr}}" # Check whether --with-docdir or --without-docdir was given. if test "${with_docdir+set}" = set; then withval="$with_docdir" case $withval in yes|no) { { echo "$as_me:$LINENO: error: Invalid DIR" >&5 echo "$as_me: error: Invalid DIR" >&2;} { (exit 1); exit 1; }; } ;; *) docdir="$withval" ;; esac else if test -z "$docdir"; then docdir='${datadir}/doc/${PACKAGE}' fi fi; # bootstrap extracts the the name and version of the package from the # src metadata into gptdata.sh for easier processing . ${srcdir}/gptdata.sh GPT_VERSION="$GPT_MAJOR_VERSION.$GPT_MINOR_VERSION" # Determine if GPT is version 2.x GPT_IS_2="no" if test -f "$GPT_LOCATION/sbin/gpt-build"; then GPT_IS_2="yes" fi #Default to shared, before checking static-only GPT_LINKTYPE="shared" # We have to figure out if we're linking only static before build_config # Check whether --enable-static-only or --disable-static-only was given. if test "${enable_static_only+set}" = set; then enableval="$enable_static_only" case $enableval in no) GPT_LINKTYPE="shared" ;; yes) GPT_LINKTYPE="static" ;; *) echo "--enable-static-only has no arguments" >&2 exit 1 ;; esac fi; #extract the cumulative build environment from the installed development tree if $GPT_LOCATION/sbin/gpt_build_config -src $srcdir/pkgdata/pkg_data_src.gpt.in -f $GLOBUS_FLAVOR_NAME -link $GPT_LINKTYPE; then echo "Dependencies Complete"; else exit 1; fi # The following variables are used to manage the build enviroment # GPT_CFLAGS, GPT_INCLUDES, GPT_PGM_LINKS, GPT_LIB_LINKS, and GPT_LDFLAGS # are the variables used in the Makefile.am's # GPT_PKG_CFLAGS, GPT_EXTERNAL_INCLUDES and GPT_EXTERNAL_LIBS are stored # as build data in the packaging metadata file. # GPT_CONFIG_FLAGS, GPT_CONFIG_INCLUDES, GPT_CONFIG_PGM_LINKS, and # GPT_CONFIG_LIB_LINKS are returned by gpt_build_config and contain build # environment data from the dependent packages. . ./gpt_build_temp.sh rm ./gpt_build_temp.sh GPT_CFLAGS="$GPT_CONFIG_CFLAGS" GPT_INCLUDES="$GPT_CONFIG_INCLUDES" GPT_LIBS="$GPT_CONFIG_PKG_LIBS $GPT_CONFIG_LIBS" GPT_LDFLAGS="$GPT_CONFIG_STATIC_LINKLINE $GPT_LDFLAGS" GPT_PGM_LINKS="$GPT_CONFIG_PGM_LINKS $GPT_CONFIG_LIBS" GPT_LIB_LINKS="-version-info $GPT_MAJOR_VERSION:$GPT_MINOR_VERSION:$GPT_AGE_VERSION $GPT_CONFIG_LIB_LINKS $GPT_CONFIG_LIBS" builddir=`pwd` # Export pkg-config information about this package pkgconfdir='${libdir}/pkgconfig' pkgconffile=`echo "${GPT_NAME}.pc" | sed -e 's!_!-!g'` pkgconffile_in="pkg_data_src.pc.in" ac_config_files="$ac_config_files pkgdata/$pkgconffile:pkgdata/pkg_data_src.pc.in" if test "$NO_FLAVOR" = "yes"; then WITHOUT_FLAVORS_TRUE= WITHOUT_FLAVORS_FALSE='#' else WITHOUT_FLAVORS_TRUE='#' WITHOUT_FLAVORS_FALSE= fi # get the environment scripts . ${GLOBUS_LOCATION}/share/globus/globus-build-env-$GLOBUS_FLAVOR_NAME.sh initializer_prefix="${prefix}" test "$initializer_prefix" = "NONE" && initializer_prefix="$ac_default_prefix" initializer_exec_prefix="${exec_prefix}" test "$initializer_exec_prefix" = "NONE" && initializer_exec_prefix='${prefix}' test "$datarootdir" = "" && datarootdir='${prefix}/share' case $guess_libdir:${host}:${libdir} in 1:*linux*:*lib64) libdir32="${libdir%%64}" libdir64="${libdir}" libdir_choice=" case \`uname -m\` in aarch64|ppc64|s390x|sparc64|x86_64) libdir=\"$libdir64\" ;; *) libdir=\"$libdir32\" ;; esac " perl_libdir_choice=" if (\`uname -m\` =~ /^(aarch64|ppc64|s390x|sparc64|x86_64)\$/) { \$libdir = \"$libdir64\"; } else { \$libdir = \"$libdir32\"; } " ;; 1:*linux*:*lib) libdir32="${libdir}" libdir64="${libdir}64" libdir_choice=" case \`uname -m\` in aarch64|ppc64|s390x|sparc64|x86_64) libdir=\"$libdir64\" ;; *) libdir=\"$libdir32\" ;; esac " perl_libdir_choice=" if (\`uname -m\` =~ /^(aarch64|ppc64|s390x|sparc64|x86_64)\$/) { \$libdir = \"$libdir64\"; } else { \$libdir = \"$libdir32\"; } " ;; *) libdir_choice="libdir=\"$libdir\"" perl_libdir_choice=" \$libdir = \"$libdir\";"; ;; esac echo "$libdir_choice" | sed "s/\"/'/g" > globus-script-libdir-choice GLOBUS_LIBDIR_CHOICE="globus-script-libdir-choice" echo "$perl_libdir_choice" | sed "s/^ //" > globus-perl-libdir-choice GLOBUS_PERL_LIBDIR_CHOICE="globus-perl-libdir-choice" cat > globus-script-initializer << EOF if test -n "\${GLOBUS_LOCATION}" ; then prefix="\${GLOBUS_LOCATION}" else prefix="$initializer_prefix" fi exec_prefix="$initializer_exec_prefix" sbindir="$sbindir" bindir="$bindir" $libdir_choice includedir="$includedir" datarootdir="$datarootdir" datadir="$datadir" libexecdir="$libexecdir" sysconfdir="$sysconfdir" sharedstatedir="$sharedstatedir" localstatedir="$localstatedir" aclocaldir="$aclocaldir" EOF GLOBUS_SCRIPT_INITIALIZER=globus-script-initializer cat > globus-perl-initializer << EOF my (\$prefix, \$exec_prefix, \$libdir, \$perlmoduledir); my (\$sbindir, \$bindir, \$includedir, \$datarootdir, \$datadir, \$libexecdir, \$sysconfdir, \$sharedstatedir, \$localstatedir, \$aclocaldir); BEGIN { if (exists \$ENV{GLOBUS_LOCATION}) { \$prefix = \$ENV{GLOBUS_LOCATION}; } else { \$prefix = "$initializer_prefix"; } \$exec_prefix = "$initializer_exec_prefix"; $perl_libdir_choice \$sbindir = "$sbindir"; \$bindir = "$bindir"; \$includedir = "$includedir"; \$datarootdir = "$datarootdir"; \$datadir = "$datadir"; \$perlmoduledir = "$perlmoduledir"; \$libexecdir = "$libexecdir"; \$sysconfdir = "$sysconfdir"; \$sharedstatedir = "$sharedstatedir"; \$localstatedir = "$localstatedir"; \$aclocaldir = "$aclocaldir"; if (exists \$ENV{GPT_LOCATION}) { unshift(@INC, "\$ENV{GPT_LOCATION}/lib/perl"); } unshift(@INC, "\${perlmoduledir}"); } EOF GLOBUS_PERL_INITIALIZER=globus-perl-initializer doxygendir="`eval_path '$doxygendir'`" FILELIST_FILE=`pwd`; FILELIST_FILE="$FILELIST_FILE/pkgdata/master.filelist" if test -f $srcdir/dirt.sh ; then . $srcdir/dirt.sh else DIRT_TIMESTAMP=`perl -e 'print time'` DIRT_BRANCH_ID=99999 fi # Check whether --enable-programs or --disable-programs was given. if test "${enable_programs+set}" = set; then enableval="$enable_programs" case "${enableval}" in yes) ENABLE_PROGRAMS=true ;; no) ENABLE_PROGRAMS=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-programs" >&5 echo "$as_me: error: bad value ${enableval} for --enable-programs" >&2;} { (exit 1); exit 1; }; } ;; esac else ENABLE_PROGRAMS=true fi; if test "x$ENABLE_PROGRAMS" = "xtrue"; then ENABLE_PROGRAMS_TRUE= ENABLE_PROGRAMS_FALSE='#' else ENABLE_PROGRAMS_TRUE='#' ENABLE_PROGRAMS_FALSE= fi # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 3553 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5043:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6106: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6110: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6374: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6378: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6478: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6482: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 7947 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; solaris*) case $cc_basename in CC*) # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11287: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11291: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11391: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11395: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 11927 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12985: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12989: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13089: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13093: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 14538 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15316: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15320: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15584: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15588: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15688: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15692: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 17157 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion echo "$as_me:$LINENO: checking for -lnsl" >&5 echo $ECHO_N "checking for -lnsl... $ECHO_C" >&6 if test "${lac_cv_lnsl+set}" = set; then echo "$as_me:$LINENO: result: (cached) $lac_cv_lnsl" >&5 echo "${ECHO_T}(cached) $lac_cv_lnsl" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct hostent * host; host = gethostbyname("localhost"); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lac_cv_lnsl="no" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lac_cv_lnsl="yes" EXTERNAL_LIBS="$EXTERNAL_LIBS -lnsl" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $lac_cv_lnsl" >&5 echo "${ECHO_T}$lac_cv_lnsl" >&6 fi echo "$as_me:$LINENO: checking for -lsocket" >&5 echo $ECHO_N "checking for -lsocket... $ECHO_C" >&6 if test "${lac_cv_lsocket+set}" = set; then echo "$as_me:$LINENO: result: (cached) $lac_cv_lsocket" >&5 echo "${ECHO_T}(cached) $lac_cv_lsocket" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int fd; fd = socket(AF_INET,SOCK_STREAM,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lac_cv_lsocket="no" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lac_cv_lsocket="yes" EXTERNAL_LIBS="$EXTERNAL_LIBS -lsocket" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $lac_cv_lsocket" >&5 echo "${ECHO_T}$lac_cv_lsocket" >&6 fi GPT_LIBS_TMP="$EXTERNAL_LIBS -lm" GPT_EXTERNAL_LIBS="$GPT_EXTERNAL_LIBS $GPT_LIBS_TMP" GPT_LIB_LINKS=" $GPT_LIB_LINKS $GPT_LIBS_TMP" GPT_PGM_LINKS=" $GPT_PGM_LINKS $GPT_LIBS_TMP" am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=$GPT_NAME VERSION=$GPT_VERSION cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi echo -n "Checking for builtin drivers... " XIO_BUILTIN_DIRS= XIO_BUILTIN_DOXY_DIRS= XIO_BUILTIN_LIBS= BUILTIN_EXTENSIONS_DEC= BUILTIN_EXTENSIONS_DEF= builtins=`ls builtins | grep -v CVS | grep -v Makefile` if test "X$builtins" != "X" ; then echo for builtin in $builtins ; do if test -f builtins/$builtin/Makefile.in ; then XIO_BUILTIN_DIRS="$XIO_BUILTIN_DIRS $builtin" XIO_BUILTIN_DOXY_DIRS="$XIO_BUILTIN_DOXY_DIRS ../builtins/${builtin}" lib_name="builtins/${builtin}/libglobus_xio_${builtin}_driver.la" XIO_BUILTIN_LIBS="$XIO_BUILTIN_LIBS $lib_name" BUILTIN_EXTENSIONS_DEC="${BUILTIN_EXTENSIONS_DEC}GlobusXIODeclareModule(${builtin}); " BUILTIN_EXTENSIONS_DEF="$BUILTIN_EXTENSIONS_DEF {GlobusXIOExtensionName(${builtin}), GlobusXIOMyModule(${builtin})}," echo "Including driver: $builtin" fi done else echo "none found" fi CFLAGS="$CFLAGS -DGLOBUS_BUILTIN" # Check whether --enable-doxygen or --disable-doxygen was given. if test "${enable_doxygen+set}" = set; then enableval="$enable_doxygen" if test "$enableval" = "yes"; then # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_DOXYGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_DOXYGEN" && ac_cv_path_DOXYGEN=" { { echo "$as_me:$LINENO: error: Doxygen installation not found" >&5 echo "$as_me: error: Doxygen installation not found" >&2;} { (exit 1); exit 1; }; } " ;; esac fi DOXYGEN=$ac_cv_path_DOXYGEN if test -n "$DOXYGEN"; then echo "$as_me:$LINENO: result: $DOXYGEN" >&5 echo "${ECHO_T}$DOXYGEN" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else DOXYGEN="$enableval" fi else DOXYGEN="" fi; # Check whether --enable-internal-doc or --disable-internal-doc was given. if test "${enable_internal_doc+set}" = set; then enableval="$enable_internal_doc" DOXYFILE="Doxyfile-internal" else DOXYFILE="Doxyfile" fi; if test -n "$DOXYGEN" ; then # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_DOT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DOT="$DOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi DOT=$ac_cv_path_DOT if test -n "$DOT"; then echo "$as_me:$LINENO: result: $DOT" >&5 echo "${ECHO_T}$DOT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$GLOBUS_SH_PERL" ; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else PERL="$GLOBUS_SH_PERL" fi if test "$DOT" != ""; then HAVE_DOT=YES else HAVE_DOT=NO fi lac_doxygen_srcdirs="../ $XIO_BUILTIN_DOXY_DIRS" lac_doxygen_file_patterns="*.doc" lac_doxygen_input_filter="${GLOBUS_LOCATION:-/usr}/sbin/globus-vararg-enums-doxygen-filter.pl" lac_doxygen_project=`echo "$GPT_NAME" | sed -e 's/_/ /g'` lac_doxygen_output_tagfile=$GPT_NAME lac_dep_check="${GLOBUS_LOCATION:-$ac_default_prefix}/sbin/globus-build-doxygen-dependencies" if test ! -x $lac_dep_check ; then # assume we are dealing with common lac_dep_check="$srcdir/scripts/globus-build-doxygen-dependencies" chmod 0755 $lac_dep_check fi echo "$as_me:$LINENO: checking documentation dependencies" >&5 echo $ECHO_N "checking documentation dependencies... $ECHO_C" >&6 tagfiles="`$lac_dep_check -src $srcdir/pkgdata/pkg_data_src.gpt.in 2>/dev/null`" if test "$?" != "0"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 { { echo "$as_me:$LINENO: error: Documentation dependencies could not be satisfied." >&5 echo "$as_me: error: Documentation dependencies could not be satisfied." >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi lac_doxygen_tagfiles="" for x in "" $tagfiles; do if test "X$x" != "X" ; then lac_tag_base=`echo ${x} | sed -e 's|.*/||' -e 's|\.tag$||'` lac_tag="${lac_tag_base}.tag" lac_doxygen_tagfiles="$lac_doxygen_tagfiles $x" lac_doxygen_internal_tagfiles="$lac_doxygen_internal_tagfiles ${x}i" lac_html_dir=`echo ${x} | sed -e 's|.*/\(.*/html\)/.*|../../\1|'` lac_doxygen_installdox="$lac_doxygen_installdox -l${lac_tag}@${lac_html_dir}" fi done fi ac_config_headers="$ac_config_headers config.h" for ac_func in sysconf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile pkgdata/Makefile pkgdata/pkg_data_src.gpt builtins/Makefile doxygen/Makefile doxygen/Doxyfile doxygen/Doxyfile-internal version.h extensions.h builtins/file/Makefile builtins/http/Makefile builtins/mode_e/Makefile builtins/ordering/Makefile builtins/queue/Makefile builtins/tcp/Makefile builtins/telnet/Makefile builtins/udp/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITHOUT_FLAVORS_TRUE}" && test -z "${WITHOUT_FLAVORS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITHOUT_FLAVORS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITHOUT_FLAVORS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_PROGRAMS_TRUE}" && test -z "${ENABLE_PROGRAMS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_PROGRAMS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_PROGRAMS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "pkgdata/$pkgconffile" ) CONFIG_FILES="$CONFIG_FILES pkgdata/$pkgconffile:pkgdata/pkg_data_src.pc.in" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgdata/Makefile" ) CONFIG_FILES="$CONFIG_FILES pkgdata/Makefile" ;; "pkgdata/pkg_data_src.gpt" ) CONFIG_FILES="$CONFIG_FILES pkgdata/pkg_data_src.gpt" ;; "builtins/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/Makefile" ;; "doxygen/Makefile" ) CONFIG_FILES="$CONFIG_FILES doxygen/Makefile" ;; "doxygen/Doxyfile" ) CONFIG_FILES="$CONFIG_FILES doxygen/Doxyfile" ;; "doxygen/Doxyfile-internal" ) CONFIG_FILES="$CONFIG_FILES doxygen/Doxyfile-internal" ;; "version.h" ) CONFIG_FILES="$CONFIG_FILES version.h" ;; "extensions.h" ) CONFIG_FILES="$CONFIG_FILES extensions.h" ;; "builtins/file/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/file/Makefile" ;; "builtins/http/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/http/Makefile" ;; "builtins/mode_e/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/mode_e/Makefile" ;; "builtins/ordering/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/ordering/Makefile" ;; "builtins/queue/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/queue/Makefile" ;; "builtins/tcp/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/tcp/Makefile" ;; "builtins/telnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/telnet/Makefile" ;; "builtins/udp/Makefile" ) CONFIG_FILES="$CONFIG_FILES builtins/udp/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@docdir@,$docdir,;t t s,@GPT_LOCATION@,$GPT_LOCATION,;t t s,@GPT_PKGCONFIG_DEPENDENCIES@,$GPT_PKGCONFIG_DEPENDENCIES,;t t s,@GPT_IS_2@,$GPT_IS_2,;t t s,@GPT_CFLAGS@,$GPT_CFLAGS,;t t s,@GPT_PKG_CFLAGS@,$GPT_PKG_CFLAGS,;t t s,@GPT_INCLUDES@,$GPT_INCLUDES,;t t s,@GPT_EXTERNAL_INCLUDES@,$GPT_EXTERNAL_INCLUDES,;t t s,@GPT_EXTERNAL_LIBS@,$GPT_EXTERNAL_LIBS,;t t s,@GPT_LIBS@,$GPT_LIBS,;t t s,@GPT_LDFLAGS@,$GPT_LDFLAGS,;t t s,@GPT_CONFIG_CFLAGS@,$GPT_CONFIG_CFLAGS,;t t s,@GPT_CONFIG_INCLUDES@,$GPT_CONFIG_INCLUDES,;t t s,@GPT_CONFIG_LIBS@,$GPT_CONFIG_LIBS,;t t s,@GPT_CONFIG_PKG_LIBS@,$GPT_CONFIG_PKG_LIBS,;t t s,@GPT_PGM_LINKS@,$GPT_PGM_LINKS,;t t s,@GPT_LIB_LINKS@,$GPT_LIB_LINKS,;t t s,@GPT_LINKTYPE@,$GPT_LINKTYPE,;t t s,@builddir@,$builddir,;t t s,@pkgconfdir@,$pkgconfdir,;t t s,@pkgconffile@,$pkgconffile,;t t s,@pkgconffile_in@,$pkgconffile_in,;t t s,@WITHOUT_FLAVORS_TRUE@,$WITHOUT_FLAVORS_TRUE,;t t s,@WITHOUT_FLAVORS_FALSE@,$WITHOUT_FLAVORS_FALSE,;t t s,@GLOBUS_FLAVOR_NAME@,$GLOBUS_FLAVOR_NAME,;t t s,@datarootdir@,$datarootdir,;t t s,@CC@,$CC,;t t s,@CPP@,$CPP,;t t s,@CFLAGS@,$CFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@LD@,$LD,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CXX@,$CXX,;t t s,@CXXCPP@,$CXXCPP,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@INSURE@,$INSURE,;t t s,@DOXYGEN@,$DOXYGEN,;t t s,@F77@,$F77,;t t s,@F77FLAGS@,$F77FLAGS,;t t s,@F90@,$F90,;t t s,@F90FLAGS@,$F90FLAGS,;t t s,@AR@,$AR,;t t s,@ARFLAGS@,$ARFLAGS,;t t s,@RANLIB@,$RANLIB,;t t s,@PERL@,$PERL,;t t s,@CROSS@,$CROSS,;t t s,@cross_compiling@,$cross_compiling,;t t s,@OBJEXT@,$OBJEXT,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJECT_MODE@,$OBJECT_MODE,;t t s,@setupdir@,$setupdir,;t t s,@testdir@,$testdir,;t t s,@flavorincludedir@,$flavorincludedir,;t t s,@pkgdir@,$pkgdir,;t t s,@aclocaldir@,$aclocaldir,;t t s,@perlmoduledir@,$perlmoduledir,;t t s,@doxygendir@,$doxygendir,;t t s,@FILELIST_FILE@,$FILELIST_FILE,;t t s,@GPT_MAJOR_VERSION@,$GPT_MAJOR_VERSION,;t t s,@GPT_MINOR_VERSION@,$GPT_MINOR_VERSION,;t t s,@GPT_AGE_VERSION@,$GPT_AGE_VERSION,;t t s,@DIRT_TIMESTAMP@,$DIRT_TIMESTAMP,;t t s,@DIRT_BRANCH_ID@,$DIRT_BRANCH_ID,;t t s,@ENABLE_PROGRAMS_TRUE@,$ENABLE_PROGRAMS_TRUE,;t t s,@ENABLE_PROGRAMS_FALSE@,$ENABLE_PROGRAMS_FALSE,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@SED@,$SED,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@XIO_BUILTIN_DIRS@,$XIO_BUILTIN_DIRS,;t t s,@XIO_BUILTIN_LIBS@,$XIO_BUILTIN_LIBS,;t t s,@BUILTIN_EXTENSIONS_DEC@,$BUILTIN_EXTENSIONS_DEC,;t t s,@BUILTIN_EXTENSIONS_DEF@,$BUILTIN_EXTENSIONS_DEF,;t t s,@DOXYFILE@,$DOXYFILE,;t t s,@DOT@,$DOT,;t t s,@HAVE_DOT@,$HAVE_DOT,;t t s,@lac_doxygen_srcdirs@,$lac_doxygen_srcdirs,;t t s,@lac_doxygen_input_filter@,$lac_doxygen_input_filter,;t t s,@lac_doxygen_project@,$lac_doxygen_project,;t t s,@lac_doxygen_output_tagfile@,$lac_doxygen_output_tagfile,;t t s,@lac_doxygen_tagfiles@,$lac_doxygen_tagfiles,;t t s,@lac_doxygen_internal_tagfiles@,$lac_doxygen_internal_tagfiles,;t t s,@lac_doxygen_installdox@,$lac_doxygen_installdox,;t t s,@lac_doxygen_file_patterns@,$lac_doxygen_file_patterns,;t t s,@lac_doxygen_examples@,$lac_doxygen_examples,;t t s,@lac_doxygen_predefines@,$lac_doxygen_predefines,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t /@GLOBUS_LIBDIR_CHOICE@/r $GLOBUS_LIBDIR_CHOICE s,@GLOBUS_LIBDIR_CHOICE@,,;t t /@GLOBUS_PERL_LIBDIR_CHOICE@/r $GLOBUS_PERL_LIBDIR_CHOICE s,@GLOBUS_PERL_LIBDIR_CHOICE@,,;t t /@GLOBUS_SCRIPT_INITIALIZER@/r $GLOBUS_SCRIPT_INITIALIZER s,@GLOBUS_SCRIPT_INITIALIZER@,,;t t /@GLOBUS_PERL_INITIALIZER@/r $GLOBUS_PERL_INITIALIZER s,@GLOBUS_PERL_INITIALIZER@,,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi