globus_gram_job_manager-13.53/0000775000076400007640000000000012145177165013376 500000000000000globus_gram_job_manager-13.53/globus_automake_pre0000644000076400007640000000120012055152374017252 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_gram_job_manager-13.53/logging.c0000666000076400007640000002207111662761025015111 00000000000000/* * Copyright 1999-2009 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_gram_job_manager.h" #include "globus_gsi_system_config.h" #include "globus_callout.h" #include "globus_callout_constants.h" #include "globus_gram_jobmanager_callout_error.h" #include globus_logging_handle_t globus_i_gram_job_manager_log_stdio; globus_logging_handle_t globus_i_gram_job_manager_log_sys; static globus_symboltable_t globus_l_gram_log_symboltable; static FILE * globus_l_gram_log_fp = NULL; globus_thread_key_t globus_i_gram_request_key; static globus_bool_t globus_l_gram_reopen_log; static void globus_l_gram_logging_close( void * user_arg); static void globus_l_gram_logging_write( globus_byte_t * buf, globus_size_t length, void * user_arg); globus_logging_module_t globus_l_gram_logging_module = { NULL, globus_l_gram_logging_write, globus_l_gram_logging_close, NULL }; int globus_gram_job_manager_logging_init( globus_gram_job_manager_config_t * config) { globus_result_t result = GLOBUS_SUCCESS; time_t now; struct tm * nowtm; int rc; if (config->syslog_enabled) { result = globus_logging_init( &globus_i_gram_job_manager_log_sys, NULL, 0, config->log_levels|GLOBUS_LOGGING_INLINE, &globus_logging_syslog_ng_module, NULL); if (result != GLOBUS_SUCCESS) { char * errstr = globus_error_print_friendly( globus_error_peek(result)); fprintf(stderr, "Error initializing logging: %s\n", errstr); exit(1); } } else { globus_i_gram_job_manager_log_sys = NULL; } rc = globus_symboltable_init( &globus_l_gram_log_symboltable, globus_hashtable_string_hash, globus_hashtable_string_keyeq); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "Error initializing logging: symboltable_init\n"); exit(1); } rc = globus_symboltable_create_scope(&globus_l_gram_log_symboltable); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "Error initializing logging: create scope\n"); exit(1); } rc = globus_i_gram_symbol_table_populate( config, &globus_l_gram_log_symboltable); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "Error initializing logging: symboltable_populate\n"); exit(1); } globus_l_gram_logging_module.header_func = globus_logging_stdio_ng_module.header_func; now = time(NULL); nowtm = gmtime(&now); result = globus_logging_init( &globus_i_gram_job_manager_log_stdio, NULL, 0, config->log_levels|GLOBUS_LOGGING_INLINE, &globus_l_gram_logging_module, (void *) config); if (result != GLOBUS_SUCCESS) { char * errstr = globus_error_print_friendly( globus_error_peek(result)); fprintf(stderr, "Error initializing logging: %s\n", errstr); exit(1); } return result; } /* globus_gram_job_manager_logging_init() */ void globus_gram_job_manager_logging_destroy(void) { if (globus_i_gram_job_manager_log_sys) { globus_logging_destroy(globus_i_gram_job_manager_log_sys); globus_i_gram_job_manager_log_sys = NULL; } if (globus_i_gram_job_manager_log_stdio) { globus_logging_destroy(globus_i_gram_job_manager_log_stdio); globus_i_gram_job_manager_log_stdio = NULL; } globus_symboltable_destroy( &globus_l_gram_log_symboltable); globus_l_gram_log_symboltable = NULL; } char * globus_gram_prepare_log_string( const char * instr) { char * outstr; int i = 0; if (instr == NULL) { return NULL; } outstr = malloc(2*strlen(instr) + 1); if (outstr == NULL) { return NULL; } while (*instr != 0) { if (*instr == '\n') { outstr[i++] = '\\'; outstr[i++] = 'n'; instr++; } else if (*instr == '\r') { outstr[i++] = '\\'; outstr[i++] = 'r'; instr++; } else if (*instr == '\\') { outstr[i++] = '\\'; outstr[i++] = '\\'; instr++; } else if (*instr == '"') { outstr[i++] = '\\'; outstr[i++] = '"'; instr++; } else { outstr[i++] = *(instr++); } } outstr[i++] = '\0'; return outstr; } /* globus_gram_prepare_log_string() */ void globus_i_job_manager_log_rotate(int sig) { globus_l_gram_reopen_log = GLOBUS_TRUE; } static void globus_l_gram_logging_write( globus_byte_t * buf, globus_size_t length, void * user_arg) { static char * DATE_SYMBOL = "DATE"; globus_gram_job_manager_config_t * config = user_arg; const char * log_pattern = NULL; time_t now; struct tm * now_tm; char now_str[9]; char * path = NULL; static char * last_path = NULL; int fd; int flags; int rc; globus_gram_jobmanager_request_t * request; globus_symboltable_t * symboltable; request = globus_thread_getspecific(globus_i_gram_request_key); if (request != NULL) { symboltable = &request->symbol_table; log_pattern = request->log_pattern; } else { symboltable = &globus_l_gram_log_symboltable; } if (log_pattern == NULL) { log_pattern = config->log_pattern; } if (log_pattern == NULL) { /* stdio logging was not enabled for the system or via the job rsl */ return; } now = time(NULL); now_tm = gmtime(&now); snprintf(now_str, 9, "%04d%02d%02d", now_tm->tm_year + 1900, now_tm->tm_mon + 1, now_tm->tm_mday); /* Create a new scope for this so that job RSL variables which conflict with * DATE_SYMBOL won't get clobbered and leak */ globus_symboltable_create_scope(symboltable); globus_symboltable_insert( symboltable, DATE_SYMBOL, now_str); globus_gram_job_manager_rsl_eval_string( symboltable, log_pattern, &path); globus_symboltable_remove_scope( symboltable); if (path == NULL) { /* Bad RSL Substitution? */ return; } if (last_path == NULL || globus_l_gram_reopen_log || strcmp(path, last_path) != 0) { globus_l_gram_reopen_log = GLOBUS_FALSE; if (last_path) { free(last_path); } last_path = path; path = NULL; if (globus_l_gram_log_fp != NULL) { freopen(last_path, "a", globus_l_gram_log_fp); } else { globus_l_gram_log_fp = fopen(last_path, "a"); if (globus_l_gram_log_fp) { setvbuf(globus_l_gram_log_fp, NULL, _IONBF, 0); } } if (globus_l_gram_log_fp) { fd = fileno(globus_l_gram_log_fp); flags = fcntl(fd, F_GETFD); if (flags >= 0) { flags |= FD_CLOEXEC; rc = fcntl(fd, F_SETFD, flags); } } } else { free(path); path = NULL; } if (globus_l_gram_log_fp) { fwrite(buf, length, 1, globus_l_gram_log_fp); } } /* globus_l_gram_logging_write() */ static void globus_l_gram_logging_close( void * user_arg) { if (globus_l_gram_log_fp != NULL) { fclose(globus_l_gram_log_fp); globus_l_gram_log_fp = NULL; } } /* globus_l_gram_logging_close() */ globus_gram_job_manager-13.53/rvf/0000775000076400007640000000000012145177165014173 500000000000000globus_gram_job_manager-13.53/rvf/rvf.y0000666000076400007640000003637212035562232015106 00000000000000%{ /* * Copyright 1999-2012 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_gram_protocol_constants.h" #include "globus_rsl_assist.h" #include "globus_rvf_parser.h" #include "globus_i_rvf.h" #include "globus_i_rvf.tab.h" #include "globus_i_rvf_scanner.h" int globus_i_rvf_error(YYLTYPE * lloc, globus_list_t **output, void * scanner, char * str); static const globus_rvf_record_t empty_record = { NULL, NULL, NULL, NULL, -1, -1, -1, -1 }; static const globus_i_rvf_aspect_t empty_aspect = { 0 }; static int globus_l_rvf_debug = 0; static void globus_l_rvf_validation_record_destroy( globus_rvf_record_t * record); static void globus_l_rvf_records_destroy(globus_list_t *records); static int globus_l_rvf_attr_match( void * datum, void * args); %} %pure-parser %error-verbose %locations %parse-param { globus_list_t ** output } %parse-param { void * scanner } %lex-param { void * scanner } %debug %start validation_file %union { int aspect_name; globus_bool_t bool_value; globus_rvf_record_t record; globus_i_rvf_aspect_t aspect; struct { enum {RVF_STRINGVAL, RVF_WHENVAL, RVF_BOOLVAL, RVF_EMPTYVAL } value_type; char *string_value; int when_value; globus_bool_t bool_value; } value; globus_list_t * validation_file; } %token RVF_TOKEN_ERROR RVF_TOKEN_COMMENT RVF_TOKEN_NEWLINE RVF_TOKEN_QUOTE /* Separate records by having a newline between them */ /* String value for some RVF aspects */ /* Aspect Name Tokens */ %token RVF_TOKEN_ATTRIBUTE %token RVF_TOKEN_DEFAULT %token RVF_TOKEN_DEFAULTWHEN %token RVF_TOKEN_DESCRIPTION %token RVF_TOKEN_PUBLISH %token RVF_TOKEN_REQUIREDWHEN %token RVF_TOKEN_VALIDWHEN %token RVF_TOKEN_VALUES %token RVF_TOKEN_TEXT /* Delimiter between aspect name and value */ %token RVF_TOKEN_ASPECT_DELIMITER /* When values */ %token RVF_TOKEN_SUBMIT %token RVF_TOKEN_RESTART %token RVF_TOKEN_STDIO_UPDATE %token RVF_TOKEN_BOOL %type records %type record %type aspect_list %type aspect %type aspect_name %type aspect_value quoted_value unquoted_value when_value when_value_list %destructor { if ($$.value_type == RVF_STRINGVAL && $$.string_value != NULL) { free($$.string_value); } } RVF_TOKEN_TEXT aspect_value quoted_value unquoted_value when_value when_value_list %destructor { globus_l_rvf_validation_record_destroy(&$$); } record aspect_list %destructor { globus_l_rvf_records_destroy($$); } records %% validation_file: optional_record_separator records optional_record_separator { while (!globus_list_empty($2)) { globus_list_t * node; globus_rvf_record_t *record; record = globus_list_remove(&$2, $2); if (record->attribute == NULL) { globus_l_rvf_validation_record_destroy(record); free(record); continue; } node = globus_list_search_pred( *output, globus_l_rvf_attr_match, record->attribute); if (node) { /* * Validation record already exists; override changed * values. */ globus_rvf_record_t * old_record; old_record = globus_list_first(node); if(record->description) { if(old_record->description) { free(old_record->description); } old_record->description = record->description; record->description = NULL; } if(record->default_value) { if(old_record->default_value) { free(old_record->default_value); } old_record->default_value = record->default_value; record->default_value = NULL; } if(record->enumerated_values) { if(old_record->enumerated_values) { free(old_record->enumerated_values); } old_record->enumerated_values = record->enumerated_values; record->enumerated_values = NULL; } if(record->required_when != -1) { old_record->required_when = record->required_when; } if(record->default_when != -1) { old_record->default_when = record->default_when; } if(record->valid_when != -1) { old_record->valid_when = record->valid_when; } if(record->publishable != -1) { old_record->publishable = record->publishable; } free(record); record = GLOBUS_NULL; } else { globus_list_insert(output, record); } } } | optional_record_separator { } | error { return 1; } records: records record_separator record { globus_rvf_record_t * record; record = malloc(sizeof(globus_rvf_record_t)); *record = $3; $$ = $1; globus_list_insert(&$$, record); } | record { globus_rvf_record_t * record; $$ = NULL; record = malloc(sizeof(globus_rvf_record_t)); *record = $1; globus_list_insert(&$$, record); } record: aspect_list { if ($1.attribute != NULL) { globus_rsl_assist_string_canonicalize($$.attribute); } $$ = $1; } optional_record_separator: /* empty */ | record_separator record_separator: RVF_TOKEN_NEWLINE record_separator | RVF_TOKEN_NEWLINE comment: RVF_TOKEN_COMMENT RVF_TOKEN_NEWLINE aspect_list: aspect aspect_list { $$ = $2; switch ($1.aspect) { case RVF_TOKEN_ATTRIBUTE: $$.attribute = $1.string_value; break; case RVF_TOKEN_DEFAULT: $$.default_value = $1.string_value; break; case RVF_TOKEN_DEFAULTWHEN: $$.default_when = $1.when_value; break; case RVF_TOKEN_DESCRIPTION: $$.description = $1.string_value; break; case RVF_TOKEN_PUBLISH: $$.publishable = $1.bool_value; break; case RVF_TOKEN_REQUIREDWHEN: $$.required_when = $1.when_value; break; case RVF_TOKEN_VALIDWHEN: $$.valid_when = $1.when_value; break; case RVF_TOKEN_VALUES: $$.enumerated_values = $1.string_value; break; } } | comment aspect_list { $$ = $2; } | comment { $$ = empty_record; } | aspect { $$ = empty_record; switch ($1.aspect) { case RVF_TOKEN_ATTRIBUTE: $$.attribute = $1.string_value; break; case RVF_TOKEN_DEFAULT: $$.default_value = $1.string_value; break; case RVF_TOKEN_DEFAULTWHEN: $$.default_when = $1.when_value; break; case RVF_TOKEN_DESCRIPTION: $$.description = $1.string_value; break; case RVF_TOKEN_PUBLISH: $$.publishable = $1.bool_value; break; case RVF_TOKEN_REQUIREDWHEN: $$.required_when = $1.when_value; break; case RVF_TOKEN_VALIDWHEN: $$.valid_when = $1.when_value; break; } } aspect: aspect_name aspect_delimiter aspect_value end_of_aspect { $$ = empty_aspect; switch ($1) { case RVF_TOKEN_ATTRIBUTE: case RVF_TOKEN_DEFAULT: case RVF_TOKEN_DESCRIPTION: case RVF_TOKEN_VALUES: if ($3.value_type == RVF_STRINGVAL) { $$.aspect = $1; $$.string_value = $3.string_value; } else if ($3.value_type == RVF_EMPTYVAL) { $$.aspect = $1; $$.string_value = NULL; } else { YYERROR; } break; case RVF_TOKEN_DEFAULTWHEN: case RVF_TOKEN_VALIDWHEN: case RVF_TOKEN_REQUIREDWHEN: if ($3.value_type == RVF_WHENVAL) { $$.aspect = $1; $$.when_value = $3.when_value; } else if ($3.value_type == RVF_EMPTYVAL) { $$.aspect = $1; $$.when_value = 0; } else { if ($3.value_type == RVF_STRINGVAL && $3.string_value != NULL) { free($3.string_value); $3.string_value = NULL; } YYERROR; } break; case RVF_TOKEN_PUBLISH: if ($3.value_type == RVF_BOOLVAL) { $$.aspect = $1; $$.bool_value = $3.bool_value; } else { if ($3.value_type == RVF_STRINGVAL && $3.string_value != NULL) { free($3.string_value); $3.string_value = NULL; } YYERROR; } break; } } aspect_name: RVF_TOKEN_ATTRIBUTE | RVF_TOKEN_DEFAULT | RVF_TOKEN_DESCRIPTION | RVF_TOKEN_VALUES | RVF_TOKEN_DEFAULTWHEN | RVF_TOKEN_VALIDWHEN | RVF_TOKEN_REQUIREDWHEN | RVF_TOKEN_PUBLISH { $$ = $1; } aspect_delimiter: RVF_TOKEN_ASPECT_DELIMITER aspect_value: RVF_TOKEN_QUOTE quoted_value RVF_TOKEN_QUOTE { $$ = $2; } | unquoted_value { $$ = $1; } | /* empty */ { $$.value_type = RVF_EMPTYVAL; } quoted_value: when_value_list { $$.value_type = RVF_WHENVAL; $$.when_value = $1.when_value; } | RVF_TOKEN_BOOL { $$.value_type = RVF_BOOLVAL; $$.bool_value = $1; } | RVF_TOKEN_TEXT { $$.value_type = RVF_STRINGVAL; $$.string_value = $1.string_value; } | /* empty */ { $$.value_type = RVF_EMPTYVAL; } unquoted_value: when_value_list { $$.value_type = RVF_WHENVAL; $$.when_value = $1.when_value; } | RVF_TOKEN_BOOL { $$.value_type = RVF_BOOLVAL; $$.bool_value = $1; } | RVF_TOKEN_TEXT { $$.value_type = RVF_STRINGVAL; $$.string_value = $1.string_value; } when_value_list: when_value when_value_list { $$.value_type = RVF_WHENVAL; $$.when_value = $1.when_value | $2.when_value; } | when_value { $$ = $1; } when_value: RVF_TOKEN_SUBMIT { $$.value_type = RVF_WHENVAL; $$.when_value = 1; } | RVF_TOKEN_RESTART { $$.value_type = RVF_WHENVAL; $$.when_value = 2; } | RVF_TOKEN_STDIO_UPDATE { $$.value_type = RVF_WHENVAL; $$.when_value = 4; } end_of_aspect: RVF_TOKEN_NEWLINE | RVF_TOKEN_COMMENT RVF_TOKEN_NEWLINE { } %% typedef struct globus_rvf_extra_s { char * path; char * err; } globus_rvf_extra_t; int globus_i_rvf_error(YYLTYPE * lloc, globus_list_t **output, void * scanner, char * str) { globus_rvf_extra_t * extra; extra = globus_i_rvf_get_extra(scanner); extra->err = globus_common_create_string( "unable to parse %s at line %d (token starting with <<<%.15s>>>) %s", extra->path, globus_i_rvf_get_lineno(scanner), globus_i_rvf_get_text(scanner), str); return 0; } static int globus_l_rvf_attr_match( void * datum, void * args) { globus_rvf_record_t * tmp = datum; return (strcmp(tmp->attribute, args) == 0); } /* globus_l_rvf_attr_match() */ static void globus_l_rvf_validation_record_destroy( globus_rvf_record_t * record) { if (record->attribute) { free(record->attribute); } if (record->description) { free(record->description); } if (record->default_value) { free(record->default_value); } if (record->enumerated_values) { free(record->enumerated_values); } } static void globus_l_rvf_records_destroy(globus_list_t *records) { globus_list_t * l = records; while (!globus_list_empty(l)) { globus_rvf_record_t * record; record = globus_list_remove(&l, l); globus_l_rvf_validation_record_destroy(record); } } /* globus_l_rvf_records_destroy() */ /* Public API of the parser: pass in a path, return a list of * rsl validation records. if an error occurs, returns a non-zero value * and sets errstr */ int globus_rvf_parse_file( char * path, globus_list_t **out, char ** errstr) { FILE * f = fopen(path, "r"); void * scanner; int rc; globus_rvf_extra_t extra; if (f == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_VALIDATION_FILE; *errstr = globus_common_create_string( "the job manager could not open the RSL attribute validation file \"%s\"", path ? path : "NULL"); return rc; } extra.path = path; extra.err = NULL; *errstr = NULL; globus_i_rvf_lex_init(&scanner); globus_i_rvf_set_extra(&extra, scanner); globus_i_rvf_set_debug(globus_l_rvf_debug, scanner); globus_i_rvf_set_in(f, scanner); rc = globus_i_rvf_parse(out, scanner); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_VALIDATION_FILE; *errstr = extra.err; } globus_i_rvf_lex_destroy(scanner); fclose(f); return rc; } /* globus_rvf_parse_file() */ globus_gram_job_manager-13.53/rvf/globus-rvf-edit0000777000076400007640000000733211714563241017054 00000000000000#! /bin/sh # # Copyright 1999-2012 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. # . ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer checker="${sbindir}/globus-rvf-check" usage() { echo "Usage: $(basename $0) -s|-l LRM|-f PATH" } while getopts "vhsl:f:" i; do case $i in s) path="${sysconfdir}/globus/gram/job-manager.rvf" ;; l) path="${sysconfdir}/globus/gram/${OPTARG}.rvf" ;; f) path="$OPTARG" ;; h) usage exit 0 ;; v) verbose=1 ;; *) usage exit 1 ;; esac done if [ -z "$path" ]; then usage exit 1 fi if [ ! -x "$checker" ]; then echo "Configuration error: Missing $checker" 1>&2 exit 1 fi if [ ! -w "$(dirname $path)" ]; then echo "Permission denied: unable to write to $(dirname $path)" 1>&2 exit 1 fi cleanup_tmp() { if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then rm -rf "$tmpdir" fi } trap "cleanup_tmp" 0 tmpdir="$(mktemp -d -t globus-rvf-edit.XXXXXX)" if [ $? != 0 ]; then tmpdir="${TMPDIR-/tmp}/globus-rvf-edit.$$" mkdir "$tmpdir" if [ $? != 0 ]; then echo "Unable to create temporary directory" 1>&2 exit 1 fi fi tmpfile="${tmpdir}/rvf.temp" if [ -r $path ]; then cp "$path" "${tmpfile}" else cat < "${tmpfile}" # # $(basename $path) # # RVF Record Format consists of the following without the leading # # Records are separated by blank lines # # Attribute: RSL-attribute-name # Description: "Description string" # string describing the attribute, within # # quotes, " must be escaped as \" # Default: "default value" # default value is an RSL value string # DefaultWhen: when-value # space-delimited sequence of zero or more # # of # # GLOBUS_GRAM_JOB_SUBMIT # # GLOBUS_GRAM_JOB_MANAGER_RESTART # # GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE # ValidWhen: when-value # same as DefaultWhen values # RequiredWhen: when-value # same as DefaultWhen values # Values: # space-delimited sequence of legal values # # for the rsl attribute (e.g. "yes no" # Publish: # valid values true or false, indicating # # whether # # scripts/create-rsl-documentation.pl will # # generate doc for this attribute # EOF fi while true; do ${VISUAL:-vi} "${tmpfile}" if [ $? != 0 ]; then echo "Error editing temp file" 1>&2 exit 1 fi "${checker}" ${vebose:+"-d"} "${tmpfile}" if [ $? != 0 ]; then printf "Edit again [yn]: " read answer if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then exit 1 fi else break fi done if [ -f "$path.bak" ]; then rm -f "$path.bak" fi if [ -f "$path" ]; then mv "$path" "$path.bak" fi mv "$tmpfile" "$path" globus_gram_job_manager-13.53/rvf/globus-rvf-check.80000666000076400007640000000462011714563241017344 00000000000000'\" t .\" Title: globus-rvf-check .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 02/07/2012 .\" Manual: University of Chicago .\" Source: University of Chicago .\" Language: English .\" .TH "GLOBUS\-RVF\-CHECK" "8" "02/07/2012" "University of Chicago" "University of Chicago" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" globus-rvf-check \- Edit a GRAM5 RSL validation file .SH "SYNOPSIS" .HP \w'\fBglobus\-rvf\-check\fR\ 'u \fBglobus\-rvf\-check\fR [\-h] [\-help] .HP \w'\fBglobus\-rvf\-check\fR\ 'u \fBglobus\-rvf\-check\fR [\-d] {\fIFILENAME\fR...} .SH "DESCRIPTION" .PP The \fBglobus\-rvf\-check\fR command is a utility which checks the syntax of a RSL validation file, and prints out parse errors when encountered\&. It can also parse the RVF file contents and then dump file\*(Aqs contents to stdout, after canonicalizing values and quoting\&. The exit code of \fBglobus\-rvf\-check\fR is 0 if all files specified on the command line exist and have no parse errors\&. .PP The full set of command\-line options to \fBglobus\-rvf\-check\fR consists of: .PP \fB\-h\fR, \fB\-help\fR, \fB\-\-help\fR .RS 4 Print command\-line option summary and exit .RE .PP \fB\-d\fR .RS 4 Dump the RVF contents to stdout\&. In the output, Each file which is parsed will be prefixed by an RVF comment which contains the input filename\&. If not specified, \fBglobus\-rvf\-check\fR just prints a diagnostic message to standard output indicating whether the file could be parsed\&. .RE globus_gram_job_manager-13.53/rvf/globus_rvf_check.c0000666000076400007640000001155011727405326017566 00000000000000/* * Copyright 1999-2012 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_rvf_parser.h" #include #include static void globus_l_free_record(void *value) { globus_rvf_record_t *record = value; if (record->attribute) { free(record->attribute); } if (record->description) { free(record->description); } if (record->default_value) { free(record->default_value); } if (record->enumerated_values) { free(record->enumerated_values); } free(record); } static void print_string_value(char * aspect, char * value) { printf("%s: ", aspect); if (strchr(value, '\n') != NULL) { putchar('"'); while (*value) { if (*value == '"') { putchar('\\'); } putchar(*value); value++; } putchar('"'); putchar('\n'); } else { printf("%s\n", value); } } static void print_when_value(char * aspect, int value) { printf("%s: ", aspect); if (value > 0) { if (value & 1) { printf("GLOBUS_GRAM_JOB_SUBMIT "); } if (value & 2) { printf("GLOBUS_GRAM_JOB_MANAGER_RESTART "); } if (value & 4) { printf("GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE "); } } putchar('\n'); } static void print_bool_value(char * aspect, int value) { printf("%s: %s\n", aspect, value ? "true" : "false"); } int main(int argc, char * argv[]) { int i; int rc = 0; int dump=0; globus_module_activate(GLOBUS_COMMON_MODULE); for (i = 1; i < argc; i++) { if ((strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "--help") == 0) || (strcmp(argv[i], "-help") == 0)) { printf("Usage: %s [-d|-help] RVF-FILE-PATH...\n", basename(argv[0])); goto done; } else if (strcmp(argv[i], "-d") == 0) { dump = 1; } else { break; } } for (; i < argc; i++) { int local_rc; globus_list_t *l=0; char * err; local_rc = globus_rvf_parse_file( argv[i], &l, &err); if (local_rc == 0) { if (dump) { globus_list_t * tmp; printf("# Parsed results from %s\n", argv[i]); tmp = l; for (tmp = l; tmp != NULL; tmp = globus_list_rest(tmp)) { globus_rvf_record_t *r; r = globus_list_first(tmp); print_string_value("Attribute", r->attribute); if (r->description) { print_string_value("Description", r->description); } if (r->default_value) { print_string_value("Default", r->default_value); } if (r->enumerated_values) { print_string_value("Values", r->enumerated_values); } if (r->required_when != -1) { print_when_value("RequiredWhen", r->required_when); } if (r->default_when != -1) { print_when_value("DefaultWhen", r->default_when); } if (r->valid_when != -1) { print_when_value("ValidWhen", r->valid_when); } print_bool_value("Publish", r->publishable); printf("\n"); } } else { printf("%s: ok [%d record%s]\n", argv[i], (int)globus_list_size(l), (int)globus_list_size(l)>1 ? "s" : ""); } globus_list_destroy_all(l, globus_l_free_record); } else { printf("%s\n", err); free(err); rc |= local_rc; } } done: globus_module_deactivate(GLOBUS_COMMON_MODULE); return rc; } globus_gram_job_manager-13.53/rvf/globus_rvf_parser.h0000666000076400007640000000632211714563241020010 00000000000000#ifndef GLOBUS_RVF_PARSER_H #define GLOBUS_RVF_PARSER_H 1 /* * Copyright 1999-2012 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" EXTERN_C_BEGIN #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * @defgroup globus_gram_job_manager_rsl_validation RSL Validation * RSL Validation * * Validates that a request's RSL contains only valid parameters, and that * all required parameters are defined. * * RSL Validation operates on an RSL, and one or more validation files. * The format of the validation files is defined in the * @ref globus_gram_job_manager_rsl_validation_file * section of the manual. */ /** * RSL Validation Record * @ingroup globus_gram_job_manager_rsl_validation * * Contains Information parsed from the validation file about a single * RSL parameter. */ typedef struct { /** The name of the RSL attribute this record refers to. */ char * attribute; /** * A textual description of the RSL parameter. This is not * used other than for debugging the parser. */ char * description; /** * Default value of the parameter to be inserted in the RSL * if the parameter is not present. */ char * default_value; /** * String containing an enumeration of legal values for the * RSL parameter. For example, for the grammyjob parameter, this * would be "collective independent". */ char * enumerated_values; /** * Bitwise or of values of the * globus_i_gram_job_manager_validation_when_t values, indicated * when, if ever, this RSL parameter is required. */ int required_when; /** * Bitwise or of values of the * globus_i_gram_job_manager_validation_when_t values, indicated * when, if ever, this RSL parameter's default value should be * inserted into the RSL. */ int default_when; /** * Bitwise or of values of the * globus_i_gram_job_manager_validation_when_t values, indicated * when, if ever, this RSL parameter is valid. */ int valid_when; /** * Boolean indicating whether this attribute should be published * in the MDS. */ globus_bool_t publishable; } globus_rvf_record_t; extern int globus_rvf_parse_file( char * rvf_path, globus_list_t ** out_attr_list, char ** error_string); #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ EXTERN_C_END #endif /* GLOBUS_RVF_PARSER_H */ globus_gram_job_manager-13.53/rvf/globus_i_rvf.h0000666000076400007640000000041011714563241016734 00000000000000#ifndef GLOBUS_I_RVF_H #define GLOBUS_I_RVF_H #include "globus_common.h" EXTERN_C_BEGIN typedef struct { int aspect; char *string_value; int when_value; globus_bool_t bool_value; } globus_i_rvf_aspect_t; EXTERN_C_END #endif /* GLOBUS_I_RVF_H */ globus_gram_job_manager-13.53/rvf/globus_i_rvf.tab.h0000666000076400007640000000747511727405326017526 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 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, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { RVF_TOKEN_ERROR = 258, RVF_TOKEN_COMMENT = 259, RVF_TOKEN_NEWLINE = 260, RVF_TOKEN_QUOTE = 261, RVF_TOKEN_ATTRIBUTE = 262, RVF_TOKEN_DEFAULT = 263, RVF_TOKEN_DEFAULTWHEN = 264, RVF_TOKEN_DESCRIPTION = 265, RVF_TOKEN_PUBLISH = 266, RVF_TOKEN_REQUIREDWHEN = 267, RVF_TOKEN_VALIDWHEN = 268, RVF_TOKEN_VALUES = 269, RVF_TOKEN_TEXT = 270, RVF_TOKEN_ASPECT_DELIMITER = 271, RVF_TOKEN_SUBMIT = 272, RVF_TOKEN_RESTART = 273, RVF_TOKEN_STDIO_UPDATE = 274, RVF_TOKEN_BOOL = 275 }; #endif /* Tokens. */ #define RVF_TOKEN_ERROR 258 #define RVF_TOKEN_COMMENT 259 #define RVF_TOKEN_NEWLINE 260 #define RVF_TOKEN_QUOTE 261 #define RVF_TOKEN_ATTRIBUTE 262 #define RVF_TOKEN_DEFAULT 263 #define RVF_TOKEN_DEFAULTWHEN 264 #define RVF_TOKEN_DESCRIPTION 265 #define RVF_TOKEN_PUBLISH 266 #define RVF_TOKEN_REQUIREDWHEN 267 #define RVF_TOKEN_VALIDWHEN 268 #define RVF_TOKEN_VALUES 269 #define RVF_TOKEN_TEXT 270 #define RVF_TOKEN_ASPECT_DELIMITER 271 #define RVF_TOKEN_SUBMIT 272 #define RVF_TOKEN_RESTART 273 #define RVF_TOKEN_STDIO_UPDATE 274 #define RVF_TOKEN_BOOL 275 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 70 "./rvf.y" { int aspect_name; globus_bool_t bool_value; globus_rvf_record_t record; globus_i_rvf_aspect_t aspect; struct { enum {RVF_STRINGVAL, RVF_WHENVAL, RVF_BOOLVAL, RVF_EMPTYVAL } value_type; char *string_value; int when_value; globus_bool_t bool_value; } value; globus_list_t * validation_file; } /* Line 1529 of yacc.c. */ #line 104 "./globus_i_rvf.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; } YYLTYPE; # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif globus_gram_job_manager-13.53/rvf/globus-rvf-edit-manual.xml0000666000076400007640000000512011714563241021114 00000000000000 globus-rvf-edit 8 University of Chicago Globus Toolkit globus-rvf-edit Edit a GRAM5 RSL validation file globus-rvf-edit -h globus-rvf-edit -s -l LRM -f PATH Description The globus-rvf-edit command is a utility which opens the default editor on a specified RSL validation file, and then, when editing completes, runs the globus-rvf-check command to verify that the RVF file syntax is correct. If a parse error occurs, the user will be given an option to rerun the editor or discard the modifications. The full set of command-line options to globus-rvf-edit consists of: Print command-line option summary and exit Edit of the site-specific RVF file, which provides override values applicable to all LRMs installed on the system. Edit the site-specific LRM overrides for the LRM named by the LRM parameter to the option. Edit the RVF file located at PATH globus_gram_job_manager-13.53/rvf/globus-rvf-edit.80000666000076400007640000000456611714563241017225 00000000000000'\" t .\" Title: globus-rvf-edit .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 02/07/2012 .\" Manual: University of Chicago .\" Source: University of Chicago .\" Language: English .\" .TH "GLOBUS\-RVF\-EDIT" "8" "02/07/2012" "University of Chicago" "University of Chicago" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" globus-rvf-edit \- Edit a GRAM5 RSL validation file .SH "SYNOPSIS" .HP \w'\fBglobus\-rvf\-edit\fR\ 'u \fBglobus\-rvf\-edit\fR [\-h] .HP \w'\fBglobus\-rvf\-edit\fR\ 'u \fBglobus\-rvf\-edit\fR [[\-s] | [\-l\ \fILRM\fR] | [\-f\ \fIPATH\fR]] .SH "DESCRIPTION" .PP The \fBglobus\-rvf\-edit\fR command is a utility which opens the default editor on a specified RSL validation file, and then, when editing completes, runs the \fBglobus\-rvf\-check\fR command to verify that the RVF file syntax is correct\&. If a parse error occurs, the user will be given an option to rerun the editor or discard the modifications\&. .PP The full set of command\-line options to \fBglobus\-rvf\-edit\fR consists of: .PP \fB\-h\fR .RS 4 Print command\-line option summary and exit .RE .PP \fB\-s\fR .RS 4 Edit of the site\-specific RVF file, which provides override values applicable to all LRMs installed on the system\&. .RE .PP \fB\-l \fR\fB\fILRM\fR\fR .RS 4 Edit the site\-specific LRM overrides for the LRM named by the \fILRM\fR parameter to the option\&. .RE .PP \fB\-f \fR\fB\fIPATH\fR\fR .RS 4 Edit the RVF file located at \fIPATH\fR .RE globus_gram_job_manager-13.53/rvf/rvf.l0000666000076400007640000001220611714563241015063 00000000000000%{ /* * Copyright 1999-2012 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_rvf_parser.h" #include "globus_i_rvf.h" #include "globus_i_rvf.tab.h" %} COMMENT_CHAR "#" COMMENT ({COMMENT_CHAR}[^\n]*) NEWLINE [\n] WHITESPACE [ \t\r]+ WHITESPACE_OR_NEWLINE [ \n\t\r]+ ASPECT_DELIMITER [:] QUOTE ["] BOOL "true"|"false" UNQUOTED_TEXT ([^"# \r\t\n][^\n#]*) QUOTED_TEXT ([\\]["]|[^"])* SUBMIT "GLOBUS_GRAM_JOB_SUBMIT" RESTART "GLOBUS_GRAM_JOB_MANAGER_RESTART" STDIO_UPDATE "GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE" WHEN_VALUE {SUBMIT}|{RESTART}|{STDIO_UPDATE} WHEN_TRAIL (({WHITESPACE}({WHEN_VALUE}{WHITESPACE})*)|(({WHITESPACE}{WHEN_VALUE})*))? QUOTED_WHEN_TRAIL ({WHITESPACE_OR_NEWLINE}({WHEN_VALUE}{WHITESPACE_OR_NEWLINE})*({WHEN_VALUE}?{WHITESPACE_OR_NEWLINE}?))? QUOTED_BOOL ({WHITESPACE}|{NEWLINE})*{BOOL}({WHITESPACE}|{NEWLINE})* %x DELIMITER VALUE QUOTED QUOTED_WHENVAL QUOTE_END VALUE_END %option reentrant %option prefix="globus_i_rvf_" %option yylineno %option noyywrap %option nounput %option bison-bridge %option bison-locations %% {COMMENT}/"\n" { return RVF_TOKEN_COMMENT; } {COMMENT} { BEGIN(VALUE_END); return RVF_TOKEN_COMMENT; } (?i:Attribute) { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_ATTRIBUTE; return RVF_TOKEN_ATTRIBUTE; } (?i:Default) { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_DEFAULT; return RVF_TOKEN_DEFAULT; } (?i:DefaultWhen) { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_DEFAULTWHEN; return RVF_TOKEN_DEFAULTWHEN; } (?i:Description) { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_DESCRIPTION; return RVF_TOKEN_DESCRIPTION; } (?i:Publish) { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_PUBLISH; return RVF_TOKEN_PUBLISH; } (?i:RequiredWhen) { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_REQUIREDWHEN; return RVF_TOKEN_REQUIREDWHEN; } (?i:ValidWhen) { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_VALIDWHEN; return RVF_TOKEN_VALIDWHEN; } (?i:Values) { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_VALUES; return RVF_TOKEN_VALUES; } {ASPECT_DELIMITER} { BEGIN(VALUE); return RVF_TOKEN_ASPECT_DELIMITER; } <*>{WHITESPACE} { ; } {NEWLINE} { BEGIN(INITIAL); return RVF_TOKEN_NEWLINE; } {SUBMIT}/{WHEN_TRAIL} { return RVF_TOKEN_SUBMIT; } {RESTART}/{WHEN_TRAIL} { return RVF_TOKEN_RESTART; } {STDIO_UPDATE}/{WHEN_TRAIL} { return RVF_TOKEN_STDIO_UPDATE; } {BOOL} { yylval->bool_value = (strstr(yytext, "true") != NULL); return RVF_TOKEN_BOOL; } {QUOTE} { BEGIN(QUOTED); return RVF_TOKEN_QUOTE; } {UNQUOTED_TEXT} { BEGIN(VALUE_END); yylval->value.value_type = RVF_STRINGVAL; yylval->value.string_value = strdup(yytext); return RVF_TOKEN_TEXT; } {QUOTED_BOOL} { yylval->bool_value = (strstr(yytext, "true") != NULL); BEGIN(QUOTE_END); return RVF_TOKEN_BOOL; } {SUBMIT}/{QUOTED_WHEN_TRAIL} { BEGIN(QUOTED_WHENVAL); return RVF_TOKEN_SUBMIT; } {STDIO_UPDATE}/{QUOTED_WHEN_TRAIL} { BEGIN(QUOTED_WHENVAL); return RVF_TOKEN_STDIO_UPDATE; } {RESTART}/{QUOTED_WHEN_TRAIL} { BEGIN(QUOTED_WHENVAL); return RVF_TOKEN_STDIO_UPDATE; } {QUOTED_TEXT} { int len = strlen(yytext); int i,j; yylval->value.value_type = RVF_STRINGVAL; yylval->value.string_value = malloc(len+1); for (i = 0, j = 0; i < len; i++) { if (yytext[i] == '\\' && yytext[i+1] == '"') { i++; yylval->value.string_value[j++] = '"'; } else { yylval->value.string_value[j++] = yytext[i]; } } yylval->value.string_value[j] = '\0'; BEGIN(QUOTE_END); return RVF_TOKEN_TEXT; } {QUOTE} { BEGIN(VALUE_END); return RVF_TOKEN_QUOTE; } {NEWLINE} { ; } <*>.|{NEWLINE} { return RVF_TOKEN_ERROR; } globus_gram_job_manager-13.53/rvf/globus-rvf-check-manual.xml0000666000076400007640000000457311714563241021257 00000000000000 globus-rvf-check 8 University of Chicago Globus Toolkit globus-rvf-check Edit a GRAM5 RSL validation file globus-rvf-check -h -help globus-rvf-check -d FILENAME Description The globus-rvf-check command is a utility which checks the syntax of a RSL validation file, and prints out parse errors when encountered. It can also parse the RVF file contents and then dump file's contents to stdout, after canonicalizing values and quoting. The exit code of globus-rvf-check is 0 if all files specified on the command line exist and have no parse errors. The full set of command-line options to globus-rvf-check consists of: Print command-line option summary and exit Dump the RVF contents to stdout. In the output, Each file which is parsed will be prefixed by an RVF comment which contains the input filename. If not specified, globus-rvf-check just prints a diagnostic message to standard output indicating whether the file could be parsed. globus_gram_job_manager-13.53/rvf/globus_i_rvf_tab.c0000666000076400007640000020261412035562232017563 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 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, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Using locations. */ #define YYLSP_NEEDED 1 /* Substitute the variable and function names. */ #define yyparse globus_i_rvf_parse #define yylex globus_i_rvf_lex #define yyerror globus_i_rvf_error #define yylval globus_i_rvf_lval #define yychar globus_i_rvf_char #define yydebug globus_i_rvf_debug #define yynerrs globus_i_rvf_nerrs #define yylloc globus_i_rvf_lloc /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { RVF_TOKEN_ERROR = 258, RVF_TOKEN_COMMENT = 259, RVF_TOKEN_NEWLINE = 260, RVF_TOKEN_QUOTE = 261, RVF_TOKEN_ATTRIBUTE = 262, RVF_TOKEN_DEFAULT = 263, RVF_TOKEN_DEFAULTWHEN = 264, RVF_TOKEN_DESCRIPTION = 265, RVF_TOKEN_PUBLISH = 266, RVF_TOKEN_REQUIREDWHEN = 267, RVF_TOKEN_VALIDWHEN = 268, RVF_TOKEN_VALUES = 269, RVF_TOKEN_TEXT = 270, RVF_TOKEN_ASPECT_DELIMITER = 271, RVF_TOKEN_SUBMIT = 272, RVF_TOKEN_RESTART = 273, RVF_TOKEN_STDIO_UPDATE = 274, RVF_TOKEN_BOOL = 275 }; #endif /* Tokens. */ #define RVF_TOKEN_ERROR 258 #define RVF_TOKEN_COMMENT 259 #define RVF_TOKEN_NEWLINE 260 #define RVF_TOKEN_QUOTE 261 #define RVF_TOKEN_ATTRIBUTE 262 #define RVF_TOKEN_DEFAULT 263 #define RVF_TOKEN_DEFAULTWHEN 264 #define RVF_TOKEN_DESCRIPTION 265 #define RVF_TOKEN_PUBLISH 266 #define RVF_TOKEN_REQUIREDWHEN 267 #define RVF_TOKEN_VALIDWHEN 268 #define RVF_TOKEN_VALUES 269 #define RVF_TOKEN_TEXT 270 #define RVF_TOKEN_ASPECT_DELIMITER 271 #define RVF_TOKEN_SUBMIT 272 #define RVF_TOKEN_RESTART 273 #define RVF_TOKEN_STDIO_UPDATE 274 #define RVF_TOKEN_BOOL 275 /* Copy the first part of user declarations. */ #line 1 "./rvf.y" /* * Copyright 1999-2012 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_gram_protocol_constants.h" #include "globus_rsl_assist.h" #include "globus_rvf_parser.h" #include "globus_i_rvf.h" #include "globus_i_rvf.tab.h" #include "globus_i_rvf_scanner.h" int globus_i_rvf_error(YYLTYPE * lloc, globus_list_t **output, void * scanner, char * str); static const globus_rvf_record_t empty_record = { NULL, NULL, NULL, NULL, -1, -1, -1, -1 }; static const globus_i_rvf_aspect_t empty_aspect = { 0 }; static int globus_l_rvf_debug = 0; static void globus_l_rvf_validation_record_destroy( globus_rvf_record_t * record); static void globus_l_rvf_records_destroy(globus_list_t *records); static int globus_l_rvf_attr_match( void * datum, void * args); /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 1 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 70 "./rvf.y" { int aspect_name; globus_bool_t bool_value; globus_rvf_record_t record; globus_i_rvf_aspect_t aspect; struct { enum {RVF_STRINGVAL, RVF_WHENVAL, RVF_BOOLVAL, RVF_EMPTYVAL } value_type; char *string_value; int when_value; globus_bool_t bool_value; } value; globus_list_t * validation_file; } /* Line 193 of yacc.c. */ #line 217 "./globus_i_rvf.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; } YYLTYPE; # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 216 of yacc.c. */ #line 242 "./globus_i_rvf.tab.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; YYLTYPE yyls; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 7 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 51 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 21 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 17 /* YYNRULES -- Number of rules. */ #define YYNRULES 43 /* YYNRULES -- Number of states. */ #define YYNSTATES 51 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 275 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 7, 9, 11, 15, 17, 19, 20, 22, 25, 27, 30, 33, 36, 38, 40, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 67, 69, 70, 72, 74, 76, 77, 79, 81, 83, 86, 88, 90, 92, 94, 96 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 22, 0, -1, 25, 23, 25, -1, 25, -1, 1, -1, 23, 26, 24, -1, 24, -1, 28, -1, -1, 26, -1, 5, 26, -1, 5, -1, 4, 5, -1, 29, 28, -1, 27, 28, -1, 27, -1, 29, -1, 30, 31, 32, 37, -1, 7, -1, 8, -1, 10, -1, 14, -1, 9, -1, 13, -1, 12, -1, 11, -1, 16, -1, 6, 33, 6, -1, 34, -1, -1, 35, -1, 20, -1, 15, -1, -1, 35, -1, 20, -1, 15, -1, 36, 35, -1, 36, -1, 17, -1, 18, -1, 19, -1, 5, -1, 4, 5, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 127, 127, 207, 209, 214, 223, 236, 244, 246, 249, 250, 253, 256, 287, 290, 293, 323, 394, 394, 394, 394, 395, 395, 395, 396, 401, 404, 407, 410, 415, 419, 423, 427, 432, 436, 440, 446, 450, 455, 459, 463, 469, 470 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "RVF_TOKEN_ERROR", "RVF_TOKEN_COMMENT", "RVF_TOKEN_NEWLINE", "RVF_TOKEN_QUOTE", "RVF_TOKEN_ATTRIBUTE", "RVF_TOKEN_DEFAULT", "RVF_TOKEN_DEFAULTWHEN", "RVF_TOKEN_DESCRIPTION", "RVF_TOKEN_PUBLISH", "RVF_TOKEN_REQUIREDWHEN", "RVF_TOKEN_VALIDWHEN", "RVF_TOKEN_VALUES", "RVF_TOKEN_TEXT", "RVF_TOKEN_ASPECT_DELIMITER", "RVF_TOKEN_SUBMIT", "RVF_TOKEN_RESTART", "RVF_TOKEN_STDIO_UPDATE", "RVF_TOKEN_BOOL", "$accept", "validation_file", "records", "record", "optional_record_separator", "record_separator", "comment", "aspect_list", "aspect", "aspect_name", "aspect_delimiter", "aspect_value", "quoted_value", "unquoted_value", "when_value_list", "when_value", "end_of_aspect", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 21, 22, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 28, 28, 28, 28, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 35, 35, 36, 36, 36, 37, 37 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 3, 1, 1, 3, 1, 1, 0, 1, 2, 1, 2, 2, 2, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 4, 11, 0, 3, 9, 10, 1, 0, 18, 19, 22, 20, 25, 24, 23, 21, 8, 6, 15, 7, 16, 0, 12, 2, 9, 14, 13, 26, 29, 5, 33, 36, 39, 40, 41, 35, 0, 28, 34, 38, 32, 31, 0, 30, 0, 42, 17, 37, 27, 43 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 3, 17, 18, 4, 5, 19, 20, 21, 22, 29, 37, 43, 38, 39, 40, 47 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -30 static const yytype_int8 yypact[] = { 9, -30, 7, 28, 35, -30, -30, -30, 25, -30, -30, -30, -30, -30, -30, -30, -30, 7, -30, 35, -30, 35, 16, -30, -30, 35, -30, -30, -30, 18, -30, -14, -30, -30, -30, -30, -30, 3, -30, -30, 8, -30, -30, 34, -30, 29, -30, -30, -30, -30, -30 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -30, -30, -30, 26, 24, -2, -30, 10, -30, -30, -30, -30, -30, -30, -29, -30, -30 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -9 static const yytype_int8 yytable[] = { 6, 41, 44, 33, 34, 35, 42, 45, 46, -8, 1, 48, 2, -8, 2, 25, -8, -8, -8, -8, -8, -8, -8, -8, 31, 33, 34, 35, 7, 26, 23, 27, 28, 32, 50, 33, 34, 35, 36, 8, 49, 24, 9, 10, 11, 12, 13, 14, 15, 16, 0, 30 }; static const yytype_int8 yycheck[] = { 2, 15, 31, 17, 18, 19, 20, 4, 5, 0, 1, 40, 5, 4, 5, 17, 7, 8, 9, 10, 11, 12, 13, 14, 6, 17, 18, 19, 0, 19, 5, 21, 16, 15, 5, 17, 18, 19, 20, 4, 6, 17, 7, 8, 9, 10, 11, 12, 13, 14, -1, 25 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 1, 5, 22, 25, 26, 26, 0, 4, 7, 8, 9, 10, 11, 12, 13, 14, 23, 24, 27, 28, 29, 30, 5, 25, 26, 28, 28, 16, 31, 24, 6, 15, 17, 18, 19, 20, 32, 34, 35, 36, 15, 20, 33, 35, 4, 5, 37, 35, 6, 5 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (&yylloc, output, scanner, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) #else # define YYLEX yylex (&yylval, &yylloc, scanner) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, Location, output, scanner); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, globus_list_t ** output, void * scanner) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, output, scanner) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; YYLTYPE const * const yylocationp; globus_list_t ** output; void * scanner; #endif { if (!yyvaluep) return; YYUSE (yylocationp); YYUSE (output); YYUSE (scanner); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, globus_list_t ** output, void * scanner) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, output, scanner) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; YYLTYPE const * const yylocationp; globus_list_t ** output; void * scanner; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, output, scanner); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) yytype_int16 *bottom; yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, globus_list_t ** output, void * scanner) #else static void yy_reduce_print (yyvsp, yylsp, yyrule, output, scanner) YYSTYPE *yyvsp; YYLTYPE *yylsp; int yyrule; globus_list_t ** output; void * scanner; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , output, scanner); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, yylsp, Rule, output, scanner); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, globus_list_t ** output, void * scanner) #else static void yydestruct (yymsg, yytype, yyvaluep, yylocationp, output, scanner) const char *yymsg; int yytype; YYSTYPE *yyvaluep; YYLTYPE *yylocationp; globus_list_t ** output; void * scanner; #endif { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (output); YYUSE (scanner); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { case 15: /* "RVF_TOKEN_TEXT" */ #line 114 "./rvf.y" { if ((yyvaluep->value).value_type == RVF_STRINGVAL && (yyvaluep->value).string_value != NULL) { free((yyvaluep->value).string_value); } }; #line 1208 "./globus_i_rvf.tab.c" break; case 23: /* "records" */ #line 122 "./rvf.y" { globus_l_rvf_records_destroy((yyvaluep->validation_file)); }; #line 1213 "./globus_i_rvf.tab.c" break; case 24: /* "record" */ #line 121 "./rvf.y" { globus_l_rvf_validation_record_destroy(&(yyvaluep->record)); }; #line 1218 "./globus_i_rvf.tab.c" break; case 28: /* "aspect_list" */ #line 121 "./rvf.y" { globus_l_rvf_validation_record_destroy(&(yyvaluep->record)); }; #line 1223 "./globus_i_rvf.tab.c" break; case 32: /* "aspect_value" */ #line 114 "./rvf.y" { if ((yyvaluep->value).value_type == RVF_STRINGVAL && (yyvaluep->value).string_value != NULL) { free((yyvaluep->value).string_value); } }; #line 1233 "./globus_i_rvf.tab.c" break; case 33: /* "quoted_value" */ #line 114 "./rvf.y" { if ((yyvaluep->value).value_type == RVF_STRINGVAL && (yyvaluep->value).string_value != NULL) { free((yyvaluep->value).string_value); } }; #line 1243 "./globus_i_rvf.tab.c" break; case 34: /* "unquoted_value" */ #line 114 "./rvf.y" { if ((yyvaluep->value).value_type == RVF_STRINGVAL && (yyvaluep->value).string_value != NULL) { free((yyvaluep->value).string_value); } }; #line 1253 "./globus_i_rvf.tab.c" break; case 35: /* "when_value_list" */ #line 114 "./rvf.y" { if ((yyvaluep->value).value_type == RVF_STRINGVAL && (yyvaluep->value).string_value != NULL) { free((yyvaluep->value).string_value); } }; #line 1263 "./globus_i_rvf.tab.c" break; case 36: /* "when_value" */ #line 114 "./rvf.y" { if ((yyvaluep->value).value_type == RVF_STRINGVAL && (yyvaluep->value).string_value != NULL) { free((yyvaluep->value).string_value); } }; #line 1273 "./globus_i_rvf.tab.c" break; default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (globus_list_t ** output, void * scanner); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (globus_list_t ** output, void * scanner) #else int yyparse (output, scanner) globus_list_t ** output; void * scanner; #endif #endif { /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /* Location data for the look-ahead symbol. */ YYLTYPE yylloc; int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[2]; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; yylsp = yyls; #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 0; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; YYLTYPE *yyls1 = yyls; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; *++yylsp = yylloc; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 127 "./rvf.y" { while (!globus_list_empty((yyvsp[(2) - (3)].validation_file))) { globus_list_t * node; globus_rvf_record_t *record; record = globus_list_remove(&(yyvsp[(2) - (3)].validation_file), (yyvsp[(2) - (3)].validation_file)); if (record->attribute == NULL) { globus_l_rvf_validation_record_destroy(record); free(record); continue; } node = globus_list_search_pred( *output, globus_l_rvf_attr_match, record->attribute); if (node) { /* * Validation record already exists; override changed * values. */ globus_rvf_record_t * old_record; old_record = globus_list_first(node); if(record->description) { if(old_record->description) { free(old_record->description); } old_record->description = record->description; record->description = NULL; } if(record->default_value) { if(old_record->default_value) { free(old_record->default_value); } old_record->default_value = record->default_value; record->default_value = NULL; } if(record->enumerated_values) { if(old_record->enumerated_values) { free(old_record->enumerated_values); } old_record->enumerated_values = record->enumerated_values; record->enumerated_values = NULL; } if(record->required_when != -1) { old_record->required_when = record->required_when; } if(record->default_when != -1) { old_record->default_when = record->default_when; } if(record->valid_when != -1) { old_record->valid_when = record->valid_when; } if(record->publishable != -1) { old_record->publishable = record->publishable; } free(record); record = GLOBUS_NULL; } else { globus_list_insert(output, record); } } ;} break; case 3: #line 207 "./rvf.y" { ;} break; case 4: #line 209 "./rvf.y" { return 1; ;} break; case 5: #line 214 "./rvf.y" { globus_rvf_record_t * record; record = malloc(sizeof(globus_rvf_record_t)); *record = (yyvsp[(3) - (3)].record); (yyval.validation_file) = (yyvsp[(1) - (3)].validation_file); globus_list_insert(&(yyval.validation_file), record); ;} break; case 6: #line 223 "./rvf.y" { globus_rvf_record_t * record; (yyval.validation_file) = NULL; record = malloc(sizeof(globus_rvf_record_t)); *record = (yyvsp[(1) - (1)].record); globus_list_insert(&(yyval.validation_file), record); ;} break; case 7: #line 236 "./rvf.y" { if ((yyvsp[(1) - (1)].record).attribute != NULL) { globus_rsl_assist_string_canonicalize((yyval.record).attribute); } (yyval.record) = (yyvsp[(1) - (1)].record); ;} break; case 13: #line 256 "./rvf.y" { (yyval.record) = (yyvsp[(2) - (2)].record); switch ((yyvsp[(1) - (2)].aspect).aspect) { case RVF_TOKEN_ATTRIBUTE: (yyval.record).attribute = (yyvsp[(1) - (2)].aspect).string_value; break; case RVF_TOKEN_DEFAULT: (yyval.record).default_value = (yyvsp[(1) - (2)].aspect).string_value; break; case RVF_TOKEN_DEFAULTWHEN: (yyval.record).default_when = (yyvsp[(1) - (2)].aspect).when_value; break; case RVF_TOKEN_DESCRIPTION: (yyval.record).description = (yyvsp[(1) - (2)].aspect).string_value; break; case RVF_TOKEN_PUBLISH: (yyval.record).publishable = (yyvsp[(1) - (2)].aspect).bool_value; break; case RVF_TOKEN_REQUIREDWHEN: (yyval.record).required_when = (yyvsp[(1) - (2)].aspect).when_value; break; case RVF_TOKEN_VALIDWHEN: (yyval.record).valid_when = (yyvsp[(1) - (2)].aspect).when_value; break; case RVF_TOKEN_VALUES: (yyval.record).enumerated_values = (yyvsp[(1) - (2)].aspect).string_value; break; } ;} break; case 14: #line 287 "./rvf.y" { (yyval.record) = (yyvsp[(2) - (2)].record); ;} break; case 15: #line 290 "./rvf.y" { (yyval.record) = empty_record; ;} break; case 16: #line 293 "./rvf.y" { (yyval.record) = empty_record; switch ((yyvsp[(1) - (1)].aspect).aspect) { case RVF_TOKEN_ATTRIBUTE: (yyval.record).attribute = (yyvsp[(1) - (1)].aspect).string_value; break; case RVF_TOKEN_DEFAULT: (yyval.record).default_value = (yyvsp[(1) - (1)].aspect).string_value; break; case RVF_TOKEN_DEFAULTWHEN: (yyval.record).default_when = (yyvsp[(1) - (1)].aspect).when_value; break; case RVF_TOKEN_DESCRIPTION: (yyval.record).description = (yyvsp[(1) - (1)].aspect).string_value; break; case RVF_TOKEN_PUBLISH: (yyval.record).publishable = (yyvsp[(1) - (1)].aspect).bool_value; break; case RVF_TOKEN_REQUIREDWHEN: (yyval.record).required_when = (yyvsp[(1) - (1)].aspect).when_value; break; case RVF_TOKEN_VALIDWHEN: (yyval.record).valid_when = (yyvsp[(1) - (1)].aspect).when_value; break; } ;} break; case 17: #line 323 "./rvf.y" { (yyval.aspect) = empty_aspect; switch ((yyvsp[(1) - (4)].aspect_name)) { case RVF_TOKEN_ATTRIBUTE: case RVF_TOKEN_DEFAULT: case RVF_TOKEN_DESCRIPTION: case RVF_TOKEN_VALUES: if ((yyvsp[(3) - (4)].value).value_type == RVF_STRINGVAL) { (yyval.aspect).aspect = (yyvsp[(1) - (4)].aspect_name); (yyval.aspect).string_value = (yyvsp[(3) - (4)].value).string_value; } else if ((yyvsp[(3) - (4)].value).value_type == RVF_EMPTYVAL) { (yyval.aspect).aspect = (yyvsp[(1) - (4)].aspect_name); (yyval.aspect).string_value = NULL; } else { YYERROR; } break; case RVF_TOKEN_DEFAULTWHEN: case RVF_TOKEN_VALIDWHEN: case RVF_TOKEN_REQUIREDWHEN: if ((yyvsp[(3) - (4)].value).value_type == RVF_WHENVAL) { (yyval.aspect).aspect = (yyvsp[(1) - (4)].aspect_name); (yyval.aspect).when_value = (yyvsp[(3) - (4)].value).when_value; } else if ((yyvsp[(3) - (4)].value).value_type == RVF_EMPTYVAL) { (yyval.aspect).aspect = (yyvsp[(1) - (4)].aspect_name); (yyval.aspect).when_value = 0; } else { if ((yyvsp[(3) - (4)].value).value_type == RVF_STRINGVAL && (yyvsp[(3) - (4)].value).string_value != NULL) { free((yyvsp[(3) - (4)].value).string_value); (yyvsp[(3) - (4)].value).string_value = NULL; } YYERROR; } break; case RVF_TOKEN_PUBLISH: if ((yyvsp[(3) - (4)].value).value_type == RVF_BOOLVAL) { (yyval.aspect).aspect = (yyvsp[(1) - (4)].aspect_name); (yyval.aspect).bool_value = (yyvsp[(3) - (4)].value).bool_value; } else { if ((yyvsp[(3) - (4)].value).value_type == RVF_STRINGVAL && (yyvsp[(3) - (4)].value).string_value != NULL) { free((yyvsp[(3) - (4)].value).string_value); (yyvsp[(3) - (4)].value).string_value = NULL; } YYERROR; } break; } ;} break; case 25: #line 396 "./rvf.y" { (yyval.aspect_name) = (yyvsp[(1) - (1)].aspect_name); ;} break; case 27: #line 404 "./rvf.y" { (yyval.value) = (yyvsp[(2) - (3)].value); ;} break; case 28: #line 407 "./rvf.y" { (yyval.value) = (yyvsp[(1) - (1)].value); ;} break; case 29: #line 410 "./rvf.y" { (yyval.value).value_type = RVF_EMPTYVAL; ;} break; case 30: #line 415 "./rvf.y" { (yyval.value).value_type = RVF_WHENVAL; (yyval.value).when_value = (yyvsp[(1) - (1)].value).when_value; ;} break; case 31: #line 419 "./rvf.y" { (yyval.value).value_type = RVF_BOOLVAL; (yyval.value).bool_value = (yyvsp[(1) - (1)].bool_value); ;} break; case 32: #line 423 "./rvf.y" { (yyval.value).value_type = RVF_STRINGVAL; (yyval.value).string_value = (yyvsp[(1) - (1)].value).string_value; ;} break; case 33: #line 427 "./rvf.y" { (yyval.value).value_type = RVF_EMPTYVAL; ;} break; case 34: #line 432 "./rvf.y" { (yyval.value).value_type = RVF_WHENVAL; (yyval.value).when_value = (yyvsp[(1) - (1)].value).when_value; ;} break; case 35: #line 436 "./rvf.y" { (yyval.value).value_type = RVF_BOOLVAL; (yyval.value).bool_value = (yyvsp[(1) - (1)].bool_value); ;} break; case 36: #line 440 "./rvf.y" { (yyval.value).value_type = RVF_STRINGVAL; (yyval.value).string_value = (yyvsp[(1) - (1)].value).string_value; ;} break; case 37: #line 446 "./rvf.y" { (yyval.value).value_type = RVF_WHENVAL; (yyval.value).when_value = (yyvsp[(1) - (2)].value).when_value | (yyvsp[(2) - (2)].value).when_value; ;} break; case 38: #line 450 "./rvf.y" { (yyval.value) = (yyvsp[(1) - (1)].value); ;} break; case 39: #line 455 "./rvf.y" { (yyval.value).value_type = RVF_WHENVAL; (yyval.value).when_value = 1; ;} break; case 40: #line 459 "./rvf.y" { (yyval.value).value_type = RVF_WHENVAL; (yyval.value).when_value = 2; ;} break; case 41: #line 463 "./rvf.y" { (yyval.value).value_type = RVF_WHENVAL; (yyval.value).when_value = 4; ;} break; case 43: #line 470 "./rvf.y" { ;} break; /* Line 1267 of yacc.c. */ #line 2014 "./globus_i_rvf.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; *++yylsp = yyloc; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (&yylloc, output, scanner, YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (&yylloc, output, scanner, yymsg); } else { yyerror (&yylloc, output, scanner, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } yyerror_range[0] = yylloc; if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, &yylloc, output, scanner); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; yyerror_range[0] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yyerror_range[0] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, output, scanner); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of the look-ahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (&yylloc, output, scanner, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, output, scanner); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, yylsp, output, scanner); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } #line 472 "./rvf.y" typedef struct globus_rvf_extra_s { char * path; char * err; } globus_rvf_extra_t; int globus_i_rvf_error(YYLTYPE * lloc, globus_list_t **output, void * scanner, char * str) { globus_rvf_extra_t * extra; extra = globus_i_rvf_get_extra(scanner); extra->err = globus_common_create_string( "unable to parse %s at line %d (token starting with <<<%.15s>>>) %s", extra->path, globus_i_rvf_get_lineno(scanner), globus_i_rvf_get_text(scanner), str); return 0; } static int globus_l_rvf_attr_match( void * datum, void * args) { globus_rvf_record_t * tmp = datum; return (strcmp(tmp->attribute, args) == 0); } /* globus_l_rvf_attr_match() */ static void globus_l_rvf_validation_record_destroy( globus_rvf_record_t * record) { if (record->attribute) { free(record->attribute); } if (record->description) { free(record->description); } if (record->default_value) { free(record->default_value); } if (record->enumerated_values) { free(record->enumerated_values); } } static void globus_l_rvf_records_destroy(globus_list_t *records) { globus_list_t * l = records; while (!globus_list_empty(l)) { globus_rvf_record_t * record; record = globus_list_remove(&l, l); globus_l_rvf_validation_record_destroy(record); } } /* globus_l_rvf_records_destroy() */ /* Public API of the parser: pass in a path, return a list of * rsl validation records. if an error occurs, returns a non-zero value * and sets errstr */ int globus_rvf_parse_file( char * path, globus_list_t **out, char ** errstr) { FILE * f = fopen(path, "r"); void * scanner; int rc; globus_rvf_extra_t extra; if (f == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_VALIDATION_FILE; *errstr = globus_common_create_string( "the job manager could not open the RSL attribute validation file \"%s\"", path ? path : "NULL"); return rc; } extra.path = path; extra.err = NULL; *errstr = NULL; globus_i_rvf_lex_init(&scanner); globus_i_rvf_set_extra(&extra, scanner); globus_i_rvf_set_debug(globus_l_rvf_debug, scanner); globus_i_rvf_set_in(f, scanner); rc = globus_i_rvf_parse(out, scanner); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_VALIDATION_FILE; *errstr = extra.err; } globus_i_rvf_lex_destroy(scanner); fclose(f); return rc; } /* globus_rvf_parse_file() */ globus_gram_job_manager-13.53/rvf/Makefile.am0000666000076400007640000000253011717111640016137 00000000000000noinst_LTLIBRARIES = libglobus_rvf.la sbin_PROGRAMS = globus-rvf-check sbin_SCRIPTS = globus-rvf-edit man_MANS = globus-rvf-edit.8 globus-rvf-check.8 libglobus_rvf_la_CPPFLAGS = $(GPT_CFLAGS) -I$(top_srcdir) libglobus_rvf_la_SOURCES = \ globus_i_rvf.tab.h globus_i_rvf_tab.c \ globus_i_rvf.h globus_rvf_parser.h \ globus_i_rvf_scanner.h lex.globus_i_rvf_.c globus_rvf_check_SOURCES=globus_rvf_check.c globus_rvf_check_LDADD=libglobus_rvf.la -lglobus_rsl_assist -lglobus_rsl -lglobus_common if REBUILD_PARSER # developed with bison 2.3 and uses some bison-specific features $(srcdir)/globus_i_rvf.tab.h $(srcdir)/globus_i_rvf_tab.c: $(srcdir)/rvf.y rm -f $(srcdir)/globus_i_rvf.tab.h $(srcdir)/globus_i_rvf_tab.c bison -d -b $(srcdir)/globus_i_rvf -p globus_i_rvf_ $(srcdir)/rvf.y mv $(srcdir)/globus_i_rvf.tab.c $(srcdir)/globus_i_rvf_tab.c endif if REBUILD_SCANNER # developed with flex 2.5.35 and uses flex-specific features $(srcdir)/lex.globus_i_rvf_.c $(srcdir)/globus_i_rvf_scanner.h: $(srcdir)/rvf.l rm -f $(srcdir)/globus_i_rvf_scanner.h $(srcdir)/lex.globus_i_rvf_.c flex -s -d \ -o $(srcdir)/lex.globus_i_rvf_.c \ --header-file=$(srcdir)/globus_i_rvf_scanner.h \ $(srcdir)/rvf.l endif EXTRA_DIST = rvf.l rvf.y globus-rvf-edit $(man_MANS) \ globus-rvf-edit-manual.xml globus-rvf-check-manual.xml globus_gram_job_manager-13.53/rvf/globus_i_rvf_scanner.h0000666000076400007640000002500012035562232020443 00000000000000#ifndef globus_i_rvf_HEADER_H #define globus_i_rvf_HEADER_H 1 #define globus_i_rvf_IN_HEADER 1 #line 6 "./globus_i_rvf_scanner.h" #line 8 "./globus_i_rvf_scanner.h" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ /* %not-for-header */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* %if-c++-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ /* %if-c-only */ #include #include #include #include /* %endif */ /* %if-tables-serialization */ /* %endif */ /* end standard C headers. */ /* %if-c-or-c++ */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ /* %endif */ /* %if-c++-only */ /* %endif */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* %not-for-header */ /* %not-for-header */ /* %if-reentrant */ /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define yyin yyg->yyin_r #define yyout yyg->yyout_r #define yyextra yyg->yyextra_r #define yyleng yyg->yyleng_r #define yytext yyg->yytext_r #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r /* %endif */ /* %if-not-reentrant */ /* %endif */ /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif /* %if-not-reentrant */ /* %endif */ /* %if-c-only */ /* %if-not-reentrant */ /* %endif */ /* %endif */ #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { /* %if-c-only */ FILE *yy_input_file; /* %endif */ /* %if-c++-only */ /* %endif */ char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ /* %endif */ /* %if-c-only Standard (non-C++) definition */ /* %if-not-reentrant */ /* %not-for-header */ /* %endif */ void globus_i_rvf_restart (FILE *input_file ,yyscan_t yyscanner ); void globus_i_rvf__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); YY_BUFFER_STATE globus_i_rvf__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); void globus_i_rvf__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void globus_i_rvf__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void globus_i_rvf_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); void globus_i_rvf_pop_buffer_state (yyscan_t yyscanner ); YY_BUFFER_STATE globus_i_rvf__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE globus_i_rvf__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE globus_i_rvf__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); /* %endif */ void *globus_i_rvf_alloc (yy_size_t ,yyscan_t yyscanner ); void *globus_i_rvf_realloc (void *,yy_size_t ,yyscan_t yyscanner ); void globus_i_rvf_free (void * ,yyscan_t yyscanner ); /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ #define globus_i_rvf_wrap(n) 1 #define YY_SKIP_YYWRAP #define FLEX_DEBUG #define yytext_ptr yytext_r /* %if-c-only Standard (non-C++) definition */ /* %endif */ #ifdef YY_HEADER_EXPORT_START_CONDITIONS #define INITIAL 0 #define DELIMITER 1 #define VALUE 2 #define QUOTED 3 #define QUOTED_WHENVAL 4 #define QUOTE_END 5 #define VALUE_END 6 #endif #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ /* %if-c-only */ #include /* %endif */ /* %if-c++-only */ /* %endif */ #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* %if-c-only Reentrant structure and macros (non-C++). */ /* %if-reentrant */ /* %if-c-only */ /* %endif */ /* %if-reentrant */ int globus_i_rvf_lex_init (yyscan_t* scanner); int globus_i_rvf_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); /* %endif */ /* %endif End reentrant structures and macros. */ /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int globus_i_rvf_lex_destroy (yyscan_t yyscanner ); int globus_i_rvf_get_debug (yyscan_t yyscanner ); void globus_i_rvf_set_debug (int debug_flag ,yyscan_t yyscanner ); YY_EXTRA_TYPE globus_i_rvf_get_extra (yyscan_t yyscanner ); void globus_i_rvf_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); FILE *globus_i_rvf_get_in (yyscan_t yyscanner ); void globus_i_rvf_set_in (FILE * in_str ,yyscan_t yyscanner ); FILE *globus_i_rvf_get_out (yyscan_t yyscanner ); void globus_i_rvf_set_out (FILE * out_str ,yyscan_t yyscanner ); yy_size_t globus_i_rvf_get_leng (yyscan_t yyscanner ); char *globus_i_rvf_get_text (yyscan_t yyscanner ); int globus_i_rvf_get_lineno (yyscan_t yyscanner ); void globus_i_rvf_set_lineno (int line_number ,yyscan_t yyscanner ); /* %if-bison-bridge */ YYSTYPE * globus_i_rvf_get_lval (yyscan_t yyscanner ); void globus_i_rvf_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *globus_i_rvf_get_lloc (yyscan_t yyscanner ); void globus_i_rvf_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); /* %endif */ /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int globus_i_rvf_wrap (yyscan_t yyscanner ); #else extern int globus_i_rvf_wrap (yyscan_t yyscanner ); #endif #endif /* %not-for-header */ /* %endif */ #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ /* %endif */ #endif /* %if-c-only */ /* %endif */ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* %if-tables-serialization structures and prototypes */ /* %not-for-header */ /* %not-for-header */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ extern int globus_i_rvf_lex \ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); #define YY_DECL int globus_i_rvf_lex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* !YY_DECL */ /* %not-for-header */ /* %if-c++-only */ /* %not-for-header */ /* %endif */ /* yy_get_previous_state - get the state just before the EOB char was reached */ /* %if-c-only */ /* %not-for-header */ #undef YY_NEW_FILE #undef YY_FLUSH_BUFFER #undef yy_set_bol #undef yy_new_buffer #undef yy_set_interactive #undef YY_DO_BEFORE_ACTION #ifdef YY_DECL_IS_OURS #undef YY_DECL_IS_OURS #undef YY_DECL #endif #line 210 "./rvf.l" #line 468 "./globus_i_rvf_scanner.h" #undef globus_i_rvf_IN_HEADER #endif /* globus_i_rvf_HEADER_H */ globus_gram_job_manager-13.53/rvf/Makefile.in0000664000076400007640000007123312145177133016161 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@ sbin_PROGRAMS = globus-rvf-check$(EXEEXT) subdir = rvf DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 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_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libglobus_rvf_la_LIBADD = am_libglobus_rvf_la_OBJECTS = libglobus_rvf_la-globus_i_rvf_tab.lo \ libglobus_rvf_la-lex.globus_i_rvf_.lo libglobus_rvf_la_OBJECTS = $(am_libglobus_rvf_la_OBJECTS) am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man8dir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_globus_rvf_check_OBJECTS = globus_rvf_check.$(OBJEXT) globus_rvf_check_OBJECTS = $(am_globus_rvf_check_OBJECTS) globus_rvf_check_DEPENDENCIES = libglobus_rvf.la sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(sbin_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles 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_rvf_la_SOURCES) $(globus_rvf_check_SOURCES) DIST_SOURCES = $(libglobus_rvf_la_SOURCES) $(globus_rvf_check_SOURCES) man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) 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@ AUDITDIR = @AUDITDIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ 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@ GENERATE_MANPAGES_FALSE = @GENERATE_MANPAGES_FALSE@ GENERATE_MANPAGES_TRUE = @GENERATE_MANPAGES_TRUE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GLOBUS_TOOLKIT_VERSION = @GLOBUS_TOOLKIT_VERSION@ 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@ LOGDIR = @LOGDIR@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ 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@ REBUILD_PARSER_FALSE = @REBUILD_PARSER_FALSE@ REBUILD_PARSER_TRUE = @REBUILD_PARSER_TRUE@ REBUILD_SCANNER_FALSE = @REBUILD_SCANNER_FALSE@ REBUILD_SCANNER_TRUE = @REBUILD_SCANNER_TRUE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XML2_CONFIG = @XML2_CONFIG@ XMLLINT = @XMLLINT@ XML_CATALOG_PATH = @XML_CATALOG_PATH@ XML_CPPFLAGS = @XML_CPPFLAGS@ XML_LIBS = @XML_LIBS@ XSLTPROC = @XSLTPROC@ 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@ noinst_LTLIBRARIES = libglobus_rvf.la sbin_SCRIPTS = globus-rvf-edit man_MANS = globus-rvf-edit.8 globus-rvf-check.8 libglobus_rvf_la_CPPFLAGS = $(GPT_CFLAGS) -I$(top_srcdir) libglobus_rvf_la_SOURCES = \ globus_i_rvf.tab.h globus_i_rvf_tab.c \ globus_i_rvf.h globus_rvf_parser.h \ globus_i_rvf_scanner.h lex.globus_i_rvf_.c globus_rvf_check_SOURCES = globus_rvf_check.c globus_rvf_check_LDADD = libglobus_rvf.la -lglobus_rsl_assist -lglobus_rsl -lglobus_common EXTRA_DIST = rvf.l rvf.y globus-rvf-edit $(man_MANS) \ globus-rvf-edit-manual.xml globus-rvf-check-manual.xml all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(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 rvf/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign rvf/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_rvf.la: $(libglobus_rvf_la_OBJECTS) $(libglobus_rvf_la_DEPENDENCIES) $(LINK) $(libglobus_rvf_la_LDFLAGS) $(libglobus_rvf_la_OBJECTS) $(libglobus_rvf_la_LIBADD) $(LIBS) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done globus-rvf-check$(EXEEXT): $(globus_rvf_check_OBJECTS) $(globus_rvf_check_DEPENDENCIES) @rm -f globus-rvf-check$(EXEEXT) $(LINK) $(globus_rvf_check_LDFLAGS) $(globus_rvf_check_OBJECTS) $(globus_rvf_check_LDADD) $(LIBS) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \ else :; fi; \ done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globus_rvf_check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglobus_rvf_la-globus_i_rvf_tab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglobus_rvf_la-lex.globus_i_rvf_.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libglobus_rvf_la-globus_i_rvf_tab.lo: globus_i_rvf_tab.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglobus_rvf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libglobus_rvf_la-globus_i_rvf_tab.lo -MD -MP -MF "$(DEPDIR)/libglobus_rvf_la-globus_i_rvf_tab.Tpo" -c -o libglobus_rvf_la-globus_i_rvf_tab.lo `test -f 'globus_i_rvf_tab.c' || echo '$(srcdir)/'`globus_i_rvf_tab.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libglobus_rvf_la-globus_i_rvf_tab.Tpo" "$(DEPDIR)/libglobus_rvf_la-globus_i_rvf_tab.Plo"; else rm -f "$(DEPDIR)/libglobus_rvf_la-globus_i_rvf_tab.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='globus_i_rvf_tab.c' object='libglobus_rvf_la-globus_i_rvf_tab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglobus_rvf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libglobus_rvf_la-globus_i_rvf_tab.lo `test -f 'globus_i_rvf_tab.c' || echo '$(srcdir)/'`globus_i_rvf_tab.c libglobus_rvf_la-lex.globus_i_rvf_.lo: lex.globus_i_rvf_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglobus_rvf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libglobus_rvf_la-lex.globus_i_rvf_.lo -MD -MP -MF "$(DEPDIR)/libglobus_rvf_la-lex.globus_i_rvf_.Tpo" -c -o libglobus_rvf_la-lex.globus_i_rvf_.lo `test -f 'lex.globus_i_rvf_.c' || echo '$(srcdir)/'`lex.globus_i_rvf_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libglobus_rvf_la-lex.globus_i_rvf_.Tpo" "$(DEPDIR)/libglobus_rvf_la-lex.globus_i_rvf_.Plo"; else rm -f "$(DEPDIR)/libglobus_rvf_la-lex.globus_i_rvf_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lex.globus_i_rvf_.c' object='libglobus_rvf_la-lex.globus_i_rvf_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglobus_rvf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libglobus_rvf_la-lex.globus_i_rvf_.lo `test -f 'lex.globus_i_rvf_.c' || echo '$(srcdir)/'`lex.globus_i_rvf_.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ 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) @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) $(PROGRAMS) $(SCRIPTS) $(MANS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; 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 \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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-man install-exec-am: install-sbinPROGRAMS install-sbinSCRIPTS install-info: install-info-am install-man: install-man8 installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -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-info-am uninstall-man uninstall-sbinPROGRAMS \ uninstall-sbinSCRIPTS uninstall-man: uninstall-man8 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-sbinPROGRAMS 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-info \ install-info-am install-man install-man8 install-sbinPROGRAMS \ install-sbinSCRIPTS 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-info-am uninstall-man uninstall-man8 \ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS # developed with bison 2.3 and uses some bison-specific features @REBUILD_PARSER_TRUE@$(srcdir)/globus_i_rvf.tab.h $(srcdir)/globus_i_rvf_tab.c: $(srcdir)/rvf.y @REBUILD_PARSER_TRUE@ rm -f $(srcdir)/globus_i_rvf.tab.h $(srcdir)/globus_i_rvf_tab.c @REBUILD_PARSER_TRUE@ bison -d -b $(srcdir)/globus_i_rvf -p globus_i_rvf_ $(srcdir)/rvf.y @REBUILD_PARSER_TRUE@ mv $(srcdir)/globus_i_rvf.tab.c $(srcdir)/globus_i_rvf_tab.c # developed with flex 2.5.35 and uses flex-specific features @REBUILD_SCANNER_TRUE@$(srcdir)/lex.globus_i_rvf_.c $(srcdir)/globus_i_rvf_scanner.h: $(srcdir)/rvf.l @REBUILD_SCANNER_TRUE@ rm -f $(srcdir)/globus_i_rvf_scanner.h $(srcdir)/lex.globus_i_rvf_.c @REBUILD_SCANNER_TRUE@ flex -s -d \ @REBUILD_SCANNER_TRUE@ -o $(srcdir)/lex.globus_i_rvf_.c \ @REBUILD_SCANNER_TRUE@ --header-file=$(srcdir)/globus_i_rvf_scanner.h \ @REBUILD_SCANNER_TRUE@ $(srcdir)/rvf.l # 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-sbinPROGRAMS link-sbinSCRIPTS : unlink: unlink-recursive unlink-sbinPROGRAMS unlink-sbinSCRIPTS : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-am filelist-man8 link-sbinPROGRAMS unlink-sbinPROGRAMS filelist-sbinPROGRAMS link-sbinSCRIPTS unlink-sbinSCRIPTS filelist-sbinSCRIPTS filelist: filelist-recursive filelist-man8 filelist-sbinPROGRAMS filelist-sbinSCRIPTS : filelist-man8: $(man8_MANS) $(man_MANS) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(man8dir)/$$inst | sed -e 's!^$(prefix)!!'`"; \ echo $$p >> "$${filelistdir}/noflavor_doc.filelist"; \ done link-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ mydir=`pwd`; \ target_p=$(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ 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; \ else :; fi; \ done unlink-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ target_p=$(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ 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-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ if test "$(GPT_LINKTYPE)" = "shared"; then \ filelisttype="pgm"; \ else \ filelisttype="pgm_static"; \ fi; \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo "$(sbindir)/$$p" | sed -e 's!^$(exec_prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_$${filelisttype}.filelist"; \ done link-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_SCRIPTS)'; for p in $$list; do \ mydir=`pwd`; \ target_p=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ 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; \ else 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 :; fi; fi; \ done unlink-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; for p in $$list; do \ target_p=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ 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-sbinSCRIPTS: @list='$(sbin_SCRIPTS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo "$(sbindir)/$$p" | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_pgm.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_gram_job_manager-13.53/rvf/lex.globus_i_rvf_.c0000666000076400007640000027620212035562232017667 00000000000000#line 2 "./lex.globus_i_rvf_.c" #line 4 "./lex.globus_i_rvf_.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ /* %not-for-header */ /* %if-c-only */ /* %if-not-reentrant */ /* %endif */ /* %endif */ /* %ok-for-header */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* %if-c++-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ /* %if-c-only */ #include #include #include #include /* %endif */ /* %if-tables-serialization */ /* %endif */ /* end standard C headers. */ /* %if-c-or-c++ */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ /* %endif */ /* %if-c++-only */ /* %endif */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* %not-for-header */ /* Returned upon end-of-file. */ #define YY_NULL 0 /* %ok-for-header */ /* %not-for-header */ /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* %ok-for-header */ /* %if-reentrant */ /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define yyin yyg->yyin_r #define yyout yyg->yyout_r #define yyextra yyg->yyextra_r #define yyleng yyg->yyleng_r #define yytext yyg->yytext_r #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r /* %endif */ /* %if-not-reentrant */ /* %endif */ /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE globus_i_rvf_restart(yyin ,yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif /* %if-not-reentrant */ /* %endif */ /* %if-c-only */ /* %if-not-reentrant */ /* %endif */ /* %endif */ #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE globus_i_rvf_lex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ yy_size_t yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = yyg->yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { /* %if-c-only */ FILE *yy_input_file; /* %endif */ /* %if-c++-only */ /* %endif */ char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via globus_i_rvf_restart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ /* %if-not-reentrant */ /* %endif */ /* %ok-for-header */ /* %endif */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] /* %if-c-only Standard (non-C++) definition */ /* %if-not-reentrant */ /* %not-for-header */ /* %ok-for-header */ /* %endif */ void globus_i_rvf_restart (FILE *input_file ,yyscan_t yyscanner ); void globus_i_rvf__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); YY_BUFFER_STATE globus_i_rvf__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); void globus_i_rvf__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void globus_i_rvf__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void globus_i_rvf_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); void globus_i_rvf_pop_buffer_state (yyscan_t yyscanner ); static void globus_i_rvf_ensure_buffer_stack (yyscan_t yyscanner ); static void globus_i_rvf__load_buffer_state (yyscan_t yyscanner ); static void globus_i_rvf__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); #define YY_FLUSH_BUFFER globus_i_rvf__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) YY_BUFFER_STATE globus_i_rvf__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE globus_i_rvf__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE globus_i_rvf__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); /* %endif */ void *globus_i_rvf_alloc (yy_size_t ,yyscan_t yyscanner ); void *globus_i_rvf_realloc (void *,yy_size_t ,yyscan_t yyscanner ); void globus_i_rvf_free (void * ,yyscan_t yyscanner ); #define yy_new_buffer globus_i_rvf__create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ globus_i_rvf_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ globus_i_rvf__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ globus_i_rvf_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ globus_i_rvf__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ #define globus_i_rvf_wrap(n) 1 #define YY_SKIP_YYWRAP #define FLEX_DEBUG typedef unsigned char YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r /* %if-c-only Standard (non-C++) definition */ static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); /* %endif */ /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ yyleng = (yy_size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ yyg->yy_c_buf_p = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ #define YY_NUM_RULES 28 #define YY_END_OF_BUFFER 29 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[715] = { 0, 0, 0, 0, 0, 0, 0, 24, 24, 0, 0, 0, 0, 0, 0, 29, 27, 12, 13, 27, 27, 27, 27, 27, 27, 11, 19, 18, 2, 19, 19, 19, 24, 12, 24, 25, 24, 24, 24, 24, 26, 27, 12, 0, 1, 0, 0, 0, 0, 0, 19, 2, 19, 19, 19, 24, 24, 12, 24, 24, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19, 17, 24, 24, 20, 0, 0, 0, 0, 0, 0, 0, 0, 19, 24, 20, 20, 0, 0, 0, 0, 0, 0, 0, 10, 19, 24, 0, 0, 4, 0, 7, 0, 0, 19, 24, 0, 0, 0, 0, 0, 0, 19, 24, 0, 3, 0, 0, 0, 9, 19, 24, 0, 0, 0, 0, 19, 24, 0, 5, 6, 0, 19, 24, 0, 8, 19, 24, 0, 19, 24, 0, 19, 24, 0, 19, 24, 0, 19, 24, 0, 19, 19, 24, 24, 0, 0, 19, 19, 24, 24, 0, 0, 19, 19, 24, 24, 0, 0, 19, 19, 24, 24, 0, 0, 19, 19, 24, 24, 0, 0, 19, 14, 24, 21, 0, 21, 19, 14, 24, 21, 0, 21, 19, 19, 24, 21, 24, 0, 21, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 15, 19, 19, 23, 24, 24, 23, 0, 0, 15, 19, 19, 23, 24, 24, 23, 0, 0, 19, 19, 19, 23, 24, 24, 24, 23, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 16, 19, 24, 22, 24, 0, 22, 0, 19, 16, 19, 24, 22, 24, 0, 22, 0, 19, 19, 19, 24, 22, 24, 24, 0, 22, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 19, 24, 24, 24, 24, 0, 0, 0, 0, 19, 19, 19, 19, 24, 24, 24, 24, 0, 0, 0, 0, 19, 19, 19, 19, 24, 24, 24, 24, 0, 0, 0, 0, 19, 19, 19, 19, 24, 24, 24, 24, 0, 0, 0, 0, 19, 19, 19, 19, 24, 24, 24, 24, 0, 0, 0, 0, 19, 19, 19, 14, 24, 24, 24, 21, 0, 0, 0, 21, 19, 19, 19, 14, 24, 24, 24, 21, 0, 0, 0, 21, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 19, 24, 24, 24, 24, 0, 0, 0, 0, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 19, 15, 19, 19, 19, 24, 23, 24, 24, 24, 0, 23, 0, 0, 0, 19, 15, 19, 19, 19, 24, 23, 24, 24, 24, 0, 23, 0, 0, 0, 19, 19, 19, 19, 24, 24, 24, 24, 0, 0, 0, 0, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 19, 19, 19, 16, 24, 24, 24, 22, 0, 0, 0, 22, 19, 19, 19, 16, 24, 24, 24, 22, 0, 0, 0, 22, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 19, 24, 24, 24, 24, 0, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 19, 19, 24, 24, 24, 0, 0, 0, 19, 24, 0, 19, 24, 0, 19, 24, 0, 19, 24, 0, 19, 24, 0, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1, 1, 1, 1, 29, 1, 1, 30, 1, 31, 32, 33, 34, 35, 36, 1, 37, 38, 1, 1, 39, 1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[50] = { 0, 1, 1, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int16_t yy_base[722] = { 0, 0, 47, 2, 7, 15, 33, 63, 69, 12, 81, 20, 28, 38, 53, 1153, 1154, 1150, 1154, 1148, 1, 18, 13, 51, 56, 1154, 0, 1154, 0, 1133, 1118, 1104, 1118, 94, 98, 1154, 16, 73, 59, 64, 1154, 1129, 1143, 1141, 1154, 34, 92, 99, 81, 93, 0, 0, 1123, 1103, 1094, 1111, 107, 110, 116, 91, 77, 139, 97, 96, 100, 1119, 110, 107, 134, 131, 124, 134, 1130, 1092, 1101, 145, 128, 126, 1127, 144, 132, 140, 149, 150, 156, 158, 1108, 1098, 0, 151, 154, 189, 1106, 168, 169, 163, 170, 172, 168, 174, 1107, 173, 201, 203, 1106, 173, 182, 189, 197, 198, 198, 1154, 1099, 184, 1098, 196, 194, 198, 1154, 214, 214, 1114, 216, 1113, 215, 222, 222, 212, 222, 1102, 223, 1101, 1154, 216, 227, 239, 1154, 1116, 248, 1115, 235, 238, 228, 1103, 46, 1102, 1154, 1154, 239, 1089, 235, 1088, 1154, 1101, 240, 1100, 1095, 251, 1094, 1105, 258, 1104, 1081, 243, 1080, 264, 265, 266, 1102, 1082, 263, 267, 1100, 1080, 1086, 1096, 262, 266, 1084, 1094, 1094, 1082, 278, 268, 1092, 1080, 1084, 1081, 285, 284, 1082, 1079, 1082, 1067, 289, 276, 1080, 1065, 1066, 1086, 279, 301, 1064, 9, 1056, 304, 280, 309, 1055, 313, 296, 1067, 300, 329, 304, 304, 332, 1066, 1071, 1056, 1060, 314, 311, 317, 1068, 1053, 1057, 1052, 1065, 1066, 315, 331, 339, 1049, 1062, 1063, 1045, 1054, 1042, 323, 334, 324, 1042, 1051, 1039, 1057, 1043, 1038, 344, 335, 330, 1054, 1040, 1035, 1035, 1027, 1026, 333, 336, 340, 1032, 1024, 1023, 1027, 1025, 1037, 332, 345, 354, 1024, 1022, 1034, 1044, 1024, 1021, 373, 351, 355, 379, 1022, 1019, 375, 1031, 1033, 383, 369, 380, 387, 1029, 1031, 1020, 1029, 1017, 390, 377, 384, 379, 402, 1017, 1026, 1014, 1011, 1005, 999, 381, 370, 387, 1008, 1002, 996, 1017, 1013, 1007, 399, 400, 398, 1014, 1010, 1004, 993, 1016, 997, 392, 420, 404, 990, 423, 995, 990, 418, 1005, 406, 434, 424, 988, 437, 1003, 980, 992, 978, 412, 441, 417, 422, 977, 453, 989, 975, 991, 983, 440, 432, 428, 444, 989, 981, 441, 977, 991, 991, 971, 446, 452, 460, 445, 973, 987, 987, 967, 985, 965, 971, 981, 465, 450, 458, 470, 981, 961, 967, 977, 966, 959, 975, 963, 462, 459, 475, 466, 962, 955, 971, 959, 946, 945, 961, 958, 456, 463, 477, 481, 942, 941, 957, 954, 952, 954, 955, 940, 482, 484, 489, 476, 948, 950, 951, 936, 940, 936, 935, 955, 483, 479, 486, 514, 936, 932, 931, 517, 945, 945, 921, 512, 499, 515, 494, 524, 942, 942, 918, 527, 917, 928, 508, 504, 517, 518, 915, 926, 515, 527, 913, 931, 916, 530, 520, 541, 531, 537, 910, 928, 913, 930, 910, 919, 910, 923, 529, 536, 547, 540, 556, 925, 905, 914, 905, 918, 908, 918, 905, 899, 908, 538, 560, 551, 548, 557, 903, 913, 900, 894, 903, 910, 898, 907, 907, 893, 567, 561, 570, 568, 562, 905, 893, 902, 902, 888, 894, 891, 875, 881, 873, 571, 566, 558, 569, 564, 889, 886, 870, 876, 868, 886, 871, 583, 870, 868, 591, 579, 585, 581, 586, 882, 867, 587, 866, 864, 866, 886, 880, 860, 864, 590, 614, 611, 595, 601, 861, 623, 876, 856, 860, 850, 621, 860, 870, 867, 598, 629, 610, 625, 626, 846, 635, 856, 866, 863, 621, 865, 853, 863, 623, 628, 631, 634, 627, 862, 850, 860, 855, 840, 851, 848, 837, 642, 636, 643, 644, 637, 850, 835, 846, 843, 832, 832, 845, 843, 828, 841, 640, 657, 659, 649, 664, 827, 840, 838, 823, 836, 821, 830, 821, 841, 651, 653, 654, 682, 817, 826, 817, 687, 832, 818, 807, 679, 672, 667, 665, 695, 829, 815, 804, 697, 810, 802, 679, 683, 675, 690, 808, 800, 692, 804, 802, 816, 801, 692, 694, 680, 693, 800, 798, 812, 797, 800, 796, 809, 704, 702, 717, 797, 793, 806, 805, 789, 798, 718, 705, 714, 802, 786, 795, 802, 801, 787, 725, 728, 716, 799, 798, 783, 773, 772, 746, 712, 715, 710, 750, 750, 742, 760, 745, 743, 731, 723, 724, 756, 741, 739, 743, 730, 742, 751, 739, 697, 576, 748, 514, 413, 733, 242, 227, 745, 140, 1154, 777, 781, 785, 789, 793, 796, 800 } ; static yyconst flex_int16_t yy_def[722] = { 0, 715, 715, 715, 715, 716, 716, 717, 717, 715, 715, 715, 715, 715, 715, 714, 714, 714, 714, 718, 714, 714, 714, 714, 714, 714, 719, 714, 720, 719, 719, 719, 721, 721, 721, 714, 721, 721, 721, 721, 714, 714, 714, 718, 714, 714, 714, 714, 714, 714, 719, 720, 719, 719, 719, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 714, 714, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 714, 714, 714, 714, 714, 719, 721, 721, 721, 714, 714, 714, 714, 714, 714, 714, 714, 719, 721, 714, 714, 714, 714, 714, 714, 714, 719, 721, 714, 714, 714, 714, 714, 714, 719, 721, 714, 714, 714, 714, 714, 714, 719, 721, 714, 714, 714, 714, 719, 721, 714, 714, 714, 714, 719, 721, 714, 714, 719, 721, 714, 719, 721, 714, 719, 721, 714, 719, 721, 714, 719, 721, 714, 719, 719, 721, 721, 714, 714, 719, 719, 721, 721, 714, 714, 719, 719, 721, 721, 714, 714, 719, 719, 721, 721, 714, 714, 719, 719, 721, 721, 714, 714, 719, 719, 721, 721, 714, 714, 719, 719, 721, 721, 714, 714, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 719, 721, 721, 721, 721, 721, 714, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 719, 721, 721, 721, 721, 714, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 719, 719, 721, 721, 721, 714, 714, 714, 719, 721, 714, 719, 721, 714, 719, 721, 714, 719, 721, 714, 719, 721, 714, 0, 714, 714, 714, 714, 714, 714, 714 } ; static yyconst flex_int16_t yy_nxt[1204] = { 0, 714, 17, 18, 17, 19, 714, 20, 25, 17, 21, 209, 209, 25, 17, 40, 35, 17, 18, 27, 28, 22, 17, 23, 35, 41, 45, 24, 29, 46, 17, 20, 35, 62, 21, 17, 18, 27, 28, 47, 17, 18, 22, 19, 23, 56, 29, 45, 24, 17, 18, 30, 19, 46, 20, 17, 18, 21, 19, 66, 47, 31, 48, 49, 150, 33, 34, 35, 22, 30, 23, 33, 34, 35, 24, 56, 36, 55, 20, 31, 66, 21, 36, 17, 40, 35, 48, 49, 56, 22, 63, 23, 37, 56, 41, 24, 57, 58, 37, 38, 61, 58, 56, 70, 67, 38, 56, 69, 64, 39, 71, 55, 57, 58, 80, 39, 68, 75, 61, 58, 56, 64, 63, 56, 70, 56, 56, 56, 67, 56, 59, 69, 71, 79, 59, 76, 56, 68, 80, 56, 60, 61, 58, 81, 60, 56, 59, 77, 82, 84, 83, 620, 59, 89, 79, 56, 60, 56, 94, 93, 85, 91, 60, 95, 96, 97, 98, 81, 56, 99, 82, 83, 84, 90, 56, 59, 105, 101, 107, 94, 56, 85, 93, 56, 95, 60, 106, 96, 97, 91, 98, 102, 103, 99, 108, 109, 110, 113, 111, 115, 105, 107, 56, 102, 103, 102, 103, 116, 106, 119, 117, 118, 120, 56, 122, 108, 109, 110, 56, 111, 115, 124, 125, 126, 127, 128, 132, 140, 116, 130, 56, 117, 56, 119, 118, 120, 133, 134, 612, 148, 135, 136, 124, 125, 126, 56, 138, 141, 127, 128, 132, 140, 56, 142, 146, 144, 157, 147, 152, 133, 134, 135, 136, 148, 56, 154, 163, 713, 141, 56, 176, 160, 56, 166, 183, 146, 142, 56, 147, 152, 56, 182, 168, 170, 172, 188, 189, 56, 169, 171, 173, 56, 56, 177, 56, 56, 56, 56, 194, 195, 200, 201, 206, 207, 207, 56, 205, 56, 56, 56, 212, 213, 213, 56, 56, 216, 216, 211, 56, 218, 219, 223, 214, 221, 222, 230, 217, 224, 225, 56, 56, 213, 213, 56, 216, 216, 231, 232, 56, 239, 56, 240, 214, 56, 56, 217, 56, 241, 248, 249, 250, 257, 56, 56, 259, 258, 266, 275, 56, 56, 56, 56, 56, 56, 56, 56, 267, 277, 56, 56, 268, 276, 285, 56, 56, 284, 284, 281, 286, 295, 56, 287, 287, 56, 56, 293, 293, 296, 290, 297, 297, 305, 293, 293, 304, 314, 294, 306, 56, 56, 298, 313, 56, 294, 297, 297, 56, 322, 56, 56, 56, 323, 56, 56, 324, 298, 56, 315, 331, 56, 329, 56, 332, 332, 333, 335, 335, 56, 56, 56, 340, 338, 343, 56, 352, 56, 341, 341, 711, 345, 345, 56, 351, 341, 341, 361, 56, 342, 362, 56, 346, 56, 353, 56, 342, 345, 345, 56, 359, 367, 374, 56, 363, 56, 360, 368, 346, 375, 364, 373, 56, 376, 385, 56, 56, 56, 386, 387, 388, 56, 397, 56, 399, 398, 400, 56, 409, 56, 56, 56, 411, 56, 56, 410, 56, 56, 412, 422, 421, 56, 423, 424, 434, 433, 56, 56, 56, 444, 56, 435, 56, 56, 56, 56, 432, 56, 436, 436, 56, 440, 440, 710, 445, 56, 446, 211, 436, 436, 56, 440, 440, 452, 453, 56, 454, 455, 482, 214, 460, 461, 217, 456, 457, 56, 56, 462, 56, 56, 467, 56, 469, 463, 470, 56, 468, 472, 471, 497, 56, 56, 56, 473, 483, 484, 485, 56, 486, 56, 498, 56, 56, 499, 501, 500, 512, 515, 56, 56, 514, 513, 56, 528, 516, 708, 527, 56, 56, 56, 529, 56, 56, 56, 530, 56, 531, 56, 56, 56, 56, 56, 56, 539, 542, 544, 543, 549, 424, 540, 56, 545, 56, 550, 546, 557, 56, 56, 558, 558, 559, 56, 56, 560, 561, 553, 56, 563, 563, 56, 571, 572, 56, 558, 558, 573, 290, 586, 574, 563, 563, 56, 56, 588, 294, 56, 579, 580, 584, 585, 298, 587, 589, 590, 56, 599, 56, 56, 601, 56, 56, 602, 56, 600, 603, 56, 613, 56, 56, 614, 626, 56, 615, 56, 56, 56, 616, 424, 625, 627, 56, 636, 56, 624, 56, 56, 628, 628, 56, 637, 56, 632, 632, 658, 338, 56, 56, 638, 56, 628, 628, 632, 632, 56, 644, 645, 56, 647, 646, 707, 342, 56, 346, 56, 56, 648, 649, 652, 653, 543, 659, 56, 657, 56, 56, 56, 56, 666, 667, 668, 675, 677, 676, 56, 684, 56, 56, 685, 686, 693, 694, 56, 695, 56, 543, 56, 56, 56, 56, 56, 616, 706, 700, 703, 56, 56, 56, 709, 616, 56, 712, 56, 56, 705, 56, 704, 702, 701, 620, 548, 56, 699, 612, 538, 698, 697, 56, 696, 692, 56, 16, 16, 16, 16, 26, 26, 26, 26, 32, 32, 32, 32, 43, 43, 43, 43, 50, 691, 50, 51, 690, 51, 51, 55, 55, 689, 55, 688, 687, 683, 682, 681, 680, 679, 678, 674, 673, 672, 671, 670, 669, 665, 664, 663, 662, 661, 660, 548, 656, 655, 654, 538, 651, 650, 643, 642, 641, 640, 639, 635, 634, 633, 631, 630, 629, 624, 623, 622, 621, 428, 620, 619, 618, 617, 420, 612, 611, 610, 609, 608, 607, 606, 605, 604, 598, 597, 596, 595, 594, 593, 592, 591, 583, 582, 581, 578, 577, 576, 575, 570, 569, 568, 567, 566, 565, 564, 562, 556, 555, 554, 553, 552, 551, 428, 548, 547, 541, 420, 538, 537, 536, 535, 534, 533, 532, 526, 525, 524, 523, 522, 521, 520, 519, 518, 517, 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, 481, 480, 479, 478, 477, 476, 475, 474, 466, 465, 464, 459, 458, 451, 450, 449, 448, 447, 443, 442, 441, 439, 438, 437, 432, 431, 430, 429, 428, 427, 426, 425, 420, 419, 418, 417, 416, 415, 414, 413, 408, 407, 406, 405, 404, 403, 402, 401, 396, 395, 394, 393, 392, 391, 390, 389, 384, 383, 382, 381, 380, 379, 378, 377, 372, 371, 370, 369, 366, 365, 358, 357, 356, 355, 354, 350, 349, 348, 347, 344, 339, 337, 336, 334, 330, 329, 328, 327, 326, 325, 321, 320, 319, 318, 317, 316, 312, 311, 310, 309, 308, 307, 303, 302, 301, 300, 299, 292, 291, 289, 288, 283, 282, 281, 280, 279, 278, 274, 273, 272, 271, 270, 269, 265, 264, 263, 262, 261, 260, 256, 255, 254, 253, 252, 251, 247, 246, 245, 244, 243, 242, 238, 237, 236, 235, 234, 233, 229, 228, 227, 226, 220, 215, 210, 208, 205, 204, 203, 202, 199, 198, 197, 196, 193, 192, 191, 190, 187, 186, 185, 184, 181, 180, 179, 178, 175, 174, 167, 165, 164, 162, 161, 159, 158, 156, 155, 153, 151, 149, 145, 143, 139, 137, 131, 129, 123, 121, 114, 112, 104, 88, 100, 92, 88, 87, 86, 78, 56, 74, 73, 72, 44, 42, 65, 56, 54, 53, 52, 44, 42, 714, 15, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714 } ; static yyconst flex_int16_t yy_chk[1204] = { 0, 0, 1, 1, 3, 1, 0, 1, 3, 4, 1, 203, 203, 4, 9, 9, 9, 5, 5, 5, 5, 1, 11, 1, 11, 9, 20, 1, 5, 21, 12, 1, 12, 36, 1, 6, 6, 6, 6, 22, 13, 13, 1, 13, 1, 36, 6, 20, 1, 2, 2, 5, 2, 21, 2, 14, 14, 2, 14, 45, 22, 5, 23, 24, 144, 7, 7, 7, 2, 6, 2, 8, 8, 8, 2, 144, 7, 37, 2, 6, 45, 2, 8, 10, 10, 10, 23, 24, 38, 2, 38, 2, 7, 39, 10, 2, 33, 33, 8, 7, 34, 34, 37, 48, 46, 8, 60, 47, 39, 7, 49, 56, 57, 57, 67, 8, 46, 62, 58, 58, 59, 60, 59, 33, 48, 63, 62, 34, 46, 64, 33, 47, 49, 66, 34, 63, 56, 46, 67, 57, 33, 61, 61, 68, 34, 58, 57, 64, 69, 71, 70, 713, 58, 75, 66, 77, 57, 76, 80, 79, 71, 77, 58, 81, 82, 83, 84, 68, 61, 85, 69, 70, 71, 76, 75, 61, 93, 89, 95, 80, 89, 71, 79, 90, 81, 61, 94, 82, 83, 90, 84, 91, 91, 85, 96, 97, 98, 101, 99, 105, 93, 95, 101, 102, 102, 103, 103, 106, 94, 109, 107, 108, 110, 113, 113, 96, 97, 98, 91, 99, 105, 115, 116, 117, 119, 120, 124, 133, 106, 122, 102, 107, 103, 109, 108, 110, 125, 126, 711, 142, 127, 128, 115, 116, 117, 122, 130, 134, 119, 120, 124, 133, 130, 135, 140, 138, 154, 141, 148, 125, 126, 127, 128, 142, 150, 150, 160, 710, 134, 154, 170, 157, 163, 163, 177, 140, 135, 138, 141, 148, 157, 176, 165, 166, 167, 182, 183, 160, 165, 166, 167, 176, 170, 171, 166, 177, 171, 183, 188, 189, 194, 195, 200, 201, 201, 195, 205, 182, 200, 206, 206, 207, 207, 189, 188, 209, 209, 205, 194, 210, 210, 214, 207, 212, 212, 221, 209, 215, 215, 212, 201, 213, 213, 214, 216, 216, 222, 223, 207, 230, 222, 231, 213, 221, 230, 216, 223, 232, 239, 240, 241, 248, 239, 241, 250, 249, 257, 266, 213, 250, 231, 266, 257, 240, 249, 258, 258, 268, 232, 259, 259, 267, 276, 248, 267, 275, 275, 281, 277, 285, 276, 278, 278, 268, 277, 284, 284, 286, 281, 287, 287, 295, 293, 293, 294, 305, 284, 296, 285, 305, 287, 304, 275, 293, 297, 297, 294, 313, 296, 286, 304, 314, 284, 295, 315, 297, 306, 306, 322, 293, 329, 322, 323, 323, 324, 326, 326, 315, 313, 314, 331, 329, 333, 324, 342, 331, 332, 332, 708, 335, 335, 340, 340, 341, 341, 351, 342, 332, 352, 323, 335, 343, 343, 333, 341, 345, 345, 352, 350, 356, 362, 351, 353, 332, 350, 356, 345, 363, 353, 361, 341, 364, 373, 353, 364, 361, 374, 375, 376, 374, 385, 362, 387, 386, 388, 397, 397, 375, 386, 363, 399, 385, 398, 398, 373, 388, 400, 410, 409, 376, 411, 412, 422, 421, 387, 412, 399, 433, 422, 423, 400, 409, 421, 410, 432, 423, 424, 424, 411, 428, 428, 707, 434, 435, 435, 432, 436, 436, 433, 440, 440, 443, 443, 444, 444, 445, 467, 436, 449, 449, 440, 446, 446, 424, 434, 450, 445, 446, 454, 455, 455, 450, 456, 436, 454, 458, 457, 482, 467, 454, 457, 458, 468, 469, 470, 468, 471, 482, 483, 470, 456, 484, 486, 485, 497, 500, 469, 485, 499, 498, 484, 513, 501, 705, 512, 471, 486, 514, 514, 483, 498, 501, 515, 516, 516, 513, 497, 500, 515, 499, 512, 524, 527, 529, 528, 534, 530, 524, 528, 529, 530, 534, 531, 542, 529, 531, 543, 543, 544, 542, 527, 545, 546, 553, 545, 548, 548, 557, 557, 559, 546, 558, 558, 560, 553, 572, 561, 563, 563, 559, 544, 574, 558, 543, 567, 567, 571, 571, 563, 573, 575, 575, 571, 584, 560, 561, 586, 572, 558, 587, 573, 585, 588, 574, 599, 585, 588, 600, 614, 599, 601, 584, 586, 587, 602, 603, 613, 615, 602, 625, 613, 624, 614, 615, 616, 616, 600, 626, 601, 620, 620, 648, 624, 603, 627, 627, 626, 628, 628, 632, 632, 625, 635, 635, 637, 637, 636, 704, 628, 648, 632, 616, 636, 638, 638, 641, 641, 646, 649, 638, 647, 646, 649, 647, 628, 657, 658, 659, 666, 668, 667, 658, 675, 657, 667, 676, 677, 684, 685, 686, 686, 684, 693, 668, 685, 677, 659, 666, 694, 703, 695, 700, 694, 695, 675, 706, 712, 676, 709, 700, 693, 702, 709, 701, 699, 698, 697, 696, 703, 692, 691, 690, 689, 688, 712, 687, 683, 706, 715, 715, 715, 715, 716, 716, 716, 716, 717, 717, 717, 717, 718, 718, 718, 718, 719, 682, 719, 720, 681, 720, 720, 721, 721, 680, 721, 679, 678, 674, 673, 672, 671, 670, 669, 665, 664, 663, 662, 661, 660, 656, 655, 654, 653, 652, 651, 650, 645, 644, 643, 642, 640, 639, 634, 633, 631, 630, 629, 623, 622, 621, 619, 618, 617, 612, 611, 610, 609, 608, 607, 606, 605, 604, 598, 597, 596, 595, 594, 593, 592, 591, 590, 589, 583, 582, 581, 580, 579, 578, 577, 576, 570, 569, 568, 566, 565, 564, 562, 556, 555, 554, 552, 551, 550, 549, 547, 541, 540, 539, 538, 537, 536, 535, 533, 532, 526, 525, 523, 522, 521, 520, 519, 518, 517, 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, 466, 465, 464, 463, 462, 461, 460, 459, 453, 452, 451, 448, 447, 442, 441, 439, 438, 437, 431, 430, 429, 427, 426, 425, 420, 419, 418, 417, 416, 415, 414, 413, 408, 407, 406, 405, 404, 403, 402, 401, 396, 395, 394, 393, 392, 391, 390, 389, 384, 383, 382, 381, 380, 379, 378, 377, 372, 371, 370, 369, 368, 367, 366, 365, 360, 359, 358, 357, 355, 354, 349, 348, 347, 346, 344, 339, 338, 337, 336, 334, 330, 328, 327, 325, 321, 320, 319, 318, 317, 316, 312, 311, 310, 309, 308, 307, 303, 302, 301, 300, 299, 298, 292, 291, 290, 289, 288, 283, 282, 280, 279, 274, 273, 272, 271, 270, 269, 265, 264, 263, 262, 261, 260, 256, 255, 254, 253, 252, 251, 247, 246, 245, 244, 243, 242, 238, 237, 236, 235, 234, 233, 229, 228, 227, 226, 225, 224, 220, 219, 218, 217, 211, 208, 204, 202, 199, 198, 197, 196, 193, 192, 191, 190, 187, 186, 185, 184, 181, 180, 179, 178, 175, 174, 173, 172, 169, 168, 164, 162, 161, 159, 158, 156, 155, 153, 151, 149, 145, 143, 139, 137, 131, 129, 123, 121, 114, 112, 104, 100, 92, 87, 86, 78, 74, 73, 72, 65, 55, 54, 53, 52, 43, 42, 41, 32, 31, 30, 29, 19, 17, 15, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714 } ; /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[29] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, }; static yyconst flex_int16_t yy_rule_linenum[28] = { 0, 55, 59, 64, 69, 74, 79, 84, 89, 95, 101, 107, 112, 116, 122, 126, 131, 135, 141, 146, 153, 158, 164, 170, 176, 200, 205, 209 } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET #line 1 "./rvf.l" #line 2 "./rvf.l" /* * Copyright 1999-2012 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_rvf_parser.h" #include "globus_i_rvf.h" #include "globus_i_rvf.tab.h" #line 1070 "./lex.globus_i_rvf_.c" #define INITIAL 0 #define DELIMITER 1 #define VALUE 2 #define QUOTED 3 #define QUOTED_WHENVAL 4 #define QUOTE_END 5 #define VALUE_END 6 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ /* %if-c-only */ #include /* %endif */ /* %if-c++-only */ /* %endif */ #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* %if-c-only Reentrant structure and macros (non-C++). */ /* %if-reentrant */ /* Holds the entire state of the reentrant scanner. */ struct yyguts_t { /* User-defined. Not touched by flex. */ YY_EXTRA_TYPE yyextra_r; /* The rest are the same as the globals declared in the non-reentrant scanner. */ FILE *yyin_r, *yyout_r; size_t yy_buffer_stack_top; /**< index of top of stack. */ size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; yy_size_t yy_n_chars; yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; int yy_did_buffer_switch_on_eof; int yy_start_stack_ptr; int yy_start_stack_depth; int *yy_start_stack; yy_state_type yy_last_accepting_state; char* yy_last_accepting_cpos; int yylineno_r; int yy_flex_debug_r; char *yytext_r; int yy_more_flag; int yy_more_len; YYSTYPE * yylval_r; YYLTYPE * yylloc_r; }; /* end struct yyguts_t */ /* %if-c-only */ static int yy_init_globals (yyscan_t yyscanner ); /* %endif */ /* %if-reentrant */ /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r # define yylloc yyg->yylloc_r int globus_i_rvf_lex_init (yyscan_t* scanner); int globus_i_rvf_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); /* %endif */ /* %endif End reentrant structures and macros. */ /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int globus_i_rvf_lex_destroy (yyscan_t yyscanner ); int globus_i_rvf_get_debug (yyscan_t yyscanner ); void globus_i_rvf_set_debug (int debug_flag ,yyscan_t yyscanner ); YY_EXTRA_TYPE globus_i_rvf_get_extra (yyscan_t yyscanner ); void globus_i_rvf_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); FILE *globus_i_rvf_get_in (yyscan_t yyscanner ); void globus_i_rvf_set_in (FILE * in_str ,yyscan_t yyscanner ); FILE *globus_i_rvf_get_out (yyscan_t yyscanner ); void globus_i_rvf_set_out (FILE * out_str ,yyscan_t yyscanner ); yy_size_t globus_i_rvf_get_leng (yyscan_t yyscanner ); char *globus_i_rvf_get_text (yyscan_t yyscanner ); int globus_i_rvf_get_lineno (yyscan_t yyscanner ); void globus_i_rvf_set_lineno (int line_number ,yyscan_t yyscanner ); /* %if-bison-bridge */ YYSTYPE * globus_i_rvf_get_lval (yyscan_t yyscanner ); void globus_i_rvf_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *globus_i_rvf_get_lloc (yyscan_t yyscanner ); void globus_i_rvf_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); /* %endif */ /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int globus_i_rvf_wrap (yyscan_t yyscanner ); #else extern int globus_i_rvf_wrap (yyscan_t yyscanner ); #endif #endif /* %not-for-header */ /* %ok-for-header */ /* %endif */ #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ #ifdef __cplusplus static int yyinput (yyscan_t yyscanner ); #else static int input (yyscan_t yyscanner ); #endif /* %ok-for-header */ /* %endif */ #endif /* %if-c-only */ /* %endif */ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* %if-c-only Standard (non-C++) definition */ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO fwrite( yytext, yyleng, 1, yyout ) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ /* %if-c++-only C++ definition \ */\ /* %endif */ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR /* %if-c-only */ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ #endif /* %if-tables-serialization structures and prototypes */ /* %not-for-header */ /* %ok-for-header */ /* %not-for-header */ /* %tables-yydmap generated elements */ /* %endif */ /* end tables serialization structures and prototypes */ /* %ok-for-header */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ extern int globus_i_rvf_lex \ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); #define YY_DECL int globus_i_rvf_lex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ #define YY_RULE_SETUP \ YY_USER_ACTION /* %not-for-header */ /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* %% [7.0] user's declarations go here */ #line 53 "./rvf.l" #line 1383 "./lex.globus_i_rvf_.c" yylval = yylval_param; yylloc = yylloc_param; if ( !yyg->yy_init ) { yyg->yy_init = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yyg->yy_start ) yyg->yy_start = 1; /* first start state */ if ( ! yyin ) /* %if-c-only */ yyin = stdin; /* %endif */ /* %if-c++-only */ /* %endif */ if ( ! yyout ) /* %if-c-only */ yyout = stdout; /* %endif */ /* %if-c++-only */ /* %endif */ if ( ! YY_CURRENT_BUFFER ) { globus_i_rvf_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = globus_i_rvf__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } globus_i_rvf__load_buffer_state(yyscanner ); } while ( 1 ) /* loops until end-of-file is reached */ { /* %% [8.0] yymore()-related code goes here */ yy_cp = yyg->yy_c_buf_p; /* Support of yytext. */ *yy_cp = yyg->yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; /* %% [9.0] code to set up and find next match goes here */ yy_current_state = yyg->yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 715 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 1154 ); yy_find_action: /* %% [10.0] code to find the action number goes here */ yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; /* %% [11.0] code for yylineno update goes here */ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { yy_size_t yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) do{ yylineno++; yycolumn=0; }while(0) ; } do_action: /* This label is used only to access EOF actions. */ /* %% [12.0] debug code goes here */ if ( yy_flex_debug ) { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); else if ( yy_act < 28 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext ); else if ( yy_act == 28 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); else if ( yy_act == 29 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); } switch ( yy_act ) { /* beginning of action switch */ /* %% [13.0] actions go here */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yyg->yy_hold_char; yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; case 1: /* rule 1 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 55 "./rvf.l" { return RVF_TOKEN_COMMENT; } YY_BREAK case 2: YY_RULE_SETUP #line 59 "./rvf.l" { BEGIN(VALUE_END); return RVF_TOKEN_COMMENT; } YY_BREAK case 3: YY_RULE_SETUP #line 64 "./rvf.l" { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_ATTRIBUTE; return RVF_TOKEN_ATTRIBUTE; } YY_BREAK case 4: YY_RULE_SETUP #line 69 "./rvf.l" { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_DEFAULT; return RVF_TOKEN_DEFAULT; } YY_BREAK case 5: YY_RULE_SETUP #line 74 "./rvf.l" { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_DEFAULTWHEN; return RVF_TOKEN_DEFAULTWHEN; } YY_BREAK case 6: YY_RULE_SETUP #line 79 "./rvf.l" { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_DESCRIPTION; return RVF_TOKEN_DESCRIPTION; } YY_BREAK case 7: YY_RULE_SETUP #line 84 "./rvf.l" { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_PUBLISH; return RVF_TOKEN_PUBLISH; } YY_BREAK case 8: YY_RULE_SETUP #line 89 "./rvf.l" { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_REQUIREDWHEN; return RVF_TOKEN_REQUIREDWHEN; } YY_BREAK case 9: YY_RULE_SETUP #line 95 "./rvf.l" { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_VALIDWHEN; return RVF_TOKEN_VALIDWHEN; } YY_BREAK case 10: YY_RULE_SETUP #line 101 "./rvf.l" { BEGIN(DELIMITER); yylval->aspect_name = RVF_TOKEN_VALUES; return RVF_TOKEN_VALUES; } YY_BREAK case 11: YY_RULE_SETUP #line 107 "./rvf.l" { BEGIN(VALUE); return RVF_TOKEN_ASPECT_DELIMITER; } YY_BREAK case 12: YY_RULE_SETUP #line 112 "./rvf.l" { ; } YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP #line 116 "./rvf.l" { BEGIN(INITIAL); return RVF_TOKEN_NEWLINE; } YY_BREAK case 14: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp = yy_bp + 22; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 122 "./rvf.l" { return RVF_TOKEN_SUBMIT; } YY_BREAK case 15: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp = yy_bp + 31; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 126 "./rvf.l" { return RVF_TOKEN_RESTART; } YY_BREAK case 16: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp = yy_bp + 36; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 131 "./rvf.l" { return RVF_TOKEN_STDIO_UPDATE; } YY_BREAK case 17: YY_RULE_SETUP #line 135 "./rvf.l" { yylval->bool_value = (strstr(yytext, "true") != NULL); return RVF_TOKEN_BOOL; } YY_BREAK case 18: YY_RULE_SETUP #line 141 "./rvf.l" { BEGIN(QUOTED); return RVF_TOKEN_QUOTE; } YY_BREAK case 19: YY_RULE_SETUP #line 146 "./rvf.l" { BEGIN(VALUE_END); yylval->value.value_type = RVF_STRINGVAL; yylval->value.string_value = strdup(yytext); return RVF_TOKEN_TEXT; } YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP #line 153 "./rvf.l" { yylval->bool_value = (strstr(yytext, "true") != NULL); BEGIN(QUOTE_END); return RVF_TOKEN_BOOL; } YY_BREAK case 21: /* rule 21 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp = yy_bp + 22; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 158 "./rvf.l" { BEGIN(QUOTED_WHENVAL); return RVF_TOKEN_SUBMIT; } YY_BREAK case 22: /* rule 22 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp = yy_bp + 36; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 164 "./rvf.l" { BEGIN(QUOTED_WHENVAL); return RVF_TOKEN_STDIO_UPDATE; } YY_BREAK case 23: /* rule 23 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp = yy_bp + 31; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 170 "./rvf.l" { BEGIN(QUOTED_WHENVAL); return RVF_TOKEN_STDIO_UPDATE; } YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP #line 176 "./rvf.l" { int len = strlen(yytext); int i,j; yylval->value.value_type = RVF_STRINGVAL; yylval->value.string_value = malloc(len+1); for (i = 0, j = 0; i < len; i++) { if (yytext[i] == '\\' && yytext[i+1] == '"') { i++; yylval->value.string_value[j++] = '"'; } else { yylval->value.string_value[j++] = yytext[i]; } } yylval->value.string_value[j] = '\0'; BEGIN(QUOTE_END); return RVF_TOKEN_TEXT; } YY_BREAK case 25: YY_RULE_SETUP #line 200 "./rvf.l" { BEGIN(VALUE_END); return RVF_TOKEN_QUOTE; } YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP #line 205 "./rvf.l" { ; } YY_BREAK case 27: /* rule 27 can match eol */ YY_RULE_SETUP #line 209 "./rvf.l" { return RVF_TOKEN_ERROR; } YY_BREAK case 28: YY_RULE_SETUP #line 210 "./rvf.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 1790 "./lex.globus_i_rvf_.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(DELIMITER): case YY_STATE_EOF(VALUE): case YY_STATE_EOF(QUOTED): case YY_STATE_EOF(QUOTED_WHENVAL): case YY_STATE_EOF(QUOTE_END): case YY_STATE_EOF(VALUE_END): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yyg->yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * globus_i_rvf_lex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yyg->yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ yy_cp = yyg->yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer( yyscanner ) ) { case EOB_ACT_END_OF_FILE: { yyg->yy_did_buffer_switch_on_eof = 0; if ( globus_i_rvf_wrap(yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yyg->yy_c_buf_p = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; yy_current_state = yy_get_previous_state( yyscanner ); yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of globus_i_rvf_lex */ /* %ok-for-header */ /* %if-c++-only */ /* %not-for-header */ /* %ok-for-header */ /* %endif */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ /* %if-c-only */ static int yy_get_next_buffer (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = yyg->yytext_ptr; register int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ globus_i_rvf_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } if ( yyg->yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; globus_i_rvf_restart(yyin ,yyscanner); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) globus_i_rvf_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } yyg->yy_n_chars += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ /* %if-c-only */ /* %not-for-header */ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { register yy_state_type yy_current_state; register char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* %% [15.0] code to get the start state into yy_current_state goes here */ yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { /* %% [16.0] code to find the next state goes here */ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 715 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ /* %if-c-only */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ register char *yy_cp = yyg->yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 715 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 714); return yy_is_jam ? 0 : yy_current_state; } /* %if-c-only */ /* %endif */ /* %if-c-only */ #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) #else static int input (yyscan_t yyscanner) #endif /* %endif */ /* %if-c++-only */ /* %endif */ { int c; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) /* This was really a NUL. */ *yyg->yy_c_buf_p = '\0'; else { /* need more input */ yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ globus_i_rvf_restart(yyin ,yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( globus_i_rvf_wrap(yyscanner ) ) return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(yyscanner); #else return input(yyscanner); #endif } case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + offset; break; } } } c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ yyg->yy_hold_char = *++yyg->yy_c_buf_p; /* %% [19.0] update BOL and yylineno */ if ( c == '\n' ) do{ yylineno++; yycolumn=0; }while(0) ; return c; } /* %if-c-only */ #endif /* ifndef YY_NO_INPUT */ /* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ void globus_i_rvf_restart (FILE * input_file , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ globus_i_rvf_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = globus_i_rvf__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } globus_i_rvf__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); globus_i_rvf__load_buffer_state(yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ /* %if-c-only */ void globus_i_rvf__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with * globus_i_rvf_pop_buffer_state(); * globus_i_rvf_push_buffer_state(new_buffer); */ globus_i_rvf_ensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } YY_CURRENT_BUFFER_LVALUE = new_buffer; globus_i_rvf__load_buffer_state(yyscanner ); /* We don't actually know whether we did this switch during * EOF (globus_i_rvf_wrap()) processing, but the only time this flag * is looked at is after globus_i_rvf_wrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } /* %if-c-only */ static void globus_i_rvf__load_buffer_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; yyg->yy_hold_char = *yyg->yy_c_buf_p; } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * @param yyscanner The scanner object. * @return the allocated buffer state. */ /* %if-c-only */ YY_BUFFER_STATE globus_i_rvf__create_buffer (FILE * file, int size , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) globus_i_rvf_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in globus_i_rvf__create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) globus_i_rvf_alloc(b->yy_buf_size + 2 ,yyscanner ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in globus_i_rvf__create_buffer()" ); b->yy_is_our_buffer = 1; globus_i_rvf__init_buffer(b,file ,yyscanner); return b; } /** Destroy the buffer. * @param b a buffer created with globus_i_rvf__create_buffer() * @param yyscanner The scanner object. */ /* %if-c-only */ void globus_i_rvf__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) globus_i_rvf_free((void *) b->yy_ch_buf ,yyscanner ); globus_i_rvf_free((void *) b ,yyscanner ); } /* %if-c-only */ #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* %endif */ /* %if-c++-only */ /* %endif */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a globus_i_rvf_restart() or at EOF. */ /* %if-c-only */ static void globus_i_rvf__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; globus_i_rvf__flush_buffer(b ,yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then globus_i_rvf__init_buffer was _probably_ * called from globus_i_rvf_restart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } /* %if-c-only */ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; /* %endif */ /* %if-c++-only */ /* %endif */ errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ /* %if-c-only */ void globus_i_rvf__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) globus_i_rvf__load_buffer_state(yyscanner ); } /* %if-c-or-c++ */ /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * @param yyscanner The scanner object. */ /* %if-c-only */ void globus_i_rvf_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; globus_i_rvf_ensure_buffer_stack(yyscanner); /* This block is copied from globus_i_rvf__switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from globus_i_rvf__switch_to_buffer. */ globus_i_rvf__load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } /* %endif */ /* %if-c-or-c++ */ /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * @param yyscanner The scanner object. */ /* %if-c-only */ void globus_i_rvf_pop_buffer_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; globus_i_rvf__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { globus_i_rvf__load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } /* %endif */ /* %if-c-or-c++ */ /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ /* %if-c-only */ static void globus_i_rvf_ensure_buffer_stack (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; yyg->yy_buffer_stack = (struct yy_buffer_state**)globus_i_rvf_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in globus_i_rvf_ensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; } if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)globus_i_rvf_realloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in globus_i_rvf_ensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; } } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE globus_i_rvf__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) globus_i_rvf_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in globus_i_rvf__scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; globus_i_rvf__switch_to_buffer(b ,yyscanner ); return b; } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan a string. The next call to globus_i_rvf_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * globus_i_rvf__scan_bytes() instead. */ YY_BUFFER_STATE globus_i_rvf__scan_string (yyconst char * yystr , yyscan_t yyscanner) { return globus_i_rvf__scan_bytes(yystr,strlen(yystr) ,yyscanner); } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan the given bytes. The next call to globus_i_rvf_lex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE globus_i_rvf__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) globus_i_rvf_alloc(n ,yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in globus_i_rvf__scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = globus_i_rvf__scan_buffer(buf,n ,yyscanner); if ( ! b ) YY_FATAL_ERROR( "bad buffer in globus_i_rvf__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } /* %endif */ #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif /* %if-c-only */ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* %endif */ /* %if-c++-only */ /* %endif */ /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ yyg->yy_hold_char = *yyg->yy_c_buf_p; \ *yyg->yy_c_buf_p = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /* %if-c-only */ /* %if-reentrant */ /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ YY_EXTRA_TYPE globus_i_rvf_get_extra (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; } /* %endif */ /** Get the current line number. * @param yyscanner The scanner object. */ int globus_i_rvf_get_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ int globus_i_rvf_get_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ FILE *globus_i_rvf_get_in (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ FILE *globus_i_rvf_get_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ yy_size_t globus_i_rvf_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; } /** Get the current token. * @param yyscanner The scanner object. */ char *globus_i_rvf_get_text (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; } /* %if-reentrant */ /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ void globus_i_rvf_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyextra = user_defined ; } /* %endif */ /** Set the current line number. * @param line_number * @param yyscanner The scanner object. */ void globus_i_rvf_set_lineno (int line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) yy_fatal_error( "globus_i_rvf_set_lineno called with no buffer" , yyscanner); yylineno = line_number; } /** Set the current column. * @param line_number * @param yyscanner The scanner object. */ void globus_i_rvf_set_column (int column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) yy_fatal_error( "globus_i_rvf_set_column called with no buffer" , yyscanner); yycolumn = column_no; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * @param yyscanner The scanner object. * @see globus_i_rvf__switch_to_buffer */ void globus_i_rvf_set_in (FILE * in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyin = in_str ; } void globus_i_rvf_set_out (FILE * out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyout = out_str ; } int globus_i_rvf_get_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } void globus_i_rvf_set_debug (int bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_flex_debug = bdebug ; } /* %endif */ /* %if-reentrant */ /* Accessor methods for yylval and yylloc */ /* %if-bison-bridge */ YYSTYPE * globus_i_rvf_get_lval (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } void globus_i_rvf_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } YYLTYPE *globus_i_rvf_get_lloc (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } void globus_i_rvf_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } /* %endif */ /* User-visible API */ /* globus_i_rvf_lex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ int globus_i_rvf_lex_init(yyscan_t* ptr_yy_globals) { if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) globus_i_rvf_alloc ( sizeof( struct yyguts_t ), NULL ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); return yy_init_globals ( *ptr_yy_globals ); } /* globus_i_rvf_lex_init_extra has the same functionality as globus_i_rvf_lex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). * The user defined value in the first argument will be available to globus_i_rvf_alloc in * the yyextra field. */ int globus_i_rvf_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; globus_i_rvf_set_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) globus_i_rvf_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); globus_i_rvf_set_extra (yy_user_defined, *ptr_yy_globals); return yy_init_globals ( *ptr_yy_globals ); } /* %endif if-c-only */ /* %if-c-only */ static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. * This function is called from globus_i_rvf_lex_destroy(), so don't allocate here. */ yyg->yy_buffer_stack = 0; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; yyg->yy_c_buf_p = (char *) 0; yyg->yy_init = 0; yyg->yy_start = 0; yyg->yy_start_stack_ptr = 0; yyg->yy_start_stack_depth = 0; yyg->yy_start_stack = NULL; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * globus_i_rvf_lex_init() */ return 0; } /* %endif */ /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* globus_i_rvf_lex_destroy is for both reentrant and non-reentrant scanners. */ int globus_i_rvf_lex_destroy (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ globus_i_rvf__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; globus_i_rvf_pop_buffer_state(yyscanner); } /* Destroy the stack itself. */ globus_i_rvf_free(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ globus_i_rvf_free(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * globus_i_rvf_lex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* %if-reentrant */ /* Destroy the main struct (reentrant only). */ globus_i_rvf_free ( yyscanner , yyscanner ); yyscanner = NULL; /* %endif */ return 0; } /* %endif */ /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *globus_i_rvf_alloc (yy_size_t size , yyscan_t yyscanner) { return (void *) malloc( size ); } void *globus_i_rvf_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void globus_i_rvf_free (void * ptr , yyscan_t yyscanner) { free( (char *) ptr ); /* see globus_i_rvf_realloc() for (char *) cast */ } /* %if-tables-serialization definitions */ /* %define-yytables The name for this specific scanner's tables. */ #define YYTABLES_NAME "yytables" /* %endif */ /* %ok-for-header */ #line 210 "./rvf.l" globus_gram_job_manager-13.53/compile0000755000076400007640000000717312145177133014675 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: globus_gram_job_manager-13.53/globus_gram_job_manager_rsl.c0000666000076400007640000010302011351702013021145 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_gram_job_manager_rsl.c Job Manager RSL Manipulations */ #include "globus_gram_job_manager.h" #include "globus_rsl_assist.h" #include /* Module Specific Prototypes */ static int globus_l_gram_job_manager_rsl_match( void * datum, void * arg); #endif /** * Merge two sets of RSL relations. * * Create a new RSL consisting of the merging of the base_rsl and override_rsl. * The result after completion is one RSL containing all of the relations * from the base_rsl and the override_rsl with any conflicting definitions * resolved by the override_rsl winning. The base_rsl and override_rsl * are unmodified in this process. */ globus_rsl_t * globus_gram_job_manager_rsl_merge( globus_rsl_t * base_rsl, globus_rsl_t * override_rsl) { globus_rsl_t * tmp; globus_list_t ** base_relations; globus_list_t * override_relations; globus_rsl_t * result; char * attribute; globus_list_t * node; globus_assert(globus_rsl_is_boolean_and(base_rsl)); globus_assert(globus_rsl_is_boolean_and(override_rsl)); result = globus_rsl_copy_recursive(base_rsl); base_relations = globus_rsl_boolean_get_operand_list_ref(result); override_relations = globus_rsl_boolean_get_operand_list(override_rsl); while(!globus_list_empty(override_relations)) { tmp = globus_list_first(override_relations); override_relations = globus_list_rest(override_relations); attribute = globus_rsl_relation_get_attribute(tmp); node = globus_list_search_pred(*base_relations, globus_l_gram_job_manager_rsl_match, attribute); if(node) { globus_rsl_free_recursive(globus_list_remove(base_relations, node)); } globus_list_insert(base_relations, globus_rsl_copy_recursive(tmp)); } return result; } /* globus_l_gram_job_manager_rsl_merge() */ /** * Check to see if an RSL attribute exists in the given RSL. * * @param rsl * RSL parse tree to search * @param attribute * Attribute name to search for. * * @retval GLOBUS_TRUE * Attribute exists in the RSL. * @retval GLOBUS_FALSE * Attribute does not exist in the RSL. */ globus_bool_t globus_gram_job_manager_rsl_attribute_exists( globus_rsl_t * rsl, const char * attribute) { globus_list_t * attributes; attributes = globus_rsl_boolean_get_operand_list(rsl); return globus_list_search_pred( attributes, globus_l_gram_job_manager_rsl_match, (void *) attribute) ? GLOBUS_TRUE : GLOBUS_FALSE; } globus_bool_t globus_gram_job_manager_rsl_need_stage_in( globus_gram_jobmanager_request_t * request) { globus_list_t * attributes; globus_list_t * node; char * value; globus_url_t url; int i; char * can_stage[] = { GLOBUS_GRAM_PROTOCOL_STDIN_PARAM, GLOBUS_GRAM_PROTOCOL_EXECUTABLE_PARAM, NULL }; attributes = globus_rsl_boolean_get_operand_list(request->rsl); if(globus_list_search_pred(attributes, globus_l_gram_job_manager_rsl_match, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_PARAM)) { return GLOBUS_TRUE; } else if(globus_list_search_pred( attributes, globus_l_gram_job_manager_rsl_match, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_SHARED_PARAM)) { return GLOBUS_TRUE; } else { for(i = 0; can_stage[i] != NULL; i++) { node = globus_rsl_param_get_values( request->rsl, can_stage[i]); if(node) { value = globus_rsl_value_literal_get_string( globus_list_first(node)); if(globus_url_parse(value, &url) == 0) { if(url.scheme_type != GLOBUS_URL_SCHEME_FILE) { globus_url_destroy(&url); return GLOBUS_TRUE; } else { globus_url_destroy(&url); } } } } } return GLOBUS_FALSE; } /* globus_gram_job_manager_rsl_need_stage_in() */ globus_bool_t globus_gram_job_manager_rsl_need_stage_out( globus_gram_jobmanager_request_t * request) { globus_list_t * attributes; attributes = globus_rsl_boolean_get_operand_list(request->rsl); if(globus_list_search_pred(attributes, globus_l_gram_job_manager_rsl_match, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_OUT_PARAM)) { return GLOBUS_TRUE; } else if (globus_list_search_pred( attributes, globus_l_gram_job_manager_rsl_match, "filestreamout")) { return GLOBUS_TRUE; } else { return GLOBUS_FALSE; } } /* globus_gram_job_manager_rsl_need_stage_out() */ globus_bool_t globus_gram_job_manager_rsl_need_file_cleanup( globus_gram_jobmanager_request_t * request) { globus_list_t * attributes; attributes = globus_rsl_boolean_get_operand_list(request->rsl); if(globus_list_search_pred(attributes, globus_l_gram_job_manager_rsl_match, GLOBUS_GRAM_PROTOCOL_FILE_CLEANUP_PARAM)) { return GLOBUS_TRUE; } else { return GLOBUS_FALSE; } } /* globus_gram_job_manager_rsl_need_file_cleanup() */ globus_bool_t globus_gram_job_manager_rsl_need_scratchdir( globus_gram_jobmanager_request_t * request) { globus_list_t * attributes; attributes = globus_rsl_boolean_get_operand_list(request->rsl); if(globus_list_search_pred(attributes, globus_l_gram_job_manager_rsl_match, GLOBUS_GRAM_PROTOCOL_SCRATCHDIR_PARAM)) { return GLOBUS_TRUE; } else { return GLOBUS_FALSE; } } /* globus_gram_job_manager_rsl_need_scratchdir() */ globus_bool_t globus_gram_job_manager_rsl_need_restart( globus_gram_jobmanager_request_t * request) { return globus_gram_job_manager_rsl_attribute_exists( request->rsl, GLOBUS_GRAM_PROTOCOL_RESTART_PARAM); } /* globus_gram_job_manager_rsl_need_restart() */ globus_rsl_t * globus_gram_job_manager_rsl_extract_relation( globus_rsl_t * rsl, const char * attribute) { globus_list_t ** operand_ref; globus_list_t * node; if(! globus_rsl_is_boolean_and(rsl)) { return GLOBUS_NULL; } operand_ref = globus_rsl_boolean_get_operand_list_ref(rsl); node = globus_list_search_pred(*operand_ref, globus_l_gram_job_manager_rsl_match, (void *) attribute); if(node) { globus_rsl_t * relation; relation = globus_list_remove(operand_ref, node); return relation; } return GLOBUS_NULL; } /* globus_gram_job_manager_rsl_extract_relation() */ int globus_gram_job_manager_rsl_add_relation( globus_rsl_t * rsl, globus_rsl_t * relation) { globus_list_t ** operand_ref; int rc = GLOBUS_SUCCESS; if(! globus_rsl_is_boolean_and(rsl)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto nonboolean; } operand_ref = globus_rsl_boolean_get_operand_list_ref(rsl); if (operand_ref == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto no_operands; } rc = globus_list_insert(operand_ref, relation); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto insert_failed; } insert_failed: no_operands: nonboolean: return rc; } /* globus_gram_job_manager_rsl_add_relation() */ /** * Create and insert a stdout or stderr attribute with the specified value. * * This function modifies the @a rsl parameter, adding a new relation of the * form: * @a attribute = ( @a value ) * This funtion assumes that the specified attribute is not present in the * RSL when called. Unlike the globus_rsl library, this function copies the * @a attribute and @a value strings as needed to keep it so the RSL can * be freed by calling globus_rsl_free_recursive(). * * @param request * Job request * @param rsl * RSL to modify * @param attribute * Attribute (either stdout or stderr) * @param value * Local output path * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed */ int globus_gram_rsl_add_output( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, const char * attribute, const char * value) { globus_rsl_t * relation; char * attr_copy; char * value_copy; globus_list_t * value_list = NULL; globus_rsl_value_t * value_literal; globus_rsl_value_t * value_sequence; int rc = GLOBUS_SUCCESS; attr_copy = strdup(attribute); if (attr_copy == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto attr_copy_failed; } value_copy = strdup(value); if (value_copy == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto value_copy_failed; } value_literal = globus_rsl_value_make_literal( value_copy); if (value_literal == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto make_literal_failed; } rc = globus_list_insert(&value_list, value_literal); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto list_insert_failed; } value_sequence = globus_rsl_value_make_sequence(value_list); if (value_sequence == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto make_sequence_failed; } relation = globus_rsl_make_relation( GLOBUS_RSL_EQ, attr_copy, value_sequence); if (relation == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto make_relation_failed; } rc = globus_gram_job_manager_rsl_add_relation( request->rsl, relation); if (rc != GLOBUS_SUCCESS) { goto add_relation_failed; } if (rc != GLOBUS_SUCCESS) { add_relation_failed: make_relation_failed: globus_rsl_value_free(value_sequence); make_sequence_failed: globus_list_free(value_list); list_insert_failed: globus_rsl_value_free(value_literal); make_literal_failed: free(value_copy); value_copy_failed: free(attr_copy); attr_copy_failed: ; } return rc; } /* globus_gram_rsl_add_output() */ /** * Add a stage out value to the RSL * * Creates a new entry in the RSL's filestreamout value list for the * given (@a source, @a destination) pair. If the RSL does not contain * filestageout, it is added; otherwise, the new pair is prepended to the * existing list. * * @param request * Job request * @param rsl * RSL to modify * @param source * Source URL * @param destination * Destination URL * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed */ int globus_gram_rsl_add_stream_out( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, const char * source, const char * destination) { globus_list_t ** operand_ref; globus_list_t * node; char * attr_copy; char * source_copy; char * dest_copy; int rc = GLOBUS_SUCCESS; globus_rsl_t * relation; globus_rsl_value_t * value_sequence; globus_rsl_value_t * source_literal; globus_rsl_value_t * dest_literal; globus_list_t * file_stage_out_pair; globus_list_t ** file_stage_out_pair_end; globus_rsl_value_t * new_stage_sequence; operand_ref = globus_rsl_boolean_get_operand_list_ref(rsl); node = globus_list_search_pred( *operand_ref, globus_l_gram_job_manager_rsl_match, (void *) "filestreamout"); if (!node) { /* No file_stage_out in RSL, add a new empty one */ attr_copy = strdup("filestreamout"); if (attr_copy == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto attr_copy_failed; } value_sequence = globus_rsl_value_make_sequence(NULL); if (value_sequence == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto make_value_sequence_failed; } relation = globus_rsl_make_relation( GLOBUS_RSL_EQ, attr_copy, value_sequence); if (relation == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto make_value_relation_failed; } rc = globus_list_insert(operand_ref, relation); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto filestageout_insert_failed; } if (rc != GLOBUS_SUCCESS) { filestageout_insert_failed: globus_rsl_free(relation); make_value_relation_failed: globus_rsl_value_free(value_sequence); make_value_sequence_failed: free(attr_copy); attr_copy_failed: goto bad_relation; } } else { /* Adding new value to existing filestageout */ relation = globus_list_first(node); } /* * Now we're going to create a value sequence to append to the relation's * value sequence */ source_copy = strdup(source); if (source_copy == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto source_copy_failed; } dest_copy = strdup(destination); if (dest_copy == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto dest_copy_failed; } source_literal = globus_rsl_value_make_literal(source_copy); if (source_literal == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto source_literal_failed; } dest_literal = globus_rsl_value_make_literal(dest_copy); if (dest_literal == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto dest_literal_failed; } file_stage_out_pair = NULL; file_stage_out_pair_end = &file_stage_out_pair; rc = globus_list_insert( file_stage_out_pair_end, source_literal); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto add_source_literal_failed; } file_stage_out_pair_end = globus_list_rest_ref(*file_stage_out_pair_end); rc = globus_list_insert( file_stage_out_pair_end, dest_literal); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto add_dest_literal_failed; } new_stage_sequence = globus_rsl_value_make_sequence(file_stage_out_pair); if (new_stage_sequence == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto make_new_stage_sequence_failed; } rc = globus_list_insert( globus_rsl_value_sequence_get_list_ref( globus_rsl_relation_get_value_sequence(relation)), new_stage_sequence); if (rc != GLOBUS_SUCCESS) { goto insert_new_stage_sequence_failed; } if (rc != GLOBUS_SUCCESS) { insert_new_stage_sequence_failed: globus_rsl_value_free(new_stage_sequence); make_new_stage_sequence_failed: add_dest_literal_failed: globus_list_free(file_stage_out_pair); add_source_literal_failed: globus_rsl_value_free(dest_literal); dest_literal_failed: globus_rsl_value_free(source_literal); source_literal_failed: free(dest_copy); dest_copy_failed: free(source_copy); } source_copy_failed: bad_relation: return rc; } /* globus_gram_rsl_add_stream_out() */ /** * Add an environment variable to the job RSL. * * This function adds a single environment variable to the job RSL. If * there is no environment relation in the RSL, then one is added. Both * the variable name and value are copied into the RSL, so the original * values passed in may be static strings or pointers to data which is * freed or overwritten once this function returns. * * @param ast_node * A pointer to the RSL tree to update. This should point to the * root of the rsl tree (the boolean &) on the invocation of the * function, but will point to various relations in the RSL as * it calls itself recursively. * @param var * A pointer to a string containing the variable to be added to * the RSL. No checking is done to see if this environment variable * is already defined in the RSL. This will be duplicated and inserted * into the RSL. * @param value * The value of the environment variable named @a var. This will * be duplicated and inserted into the RSL. * * @retval 0 * The environment variable was added to the RSL. * @retval 1 * The @a ast_node points to a relation other than an environment * relation * @retval 2 * The @a ast_node points to some unexpected part of the RSL. * * @todo Remove old values of @a var if it is already in the RSL's * environment attribute's value. */ int globus_gram_job_manager_rsl_env_add( globus_rsl_t * ast_node, const char * var, const char * value) { globus_rsl_t * tmp_rsl_ptr; globus_list_t * tmp_rsl_list; globus_list_t * new_list; char * tmp_rsl_str; int rc; if (globus_rsl_is_boolean(ast_node)) { tmp_rsl_list = globus_rsl_boolean_get_operand_list(ast_node); while (! globus_list_empty(tmp_rsl_list)) { tmp_rsl_ptr = (globus_rsl_t *) globus_list_first (tmp_rsl_list); rc = globus_gram_job_manager_rsl_env_add( tmp_rsl_ptr, var, value); if(rc == 0) { return rc; } tmp_rsl_list = globus_list_rest(tmp_rsl_list); } /* Didn't find environment in the RSL: add it! */ tmp_rsl_str = malloc( strlen("environment = (%s %s)") + strlen(var) + strlen(value)); sprintf(tmp_rsl_str, "environment = (%s %s)", var, value); tmp_rsl_ptr = globus_rsl_parse(tmp_rsl_str); free(tmp_rsl_str); globus_list_insert( globus_rsl_boolean_get_operand_list_ref(ast_node), tmp_rsl_ptr); return 0; } else if (globus_rsl_is_relation(ast_node)) { if (!globus_rsl_is_relation_attribute_equal(ast_node, "environment")) { return(1); } new_list = NULL; globus_list_insert(&new_list, (void *) globus_rsl_value_make_literal(strdup(value))); globus_list_insert(&new_list, (void *) globus_rsl_value_make_literal(strdup(var))); globus_list_insert( globus_rsl_value_sequence_get_list_ref( globus_rsl_relation_get_value_sequence(ast_node)), (void *) globus_rsl_value_make_sequence(new_list)); return(0); } else { return(2); } } /* globus_gram_job_manager_rsl_env_add() */ /** * Remove an RSL attribute from and RSL tree. * * @param rsl * The RSL parse tree to modify * @param attribute * The name of the attribute to remove from the RSL. The * attribute and it's values will be freed. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL * Bad RSL */ int globus_gram_job_manager_rsl_remove_attribute( globus_rsl_t * rsl, char * attribute) { globus_list_t ** operand_ref; globus_list_t * node; if(! globus_rsl_is_boolean_and(rsl)) { return GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; } operand_ref = globus_rsl_boolean_get_operand_list_ref(rsl); node = globus_list_search_pred(*operand_ref, globus_l_gram_job_manager_rsl_match, attribute); if(node) { globus_rsl_free_recursive(globus_list_remove(operand_ref, node)); } return GLOBUS_SUCCESS; } /* globus_gram_job_manager_rsl_remove_attribute() */ /** * Evaluate RSL substitutions for a single RSL attribute * * Evaluates the value of the named RSL attribute. If it is present, and * the evaluation succeeds, then the @a value parameter is modified to * contain a copy of the newly-evaluated value of the attribute. * * @param request * The request containing the RSL tree to evaluate. * @param attribute * The name of the attribute to evaluate. * @param value * A pointer to a char * which will be filled with a copy * of the evaluated value of the RSL attribute. If the attribute * is not found, or an error occurs, this will be set to NULL. * * @retval GLOBUS_SUCCESS * The RSL attribute is present and has evaluated successfully. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL * The RSL is not a boolean tree containing attributes. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_EVALUATION_FAILED * The RSL attribute is present but some RSL substitution * could not be evaluated for that attribute. */ int globus_gram_job_manager_rsl_eval_one_attribute( globus_gram_jobmanager_request_t * request, char * attribute, char ** value) { globus_list_t * attributes; globus_list_t * node; globus_rsl_t * attribute_rsl = GLOBUS_NULL; char * single_value; int rc = GLOBUS_SUCCESS; *value = GLOBUS_NULL; attributes = globus_rsl_boolean_get_operand_list(request->rsl); if (attributes == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto bad_operand_list; } node = globus_list_search_pred( attributes, globus_l_gram_job_manager_rsl_match, attribute); if (!node) { goto no_match; } attribute_rsl = globus_list_first(node); if (!attribute_rsl) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto no_attribute; } rc = globus_rsl_eval(attribute_rsl, &request->symbol_table); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED; goto rsl_eval_failed; } single_value = globus_rsl_value_literal_get_string( globus_rsl_relation_get_single_value( attribute_rsl)); if (single_value) { *value = strdup(single_value); if (*value == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto value_strdup_failed; } } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; } value_strdup_failed: rsl_eval_failed: no_attribute: no_match: bad_operand_list: return rc; } /* globus_gram_job_manager_eval_one_attribute() */ int globus_gram_job_manager_rsl_parse_value( char * value_string, globus_rsl_value_t ** rsl_value) { char * rsl_spec = NULL; char * format = "x = %s\n"; globus_rsl_t * rsl; globus_rsl_value_t * values; int rc = GLOBUS_SUCCESS; rsl_spec = malloc(strlen(format) + strlen(value_string) + 1); if (rsl_spec == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } sprintf(rsl_spec, format, value_string); rsl = globus_rsl_parse(rsl_spec); if (rsl == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto free_rsl_spec_out; } values = globus_list_first( globus_rsl_value_sequence_get_value_list( globus_rsl_relation_get_value_sequence(rsl))); if (values == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto free_rsl_out; } *rsl_value = globus_rsl_value_copy_recursive(values); if (*rsl_value == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto free_rsl_out; } free_rsl_out: globus_rsl_free_recursive(rsl); free_rsl_spec_out: free(rsl_spec); out: return rc; } /* globus_gram_job_manager_rsl_parse_value() */ int globus_gram_job_manager_rsl_evaluate_value( globus_symboltable_t * symbol_table, globus_rsl_value_t * value, char ** value_string) { globus_rsl_value_t * copy; int rc = GLOBUS_SUCCESS; *value_string = NULL; copy = globus_rsl_value_copy_recursive(value); if (copy == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } if(globus_rsl_value_is_literal(copy)) { *value_string = strdup(globus_rsl_value_literal_get_string(copy)); if (*value_string == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto free_copy_out; } } else { rc = globus_rsl_value_eval( copy, symbol_table, value_string, 0); } free_copy_out: globus_rsl_value_free_recursive(copy); out: return rc; } /* globus_gram_job_manager_rsl_evaluate_value() */ int globus_gram_job_manager_rsl_eval_string( globus_symboltable_t * symbol_table, const char * string, char ** value_string) { globus_rsl_value_t * value; int rc; *value_string = NULL; rc = globus_gram_job_manager_rsl_parse_value( (char *) string, &value); if(rc != GLOBUS_SUCCESS) { goto parse_failed; } rc = globus_gram_job_manager_rsl_evaluate_value( symbol_table, value, value_string); if(rc != GLOBUS_SUCCESS || (*value_string) == NULL) { goto eval_failed; } eval_failed: globus_rsl_value_free_recursive(value); parse_failed: return rc; } /* globus_gram_job_manager_rsl_eval_string() */ #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL static int globus_l_gram_job_manager_rsl_match( void * datum, void * arg) { globus_rsl_t * relation = datum; char * attribute = arg; char * test; if(!globus_rsl_is_relation(relation)) { return GLOBUS_FALSE; } test = globus_rsl_relation_get_attribute(relation); return (strcmp(test, attribute)==0); } /* globus_l_gram_job_manager_rsl_match() */ #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ /** * Search the RSL tree for an attribute and return its single value * * @param rsl * RSL tree to search * @param attribute * Attribute name to search for * @param value_ptr * Pointer to set to the value of this attribute. Must not be freed * by the caller. Will be set to NULL if the attribute is not present or * does not have a literal string value. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE * Attribute not found. */ int globus_gram_job_manager_rsl_attribute_get_string_value( globus_rsl_t * rsl, const char * attribute, const char ** value_ptr) { globus_list_t * attributes; globus_list_t * node; int rc = GLOBUS_SUCCESS; attributes = globus_rsl_boolean_get_operand_list(rsl); node = globus_list_search_pred( attributes, globus_l_gram_job_manager_rsl_match, (void *) attribute); if (node == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE; goto search_failed; } *value_ptr = globus_rsl_value_literal_get_string( globus_rsl_relation_get_single_value( globus_list_first(node))); search_failed: if (rc != GLOBUS_SUCCESS) { *value_ptr = NULL; } return rc; } /* globus_gram_job_manager_rsl_attribute_get_string_value() */ /** * Search the RSL tree for an attribute and return its boolean value * * @param rsl * RSL tree to search * @param attribute * Attribute name to search for * @param value_ptr * Pointer to set to the value of this attribute. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE; * Attribute not found. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL * Value is non-literal or has a non-boolean value. */ int globus_gram_job_manager_rsl_attribute_get_boolean_value( globus_rsl_t * rsl, const char * attribute, globus_bool_t * value_ptr) { const char * s; int rc = GLOBUS_SUCCESS; rc = globus_gram_job_manager_rsl_attribute_get_string_value( rsl, attribute, &s); if (rc != GLOBUS_SUCCESS) { goto get_literal_failed; } if (s && strcmp(s, "yes") == 0) { *value_ptr = GLOBUS_TRUE; } else if (s && strcmp(s, "no") == 0) { *value_ptr = GLOBUS_FALSE; } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; get_literal_failed: *value_ptr = GLOBUS_FALSE; } return rc; } /* globus_gram_job_manager_rsl_attribute_get_boolean_value() */ /** * Search the RSL tree for an attribute and return its integer value * * @param rsl * RSL tree to search * @param attribute * Attribute name to search for * @param value_ptr * Pointer to set to the value of this attribute. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE; * Attribute not found. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL * Value is non-literal or has a non-int value. */ int globus_gram_job_manager_rsl_attribute_get_int_value( globus_rsl_t * rsl, const char * attribute, int * value_ptr) { const char * s; char * end; int rc = GLOBUS_SUCCESS; rc = globus_gram_job_manager_rsl_attribute_get_string_value( rsl, attribute, &s); if (rc != GLOBUS_SUCCESS) { goto get_literal_failed; } else if (s == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto get_literal_failed; } errno = 0; *value_ptr = strtol(s, &end, 10); if (errno != 0 || strlen(end) != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; get_literal_failed: *value_ptr = 0; } return rc; } /* globus_gram_job_manager_rsl_attribute_get_int_value() */ globus_gram_job_manager-13.53/globus_gram_job_manager_config.c0000666000076400007640000007327112013453433021635 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_job_manager.c Resource Allocation Job Manager * * CVS Information: * * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_job_manager_config.c,v $ * $Date: 2012/08/17 14:37:15 $ * $Revision: 1.24.4.4 $ * $Author: bester $ */ #include "globus_gram_job_manager.h" #include "globus_common.h" #include static int globus_l_gram_tokenize( char * command, char ** args, int * n); static int globus_l_env_present( void * datum, void * arg); #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ /** * Initialize configuration based on command-line arguments * * @param config * LRMA-specific configuration state * @param argc * Count of command-line arguments to the job manager. * @param argv * Array of command-line arguments to the job manager. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED * Command-line includes -help */ int globus_gram_job_manager_config_init( globus_gram_job_manager_config_t * config, int argc, char ** argv) { int i; int rc = 0; char * tmp; char hostname[MAXHOSTNAMELEN]; struct utsname utsname; char * conf_path = NULL; char * dot; char * gatekeeper_contact; memset(config, 0, sizeof(globus_gram_job_manager_config_t)); /* if -conf is passed then get the arguments from the file * specified */ if (argc > 2 && !strcmp(argv[1],"-conf")) { char ** newargv; char * newbuf; int newargc = 52; int length; FILE *fp; newargv = (char**) malloc(newargc * sizeof(char *)); /* not freed */ newargv[0] = argv[0]; /* get file length via fseek & ftell */ if ((fp = fopen(argv[2], "r")) == NULL) { globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_FATAL, "event=gram.config.end level=FATAL path=\"%s\" " "status=-1 msg=\"%s\" errno=%d reason=\"%s\"\n", argv[2], "Error opening configuration file", errno, strerror(errno)); exit(1); } conf_path = argv[2]; fseek(fp, 0, SEEK_END); length = ftell(fp); if (length <=0) { globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_FATAL, "event=gram.config.end level=FATAL path=\"%s\" " "status=-1 msg=\"%s\" errno=%d reason=\"%s\"\n", conf_path, "Error determining config file length", errno, strerror(errno)); exit(1); } rewind(fp); newbuf = (char *) malloc(length+1); /* dont free */ i = fread(newbuf, 1, length, fp); if (i < 0) { globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_FATAL, "event=gram.config.end level=FATAL path=\"%s\" " "status=-1 msg=\"%s\" errno=%d reason=\"%s\"\n", conf_path, "Error reading configuration file", errno, strerror(errno)); exit(1); } newbuf[i] = '\0'; fclose(fp); newargv[0] = argv[0]; newargc--; globus_l_gram_tokenize(newbuf, &newargv[1], &newargc); for (i=3; ilog_levels = -1; /* Default to using GLOBUS_USAGE_TARGETS environment variable. * If not set, use the Globus usage stats service * Eitehr can be overridden by using -disable-usagestats or setting * -usagestats-targets in the configuration file */ if ((tmp = getenv("GLOBUS_USAGE_TARGETS")) != NULL) { config->usage_targets = strdup(tmp); } else { config->usage_targets = strdup("usage-stats.globus.org:4810"); } /* * Parse the command line arguments */ for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-k") == 0) { config->kerberos = GLOBUS_TRUE; } else if ((strcmp(argv[i], "-home") == 0) && (i + 1 < argc)) { config->globus_location = strdup(argv[++i]); } else if ((strcmp(argv[i], "-target-globus-location") == 0) && (i + 1 < argc)) { config->target_globus_location = strdup(argv[++i]); } else if ((strcmp(argv[i], "-type") == 0) && (i + 1 < argc)) { config->jobmanager_type = strdup(argv[++i]); } else if((strcmp(argv[i], "-history") == 0) && (i + 1 < argc)) { config->job_history_dir = strdup(argv[++i]); } else if (strcmp(argv[i], "-cache-location") == 0) { config->cache_location = strdup(argv[++i]); } else if (strcmp(argv[i], "-scratch-dir-base") == 0) { config->scratch_dir_base = strdup(argv[++i]); } else if ((strcmp(argv[i], "-condor-arch") == 0) && (i + 1 < argc)) { config->condor_arch = strdup(argv[++i]); } else if ((strcmp(argv[i], "-condor-os") == 0) && (i + 1 < argc)) { config->condor_os = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-gatekeeper-host") == 0) && (i + 1 < argc)) { config->globus_gatekeeper_host = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-gatekeeper-port") == 0) && (i + 1 < argc)) { config->globus_gatekeeper_port = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-gatekeeper-subject") == 0) && (i + 1 < argc)) { config->globus_gatekeeper_subject = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-host-manufacturer") == 0) && (i + 1 < argc)) { config->globus_host_manufacturer = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-host-cputype") == 0) && (i + 1 < argc)) { config->globus_host_cputype = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-host-osname") == 0) && (i + 1 < argc)) { config->globus_host_osname = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-host-osversion") == 0) && (i + 1 < argc)) { config->globus_host_osversion = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-tcp-port-range") == 0) && (i + 1 < argc)) { config->tcp_port_range = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-tcp-source-range") == 0) && (i + 1 < argc)) { config->tcp_source_range = strdup(argv[++i]); } else if ((strcmp(argv[i], "-state-file-dir") == 0) && (i + 1 < argc)) { config->job_state_file_dir = strdup(argv[++i]); } else if ((strcmp(argv[i], "-x509-cert-dir") == 0) && (i + 1 < argc)) { config->x509_cert_dir = strdup(argv[++i]); } else if ((strcmp(argv[i], "-extra-envvars") == 0) && (i + 1 < argc)) { char * extra_envvars = strdup(argv[++i]); char *p, *q; p = extra_envvars; while (p && *p) { q = strchr(p, ','); if (q) { *q = 0; } globus_list_insert( &config->extra_envvars, strdup(p)); if (q) { p = q+1; } else { p = q; } } free(extra_envvars); } else if ((strcasecmp(argv[i], "-seg-module" ) == 0) && (i + 1 < argc)) { config->seg_module = strdup(argv[++i]); } else if ((strcmp(argv[i], "-audit-directory") == 0) && (i+1 < argc)) { globus_eval_path(argv[++i], &config->auditing_dir); } else if ((strcmp(argv[i], "-globus-toolkit-version") == 0) && (i+1 < argc)) { config->globus_version = strdup(argv[++i]); } else if (strcmp(argv[i], "-disable-streaming") == 0) { /* Ignore this request, as we don't do streaming any more */ config->streaming_disabled = GLOBUS_FALSE; } else if (strcmp(argv[i], "-service-tag") == 0 && (i+1 < argc)) { config->service_tag = strdup(argv[++i]); } else if (strcmp(argv[i], "-enable-syslog") == 0) { config->syslog_enabled = GLOBUS_TRUE; } else if (strcmp(argv[i], "-stdio-log") == 0 && (i+1 < argc)) { /* Backward-compatible definition of -stdio-log based on * -log-pattern implementation */ config->log_pattern = globus_common_create_string( "%s/gram_$(DATE).log", argv[++i]); } else if (strcmp(argv[i], "-log-pattern") == 0 && (i+1 < argc)) { config->log_pattern = strdup(argv[++i]); } else if ((strcmp(argv[i], "-globus-job-dir") == 0) && (i + 1 < argc)) { config->job_dir_home = globus_common_create_string( "%s/%s", argv[++i], strdup(getenv("USER"))); if (config->job_dir_home == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.config.info " "level=TRACE " "option=\"-globus-job-dir\" " "path=\"%s\" " "\n", config->job_dir_home); } else if (strcmp(argv[i], "-log-levels") == 0 && (i+1 < argc)) { rc = globus_i_gram_parse_log_levels( argv[++i], &config->log_levels, NULL); } else if (strcmp(argv[i], "-disable-usagestats") == 0) { config->usage_disabled = GLOBUS_TRUE; } else if (strcmp(argv[i], "-usagestats-targets") == 0 && (i+1 < argc)) { if (config->usage_targets) { free(config->usage_targets); config->usage_targets = NULL; } config->usage_targets = strdup(argv[++i]); } else if (strcmp(argv[i], "-enable-callout") == 0) { config->enable_callout = GLOBUS_TRUE; } else if ((strcasecmp(argv[i], "-help" ) == 0) || (strcasecmp(argv[i], "--help") == 0)) { fprintf(stderr, "Usage: globus-gram-jobmanager\n" "\n" "Required Arguments:\n" "\t-type jobmanager type, i.e. fork, lsf ...\n" "\t-globus-host-manufacturer manufacturer\n" "\t-globus-host-cputype cputype\n" "\t-globus-host-osname osname\n" "\t-globus-host-osversion osversion\n" "\t-globus-gatekeeper-host host\n" "\t-globus-gatekeeper-port port\n" "\t-globus-gatekeeper-subject subject\n" "\n" "Options:\n" "\t-home globus_location\n" "\t-target-globus-location globus_location\n" "\t-condor-arch arch, i.e. SUN4x\n" "\t-condor-os os, i.e. SOLARIS26\n" "\t-history job-history-directory\n" "\t-scratch-dir-base scratch-directory\n" "\t-enable-syslog\n" "\t-stdio-log DIRECTORY\n" "\t-log-levels TRACE|INFO|DEBUG|WARN|ERROR|FATAL\n" "\t-state-file-dir state-directory\n" "\t-globus-tcp-port-range ,\n" "\t-globus-tcp-source-range ,\n" "\t-x509-cert-dir DIRECTORY\n" "\t-cache-location PATH\n" "\t-k\n" "\t-extra-envvars VAR1,VAR2,...\n" "\t-seg-module SEG-MODULE\n" "\t-audit-directory DIRECTORY\n" "\t-globus-toolkit-version VERSION\n" "\t-usagestats-targets [!],...\n" "\t-enable-callout\n" "\t-globus-job-dir DIRECTORY\n" "\n" "Note: if type=condor then\n" " -condor-os & -condor-arch are required.\n" "\n"); rc = GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED; goto out; } else { globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.config level=ERROR path=\"%s\" " "argument=%s reason=\"Invalid command-line option\"\n", conf_path ? conf_path : "ARGV", argv[i] ? argv[i] : ""); } } /* If log levels were not specified on the command-line or configuration, set the * service default */ if (config->log_levels == -1) { config->log_levels = 0; } /* Always have these at a minimum */ config->log_levels |= GLOBUS_GRAM_JOB_MANAGER_LOG_FATAL | GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR; /* Verify that required values are present */ if(config->jobmanager_type == NULL) { globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.config level=ERROR path=\"%s\" argument=\"-type\" reason=\"Missing -type command-line option\"\n", conf_path ? conf_path : "ARGV"); rc = GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED; goto out; } if(config->home == NULL) { config->home = strdup(getenv("HOME")); if (config->home == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } } if (config->service_tag == NULL) { config->service_tag = strdup("untagged"); } if (config->tcp_port_range == NULL) { char * ev = getenv("GLOBUS_TCP_PORT_RANGE"); if (ev != NULL) { config->tcp_port_range = strdup(ev); } } if (config->tcp_source_range == NULL) { char * ev = getenv("GLOBUS_TCP_SOURCE_RANGE"); if (ev != NULL) { config->tcp_source_range = strdup(ev); } } if (! globus_list_search_pred( config->extra_envvars, globus_l_env_present, "PATH")) { char * path = strdup("PATH"); if (!path) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } globus_list_insert(&config->extra_envvars, path); } /* Now initialize values from our environment */ config->logname = strdup(getenv("LOGNAME")); if (config->logname == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } if (config->globus_location == NULL) { rc = globus_location(&config->globus_location); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } } if (config->target_globus_location == NULL) { config->target_globus_location = strdup(config->globus_location); if (config->target_globus_location == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } } if (config->job_state_file_dir == NULL) { rc = globus_eval_path("${localstatedir}/lib/globus/gram_job_state", &config->job_state_file_dir); if (rc != 0 || config->job_state_file_dir == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } } if (config->job_dir_home == NULL) { config->job_dir_home = globus_common_create_string("%s/%s", config->job_state_file_dir, config->logname); if (config->job_dir_home == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } } if (config->scratch_dir_base == NULL) { config->scratch_dir_base = strdup( config->home); if (config->scratch_dir_base == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } } rc = globus_libc_gethostname(hostname, sizeof(hostname)); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } config->hostname = strdup(hostname); if (config->hostname == GLOBUS_NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } config->short_hostname = strdup(hostname); dot = strchr(config->short_hostname, '.'); if (dot != NULL) { *dot = 0; } rc = uname(&utsname); if (rc >= 0) { if (config->globus_host_osname == NULL) { config->globus_host_osname = strdup(utsname.sysname); } if (config->globus_host_osversion == NULL) { if (strcmp(utsname.sysname, "AIX") == 0) { config->globus_host_osversion = globus_common_create_string( "%s.%s", utsname.version, utsname.release); } else { config->globus_host_osversion = globus_common_create_string( "%s", utsname.release); } } } gatekeeper_contact = getenv("GLOBUS_GATEKEEPER_CONTACT_STRING"); if (gatekeeper_contact) { char *colon; char *save = strdup(gatekeeper_contact); gatekeeper_contact = save; if (gatekeeper_contact) { colon = strchr(gatekeeper_contact, ':'); if (colon) { if (!config->globus_gatekeeper_host) { *colon = '\0'; config->globus_gatekeeper_host = strdup(gatekeeper_contact); } gatekeeper_contact = colon + 1; colon = strchr(gatekeeper_contact, ':'); if (colon) { if (!config->globus_gatekeeper_port) { *colon = '\0'; config->globus_gatekeeper_port = strdup(gatekeeper_contact); } gatekeeper_contact = colon + 1; if (!config->globus_gatekeeper_subject) { config->globus_gatekeeper_subject = strdup(gatekeeper_contact); } } } } free(save); } rc = globus_module_activate(GLOBUS_GSI_GSSAPI_MODULE); if (rc != GLOBUS_SUCCESS) { goto out; } rc = globus_gram_job_manager_gsi_get_subject(&config->subject); if (rc != GLOBUS_SUCCESS) { goto out; } config->proxy_timeout = 10*60; out: return rc; } /* globus_gram_job_manager_config_init() */ /** * Free all memory allocated when the globus_gram_job_manager_config_init() was called. * * @param config * Configuration structure destroy. */ void globus_gram_job_manager_config_destroy( globus_gram_job_manager_config_t * config) { if (config->globus_location) { free(config->globus_location); } if (config->target_globus_location) { free(config->target_globus_location); } if (config->jobmanager_type) { free(config->jobmanager_type); } if (config->job_history_dir) { free(config->job_history_dir); } if (config->cache_location) { free(config->cache_location); } if (config->scratch_dir_base) { free(config->scratch_dir_base); } if (config->condor_arch) { free(config->condor_arch); } if (config->condor_os) { free(config->condor_os); } if (config->globus_gatekeeper_host) { free(config->globus_gatekeeper_host); } if (config->globus_gatekeeper_port) { free(config->globus_gatekeeper_port); } if (config->globus_gatekeeper_subject) { free(config->globus_gatekeeper_subject); } if (config->globus_host_manufacturer) { free(config->globus_host_manufacturer); } if (config->globus_host_cputype) { free(config->globus_host_cputype); } if (config->globus_host_osname) { free(config->globus_host_osname); } if (config->globus_host_osversion) { free(config->globus_host_osversion); } if (config->tcp_port_range) { free(config->tcp_port_range); } if (config->tcp_source_range) { free(config->tcp_source_range); } if (config->job_state_file_dir) { free(config->job_state_file_dir); } if (config->x509_cert_dir) { free(config->x509_cert_dir); } if (config->extra_envvars) { globus_list_destroy_all(config->extra_envvars, free); } if (config->seg_module) { free(config->seg_module); } if (config->auditing_dir) { free(config->auditing_dir); } if (config->globus_version) { free(config->globus_version); } if (config->usage_targets) { free(config->usage_targets); } /* if (config->log_pattern) { free(config->log_pattern); } */ if (config->subject) { free(config->subject); } if (config->home) { free(config->home); } if (config->logname) { free(config->logname); } if (config->hostname) { free(config->hostname); } if (config->short_hostname) { free(config->short_hostname); } if (config->service_tag) { free(config->service_tag); } if (config->job_dir_home) { free(config->job_dir_home); } } /* globus_gram_job_manager_config_destroy() */ #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * Split string into command-line arguments * * The @a command string is split into whitespace-delimited strings and adds * them to the @a args array. If the string begins with single quote or double * quote it will be combined with following strings until the closing quote is * found. At most *n-1 arguments can be parsed from the @a command string. *n * will be modified to contain the number of tokens in the @a args array when * this function returns. * * @param command * String to tokenize * @param args * Pointer to array of strings of at most *n elements. * @param n * In: maximum number of lements in @a args. Out: actual number of * elements in @a args. * * @retval 0 * Success * @retval -1 * Too many arguments */ static int globus_l_gram_tokenize(char * command, char ** args, int * n) { int i, x; char * cp; char * cp2; char ** arg; char * tmp_str = NULL; arg = args; i = *n - 1; for (cp = strtok(command, " \t\n"); cp != 0; ) { if ( cp[0] == '\'' && cp[strlen(cp) - 1] != '\'' ) { cp2 = strtok(NULL, "'\n"); tmp_str = malloc(sizeof(char *) * (strlen(cp) + strlen(cp2) + 2)); sprintf(tmp_str, "%s %s", &cp[1], cp2); } else if ( cp[0] == '"' && cp[strlen(cp) - 1] != '"' ) { cp2 = strtok(NULL, "\"\n"); tmp_str = malloc(sizeof(char *) * (strlen(cp) + strlen(cp2) + 2)); sprintf(tmp_str, "%s %s", &cp[1], cp2); } else { if (( cp[0] == '"' && cp[strlen(cp) - 1] == '"' ) || ( cp[0] == '\'' && cp[strlen(cp) - 1] == '\'' )) { tmp_str = malloc(sizeof(char *) * strlen(cp)); x = strlen(cp)-2; strncpy(tmp_str, &cp[1], x); tmp_str[x] = '\0'; } else { tmp_str = cp; } } *arg = tmp_str; i--; if (i == 0) return(-1); /* too many args */ arg++; cp = strtok(NULL, " \t\n"); } *arg = (char *) 0; *n = *n - i - 1; return(0); } /* globus_l_gram_tokenize() */ /** * @brief Parse log level specification * * @details * The globus_i_gram_parse_log_levels() function parses the log level string passed * in its first argument to the mask pointed to by the second argument. * The log level string contains one or more level names combined by the * "|" delimiter. The set of valid level names is: * - FATAL * - ERROR * - WARN * - INFO * - DEBUG * - TRACE * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED * Server misconfigured */ int globus_i_gram_parse_log_levels( const char * unparsed_string, int * log_levels, char ** error_string) { char * log_level_string = strdup(unparsed_string); char * level_string = NULL; char * last_string = NULL; int rc = GLOBUS_SUCCESS; if (log_level_string == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto error_exit; } if (error_string != NULL) { *error_string = NULL; } *log_levels = 0; for (level_string = strtok_r(log_level_string, "|", &last_string); level_string != NULL; level_string = strtok_r(NULL, "|", &last_string)) { if (strcmp(level_string, "FATAL") == 0) { *log_levels |= GLOBUS_GRAM_JOB_MANAGER_LOG_FATAL; } else if (strcmp(level_string, "ERROR") == 0) { *log_levels |= GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR; } else if (strcmp(level_string, "WARN") == 0) { *log_levels |= GLOBUS_GRAM_JOB_MANAGER_LOG_WARN; } else if (strcmp(level_string, "INFO") == 0) { *log_levels |= GLOBUS_GRAM_JOB_MANAGER_LOG_INFO; } else if (strcmp(level_string, "DEBUG") == 0) { *log_levels |= GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG; } else if (strcmp(level_string, "TRACE") == 0) { *log_levels |= GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE; } else { globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.config.info " "level=ERROR " "status=-1 " "msg=\"%s\" " "string=\"%s\" " "error_at=\"%s\" " "\n", "Error parsing log level string", unparsed_string, level_string); rc = GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED; if (error_string != NULL) { *error_string = globus_common_create_string( "Error parsing log level string '%s' at '%s'\n", unparsed_string, level_string); } break; } } free(log_level_string); error_exit: return rc; } /* globus_i_gram_parse_log_levels() */ static int globus_l_env_present( void * datum, void * arg) { char *datum_str = datum, *arg_str = arg; char *equal; size_t arglen; if (datum != arg && ((!datum) || (!arg))) { return 0; } arglen = strlen(arg_str); equal = strchr(datum_str, '='); if (equal && arglen > 0) { if ((equal - datum_str) == arglen) { return (strncmp(datum_str, arg_str, equal-datum_str) == 0); } } else { return (strcmp(datum_str, arg_str) == 0); } return 0; } /* globus_l_env_present() */ #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ globus_gram_job_manager-13.53/globus_gram_job_manager_query.c0000666000076400007640000020675412040264633021543 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_gram_job_manager_query.c Job Manager Query Handlers * * CVS Information: * * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_job_manager_query.c,v $ * $Date: 2012/10/19 14:54:19 $ * $Revision: 1.28.8.8 $ * $Author: bester $ */ #include "globus_gram_job_manager.h" #include "globus_callout.h" #include "globus_callout_constants.h" #include "globus_gsi_system_config.h" #include "globus_gsi_system_config_constants.h" #include "globus_gram_jobmanager_callout_error.h" #include "globus_rsl_assist.h" #include "version.h" #include #endif typedef struct globus_l_gram_renew_s { globus_gram_protocol_handle_t handle; globus_gram_jobmanager_request_t *request; } globus_l_gram_renew_t; static globus_bool_t globus_l_gram_job_manager_is_done( globus_gram_jobmanager_request_t * request); static int globus_l_gram_job_manager_cancel( globus_gram_jobmanager_request_t * request, globus_gram_protocol_handle_t handle, globus_bool_t * reply); static int globus_l_gram_job_manager_signal( globus_gram_jobmanager_request_t * request, const char * args, globus_gram_protocol_handle_t handle, globus_bool_t * reply); static int globus_l_gram_job_manager_register( globus_gram_jobmanager_request_t * request, const char * args); static int globus_l_gram_job_manager_unregister( globus_gram_jobmanager_request_t * request, const char * url, globus_gram_protocol_handle_t handle); static int globus_l_gram_job_manager_renew( globus_gram_jobmanager_request_t * request, globus_gram_protocol_handle_t handle, globus_bool_t * reply); static void globus_l_gram_job_manager_query_reply( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, globus_gram_protocol_handle_t handle, int status, int query_failure_code, int job_failure_code, int exit_code); static globus_bool_t globus_l_gram_job_manager_query_valid( globus_gram_jobmanager_request_t * request); static void globus_l_delegation_callback( void * arg, globus_gram_protocol_handle_t handle, gss_cred_id_t credential, int error_code); static int globus_l_gram_job_manager_query_stop_manager( globus_gram_jobmanager_request_t * request); static int globus_l_gram_create_extensions( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, int status, int exit_code, globus_hashtable_t * extensions); static const char * globus_l_gram_get_job_contact_from_uri( const char * uri); static int globus_l_gram_stdio_update_signal( globus_gram_jobmanager_request_t * request, char * update_rsl_spec); void globus_gram_job_manager_query_callback( void * arg, globus_gram_protocol_handle_t handle, globus_byte_t * buf, globus_size_t nbytes, int errorcode, char * uri) { globus_gram_job_manager_t * manager = arg; globus_gram_jobmanager_request_t * request = NULL; char * query = GLOBUS_NULL; char * rest; int rc = 0; globus_gram_protocol_job_state_t status = 0; int exit_code = 0; int job_failure_code = 0; globus_bool_t reply = GLOBUS_TRUE; const char * contact; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.query.start " "level=DEBUG " "uri=\"%s\" " "\n", uri); if (manager->config->log_levels & GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE) { char * querystring; querystring = globus_gram_prepare_log_string((char *) buf); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.query.info " "level=TRACE " "uri=\"%s\" " "message=\"%s\" " "\n", uri, querystring ? querystring : ""); if (querystring) { free(querystring); } } if (uri == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.query.end " "level=ERROR " "status=%d " "uri=%s " "msg=\"%s\" " "reason=\"%s\" " "\n", -rc, "NULL", "Invalid URI for query", globus_gram_protocol_error_string(rc)); goto invalid_query; } contact = globus_l_gram_get_job_contact_from_uri(uri); if (contact == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.query.end " "level=ERROR " "status=%d " "uri=%s " "msg=\"%s\" " "reason=\"%s\" " "\n", -rc, uri, "Invalid URI for query", globus_gram_protocol_error_string(rc)); goto invalid_query; } rc = globus_gram_protocol_unpack_status_request(buf, nbytes, &query); if (rc != GLOBUS_SUCCESS) { goto unpack_failed; } rc = globus_gram_job_manager_authz_query( manager, handle, contact, query); if (rc != GLOBUS_SUCCESS) { goto authz_failed; } rest = strchr(query,' '); if (rest) { *rest++ = '\0'; } /* When status query occurs, skip reloading the job request. Use the cached * value in the ref. */ if (strcmp(query, "status") == 0) { rc = globus_gram_job_manager_get_status( manager, contact, &status, &job_failure_code, &exit_code); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.query.end " "level=ERROR " "status=%d " "uri=%s " "msg=\"%s\" " "reason=\"%s\" " "\n", -rc, contact, "Unable to find job for URI", globus_gram_protocol_error_string(rc)); } goto status_done; } rc = globus_gram_job_manager_add_reference( manager, contact, "query", &request); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.query.end " "level=ERROR " "status=%d " "uri=%s " "msg=\"%s\" " "reason=\"%s\" " "\n", -rc, contact, "Unable to find job for URI", globus_gram_protocol_error_string(rc)); goto invalid_query; } GlobusGramJobManagerRequestLock(request); job_failure_code = request->failure_code; status = request->status; if (strcmp(query,"cancel")==0) { rc = globus_l_gram_job_manager_cancel(request, handle, &reply); } else if (strcmp(query,"signal")==0) { rc = globus_l_gram_job_manager_signal(request, rest, handle, &reply); request->job_stats.signal_count++; } else if (strcmp(query,"register")==0) { rc = globus_l_gram_job_manager_register(request, rest); request->job_stats.register_count++; } else if (strcmp(query,"unregister")==0) { rc = globus_l_gram_job_manager_unregister(request, rest, handle); request->job_stats.unregister_count++; } else if (strcmp(query,"renew")==0) { rc = globus_l_gram_job_manager_renew(request, handle, &reply); request->job_stats.refresh_count++; } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_JOB_QUERY; } unpack_failed: authz_failed: if (rc != GLOBUS_SUCCESS) { status = GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED; job_failure_code = 0; } globus_gram_job_manager_log( manager, rc ? GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR : GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.query.end " "level=%s " "%s%s%s" "uri=\"%s\" " "msg=\"%s\" " "status=%d " "%s%s " "\n", rc ? "ERROR" : "DEBUG", request ? "gramid=" : "", request ? request->job_contact_path : "", request ? " " : "", uri, rc ? "Error processing query" : "Done processing query" , rc ? -rc : 0, rc ? "reason=\"" : "", rc ? globus_gram_protocol_error_string(rc) : "", rc ? "\"" : ""); status_done: invalid_query: if(reply) { globus_l_gram_job_manager_query_reply( manager, request, handle, status, rc, job_failure_code, exit_code); } if (request) { GlobusGramJobManagerRequestUnlock(request); rc = globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "query"); } if(query) { free(query); } return; } /* globus_gram_job_manager_query_callback() */ void globus_gram_job_manager_query_reply( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_query_t * query) { if(query->type == GLOBUS_GRAM_JOB_MANAGER_CANCEL || query->signal == GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_CANCEL) { if(query->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_USER_CANCELLED) { query->failure_code = GLOBUS_SUCCESS; } } globus_l_gram_job_manager_query_reply(request->manager, request, query->handle, request->status, query->failure_code, query->failure_code ? 0 : request->failure_code, request->exit_code); if(query->signal_arg) { free(query->signal_arg); } free(query); } /* globus_gram_job_manager_query_reply() */ static void globus_l_gram_job_manager_query_reply( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, globus_gram_protocol_handle_t handle, int status, int query_failure_code, int job_failure_code, int exit_code) { int rc; int code; globus_size_t replysize; globus_byte_t * reply = GLOBUS_NULL; globus_hashtable_t extensions = NULL; rc = query_failure_code; if (rc != GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED) { globus_l_gram_create_extensions(manager, request, status, exit_code, &extensions); if (extensions != NULL) { rc = globus_gram_protocol_pack_status_reply_with_extensions( status, rc, job_failure_code, &extensions, &reply, &replysize ); } else { rc = globus_gram_protocol_pack_status_reply( status, rc, job_failure_code, &reply, &replysize ); } } if (rc == GLOBUS_SUCCESS) { code = 200; } else { code = 400; free(reply); reply = GLOBUS_NULL; replysize = 0; } if (request == NULL || request->job_log_level & GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE) { char * replystring; replystring = globus_gram_prepare_log_string((char *) reply); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.query.info " "%s%s%s" "level=TRACE " "reply=\"%s\" " "\n", request ? "gramid=" : "", request ? request->job_contact_path : "", request ? " " : "", replystring ? replystring : ""); if (replystring) { free(replystring); } } globus_gram_protocol_reply(handle, code, reply, replysize); if(reply) { free(reply); } if (extensions) { globus_gram_protocol_hash_destroy(&extensions); } } /* globus_l_gram_job_manager_query_reply() */ static int globus_l_gram_job_manager_cancel( globus_gram_jobmanager_request_t * request, globus_gram_protocol_handle_t handle, globus_bool_t * reply) { int rc = GLOBUS_SUCCESS; globus_result_t result; globus_gram_job_manager_query_t * query; globus_reltime_t delay; switch(request->jobmanager_state) { case GLOBUS_GRAM_JOB_MANAGER_STATE_START: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_USER_CANCELLED; return GLOBUS_SUCCESS; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_USER_CANCELLED; request->unsent_status_change = GLOBUS_TRUE; if(request->poll_timer != GLOBUS_HANDLE_TABLE_NO_HANDLE) { GlobusTimeReltimeSet(delay, 0, 0); result = globus_callback_adjust_oneshot( request->poll_timer, &delay); } return GLOBUS_SUCCESS; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_USER_CANCELLED; request->unsent_status_change = GLOBUS_TRUE; return GLOBUS_SUCCESS; case GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2: query = calloc(1, sizeof(globus_gram_job_manager_query_t)); query->type = GLOBUS_GRAM_JOB_MANAGER_CANCEL; query->handle = handle; query->signal = 0; query->signal_arg = NULL; globus_fifo_enqueue(&request->pending_queries, query); *reply = GLOBUS_FALSE; if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1; if(request->poll_timer != GLOBUS_HANDLE_TABLE_NO_HANDLE) { GlobusTimeReltimeSet(delay, 0, 0); result = globus_callback_adjust_oneshot( request->poll_timer, &delay); } else { globus_gram_job_manager_state_machine_register( request->manager, request, NULL); } } return GLOBUS_SUCCESS; default: rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; *reply = GLOBUS_TRUE; return rc; } } /* globus_l_gram_job_manager_cancel() */ static int globus_l_gram_job_manager_register( globus_gram_jobmanager_request_t * request, const char * args) { int rc = GLOBUS_SUCCESS; char * url = NULL; int mask; url = malloc(strlen(args)); if (globus_l_gram_job_manager_is_done(request)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; } else if(sscanf(args, "%d %s", &mask, url) != 2) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; } else { rc = globus_gram_job_manager_contact_add(request, url, mask); } free(url); return rc; } /* globus_l_gram_job_manager_register() */ static int globus_l_gram_job_manager_unregister( globus_gram_jobmanager_request_t * request, const char * url, globus_gram_protocol_handle_t handle) { int rc; if (globus_l_gram_job_manager_is_done(request)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; } else if (!url || strlen(url) == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; } else { rc = globus_gram_job_manager_contact_remove(request, url); /* Incase we unregister the last callback and we're waiting * for TWO_PHASE_END commit, fake the COMMIT_END signal */ if (!request->client_contacts && request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END) { globus_bool_t reply=GLOBUS_TRUE; char buf[32]; snprintf(buf,sizeof(buf),"%d",GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_COMMIT_END); globus_l_gram_job_manager_signal(request,buf,handle,&reply); globus_assert(reply == GLOBUS_TRUE); } } return rc; } /* globus_l_gram_job_manager_unregister() */ static int globus_l_gram_job_manager_renew( globus_gram_jobmanager_request_t * request, globus_gram_protocol_handle_t handle, globus_bool_t * reply) { int rc = 0; globus_l_gram_renew_t * renew; char *msg = "Success"; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.proxyrenew.start " "level=DEBUG " "gramid=%s " "\n", request->job_contact_path); renew = malloc(sizeof(globus_l_gram_renew_t)); if(renew == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; msg = "Malloc failed"; goto renew_malloc_failed; } rc = globus_gram_job_manager_add_reference( request->manager, request->job_contact_path, "renew", &renew->request); renew->handle = handle; if (rc != GLOBUS_SUCCESS) { msg = "Add reference failed"; goto add_reference_failed; } rc = globus_gram_protocol_accept_delegation( renew->handle, GSS_C_NO_OID_SET, GSS_C_NO_BUFFER_SET, GSS_C_GLOBUS_LIMITED_DELEG_PROXY_FLAG | GSS_C_GLOBUS_SSL_COMPATIBLE, 0, globus_l_delegation_callback, renew); if (rc == GLOBUS_SUCCESS) { *reply = GLOBUS_FALSE; } else { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.proxyrenew.end " "level=ERROR " "gramid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, -rc, msg, globus_gram_protocol_error_string(rc)); globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "renew"); add_reference_failed: free(renew); renew_malloc_failed: *reply = GLOBUS_TRUE; } return rc; } /* globus_l_gram_job_manager_renew() */ static int globus_l_gram_job_manager_signal( globus_gram_jobmanager_request_t * request, const char * args, globus_gram_protocol_handle_t handle, globus_bool_t * reply) { int rc = GLOBUS_SUCCESS; int signal; char * after_signal; globus_off_t out_size = -1; globus_off_t err_size = -1; globus_reltime_t delay; globus_gram_job_manager_query_t * query; globus_result_t result; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.signal.start " "level=DEBUG " "gramid=%s " "signal=\"%s\" " "msg=\"%s\" " "jmstate=%s " "\n", request->job_contact_path, args, "GRAM signal", globus_i_gram_job_manager_state_strings[request->jobmanager_state]); *reply = GLOBUS_TRUE; if(args == NULL || sscanf(args, "%d", &signal) != 1) { return GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; } after_signal = strchr(args,' '); if (after_signal) *after_signal++ = '\0'; switch(signal) { case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_STDIO_UPDATE: if(!after_signal || strlen(after_signal) == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Missing signal argument", -rc, globus_gram_protocol_error_string(rc)); break; } if(!globus_l_gram_job_manager_query_valid(request)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Invalid query", -rc, globus_gram_protocol_error_string(rc)); break; } rc = globus_l_gram_stdio_update_signal(request, after_signal); break; case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_CANCEL: case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_SUSPEND: case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_RESUME: case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_PRIORITY: if(!after_signal || strlen(after_signal) == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Missing signal argument", -rc, globus_gram_protocol_error_string(rc)); break; } if(!globus_l_gram_job_manager_query_valid(request)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Invalid query", -rc, globus_gram_protocol_error_string(rc)); break; } query = calloc(1, sizeof(globus_gram_job_manager_query_t)); query->type = GLOBUS_GRAM_JOB_MANAGER_SIGNAL; query->handle = handle; query->signal = signal; if(after_signal) { query->signal_arg = strdup(after_signal); if (query->signal_arg == NULL) { free(query); rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "malloc failed", -rc, globus_gram_protocol_error_string(rc)); break; } } globus_fifo_enqueue(&request->pending_queries, query); *reply = GLOBUS_FALSE; if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1; } else if (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1; } else { break; } if(request->poll_timer != GLOBUS_HANDLE_TABLE_NO_HANDLE) { GlobusTimeReltimeSet(delay, 0, 0); result = globus_callback_adjust_oneshot( request->poll_timer, &delay); } else { globus_gram_job_manager_state_machine_register( request->manager, request, NULL); } break; case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_COMMIT_REQUEST: if(request->two_phase_commit == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_COMMIT; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Two-phase commit signal when job doesn't have two_phase timeout", -rc, globus_gram_protocol_error_string(rc)); break; } else if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE || request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_START) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED; } else if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1 || request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED; } else if (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.signal.info " "level=DEBUG " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Unneccessary two-phase commit signal", -rc, globus_gram_protocol_error_string(rc)); break; } else { /* GRAM-103: Ease two phase end commit timeout * In some cases, Condor-G decides to restart a job where * the job manager is already running. When this happens, * the job can be in pretty much any job manager state. We'll * ignore any error here, and assume things are working just * fine in the state machine. */ globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.signal.info " "level=DEBUG " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Unneccessary two-phase commit signal", -rc, globus_gram_protocol_error_string(rc)); break; } if(request->poll_timer != GLOBUS_HANDLE_TABLE_NO_HANDLE) { GlobusTimeReltimeSet(delay, 0, 0); result = globus_callback_adjust_oneshot( request->poll_timer, &delay); } else { globus_gram_job_manager_state_machine_register( request->manager, request, NULL); } break; case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_COMMIT_END: if(request->two_phase_commit == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_COMMIT; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Two-phase commit signal when job doesn't have two_phase timeout", -rc, globus_gram_protocol_error_string(rc)); break; } else if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END || request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED; } else if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED; } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Two-phase commit signal in invalid jobmanager state", -rc, globus_gram_protocol_error_string(rc)); break; } if(request->poll_timer != GLOBUS_HANDLE_TABLE_NO_HANDLE) { GlobusTimeReltimeSet(delay, 0, 0); result = globus_callback_adjust_oneshot( request->poll_timer, &delay); } else { globus_gram_job_manager_state_machine_register( request->manager, request, NULL); } break; case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_COMMIT_EXTEND: if ((!after_signal) || (strlen(after_signal) == 0)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Missing argument to commit extend signal", -rc, globus_gram_protocol_error_string(rc)); } else if(request->two_phase_commit == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_COMMIT; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Two-phase commit extend signal when job doesn't have two_phase timeout", -rc, globus_gram_protocol_error_string(rc)); } else if((request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE) || (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END) || (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE) || (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1) || (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2)) { request->commit_extend += atoi(after_signal); } break; case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_STDIO_SIZE: if (after_signal && sscanf(after_signal, "%"GLOBUS_OFF_T_FORMAT" %"GLOBUS_OFF_T_FORMAT, &out_size, &err_size) > 0) { struct stat st; globus_off_t local_size_stdout = 0; globus_off_t local_size_stderr = 0; const char * local_stdout; const char * local_stderr; rc = globus_gram_job_manager_rsl_attribute_get_string_value( request->rsl, GLOBUS_GRAM_PROTOCOL_STDOUT_PARAM, &local_stdout); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_JOB_QUERY; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Stdio size signal when stdout not in RSL", -rc, globus_gram_protocol_error_string(rc)); break; } if (local_stdout == NULL || strstr(local_stdout, "://")) { local_stdout = request->cached_stdout; } rc = globus_gram_job_manager_rsl_attribute_get_string_value( request->rsl, GLOBUS_GRAM_PROTOCOL_STDERR_PARAM, &local_stderr); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_JOB_QUERY; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Stdio size signal when stderr not in RSL", -rc, globus_gram_protocol_error_string(rc)); break; } if (local_stderr == NULL || strstr(local_stderr, "://")) { local_stderr = request->cached_stderr; } if (!globus_list_empty(request->stage_stream_todo)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_STILL_STREAMING; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Stdio size signal when output still streaming", -rc, globus_gram_protocol_error_string(rc)); break; } if (strcmp(local_stdout, request->cached_stdout) == 0) { /* fakestreaming is likely to happen */ rc = stat(local_stdout, &st); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_JOB_QUERY; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Unable get stdout file size", -rc, errno, strerror(errno)); break; } local_size_stdout = st.st_size; } if (strcmp(local_stderr, request->cached_stderr) == 0) { /* fakestreaming is likely to happen */ rc = stat(local_stderr, &st); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_JOB_QUERY; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Unable get stderr file size", -rc, errno, strerror(errno)); break; } local_size_stderr = st.st_size; } if (out_size >= 0 && out_size != local_size_stdout) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_STDIO_SIZE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "stdout_signal_size=%ld " "stdout_actual_size=%ld " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Stdout size mismatch", -rc, (long int) out_size, (long int) local_size_stdout, globus_gram_protocol_error_string(rc)); } else if (err_size >= 0 && err_size != local_size_stderr) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_STDIO_SIZE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "stderr_signal_size=%ld " "stderr_actual_size=%ld " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Stderr size mismatch", -rc, (long int) err_size, (long int) local_size_stderr, globus_gram_protocol_error_string(rc)); } else { rc = GLOBUS_SUCCESS; } } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Missing argument to stdio_size signal", -rc, globus_gram_protocol_error_string(rc)); } break; case GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_STOP_MANAGER: rc = globus_l_gram_job_manager_query_stop_manager(request); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Error stopping manager", -rc, globus_gram_protocol_error_string(rc)); } break; default: rc = GLOBUS_GRAM_PROTOCOL_ERROR_UNKNOWN_SIGNAL_TYPE; if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.signal.end " "level=WARN " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Unknown signal", -rc, globus_gram_protocol_error_string(rc)); } } if (rc == GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.signal.end " "level=DEBUG " "gramid=%s " "signal=\"%s\" " "jmstate=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, args, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], "Signal processed or queued", 0, globus_gram_protocol_error_string(rc)); } return rc; } /* globus_l_gram_job_manager_signal() */ /** * Handle a STOP_MANAGER signal. * * This signal causes the job manager to stop monitoring the job and exit, * without killing the job. We want this stop to happen pretty quickly, so * we'll unregister any poll_timer events (either the intra-poll delay or * the two_phase_commit delay) and reregister as a oneshot. */ static int globus_l_gram_job_manager_query_stop_manager( globus_gram_jobmanager_request_t * request) { int rc = GLOBUS_SUCCESS; globus_gram_jobmanager_state_t state; globus_reltime_t delay; state = request->jobmanager_state; if(state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2) { if(request->poll_timer != GLOBUS_HANDLE_TABLE_NO_HANDLE) { GlobusTimeReltimeSet(delay, 0, 0); globus_callback_adjust_oneshot( request->poll_timer, &delay); } else { globus_gram_job_manager_state_machine_register( request->manager, request, NULL); } } switch(state) { case GLOBUS_GRAM_JOB_MANAGER_STATE_STOP: request->unsent_status_change = GLOBUS_TRUE; request->stop_reason = GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_START: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN: case GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2: case GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED: request->unsent_status_change = GLOBUS_TRUE; request->stop_reason = GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED; request->restart_state = request->jobmanager_state; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_FILE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_SCRATCH_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_CACHE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_DONE: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_FILE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CACHE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT: rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; break; } return rc; } /* globus_l_gram_job_manager_query_stop_manager() */ static globus_bool_t globus_l_gram_job_manager_is_done( globus_gram_jobmanager_request_t * request) { if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_DONE || request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE) { return GLOBUS_TRUE; } return GLOBUS_FALSE; } /* globus_l_gram_job_manager_is_done() */ static globus_bool_t globus_l_gram_job_manager_query_valid( globus_gram_jobmanager_request_t * request) { switch(request->jobmanager_state) { case GLOBUS_GRAM_JOB_MANAGER_STATE_START: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2: case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN: case GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2: return GLOBUS_TRUE; case GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FILE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_CACHE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_SCRATCH_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_DONE: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_FILE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CACHE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE: case GLOBUS_GRAM_JOB_MANAGER_STATE_STOP: return GLOBUS_FALSE; } return GLOBUS_FALSE; } /* globus_l_gram_job_manager_query_valid() */ static void globus_l_delegation_callback( void * arg, globus_gram_protocol_handle_t handle, gss_cred_id_t credential, int error_code) { globus_l_gram_renew_t * renew; globus_gram_jobmanager_request_t * request; globus_gram_job_manager_t * manager; int renew_code, failure_code, exit_code; renew = arg; request = renew->request; manager = request->manager; GlobusGramJobManagerRequestLock(request); GlobusGramJobManagerLock(manager); (void) globus_gram_job_manager_gsi_update_credential( manager, request, credential); GlobusGramJobManagerUnlock(manager); renew_code = (credential == GSS_C_NO_CREDENTIAL) ? GLOBUS_GRAM_PROTOCOL_ERROR_DELEGATION_FAILED : 0; failure_code = (credential == GSS_C_NO_CREDENTIAL) ? 0 : request->failure_code, exit_code = request->exit_code; globus_l_gram_job_manager_query_reply( manager, request, renew->handle, request->status, renew_code, failure_code, exit_code); GlobusGramJobManagerRequestUnlock(request); globus_gram_job_manager_request_log( request, (renew_code == GLOBUS_SUCCESS) ? GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG : GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.proxyrenew.end " "level=%s " "gramid=%s " "status=%d " "reason=\"%s\" " "\n", (renew_code == GLOBUS_SUCCESS) ? "DEBUG" : "ERROR", request->job_contact_path, -renew_code, globus_gram_protocol_error_string(renew_code)); (void) globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "renew"); free(renew); } /* globus_l_delegation_callback() */ static int globus_l_gram_create_extensions( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, int status, int exit_code, globus_hashtable_t * extensions) { globus_gram_protocol_extension_t * entry = NULL; int rc; *extensions = NULL; rc = globus_hashtable_init( extensions, 3, globus_hashtable_string_hash, globus_hashtable_string_keyeq); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto hashtable_init_failed; } if ((manager->config->seg_module != NULL || strcmp(manager->config->jobmanager_type, "condor") == 0) && status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE) { entry = globus_gram_protocol_create_extension( "exit-code", "%d", exit_code); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_create_failed; } rc = globus_hashtable_insert( extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_insert_failed; } } entry = globus_gram_protocol_create_extension( "toolkit-version", "%s", manager->config->globus_version); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_create_failed; } rc = globus_hashtable_insert( extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_insert_failed; } entry = globus_gram_protocol_create_extension( "version", "%d.%d (%d-%d)", local_version.major, local_version.minor, local_version.timestamp, local_version.branch_id); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_create_failed; } rc = globus_hashtable_insert( extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_insert_failed; } entry = NULL; if (entry) { extension_insert_failed: free(entry->value); free(entry->attribute); free(entry); } extension_create_failed: if (rc != GLOBUS_SUCCESS) { globus_gram_protocol_hash_destroy(extensions); *extensions = NULL; } hashtable_init_failed: return rc; } /* globus_l_gram_create_extensions() */ static const char * globus_l_gram_get_job_contact_from_uri( const char * uri) { int n; int rc; if (uri[0] == '/') { return uri; } else { rc = sscanf(uri, "https://%*[^:]%*[:0-9]%n", &n); if (rc < 0) { return NULL; } return uri+n; } } /* globus_l_gram_get_job_contact_from_uri() */ static int globus_l_gram_stdio_update_signal( globus_gram_jobmanager_request_t * request, char * update_rsl_spec) { globus_rsl_t * rsl; globus_rsl_t * original_rsl; globus_rsl_t * position; globus_rsl_t * new_unevaluated_rsl; char * new_rsl_spec; int rc = GLOBUS_SUCCESS; rsl = globus_rsl_parse(update_rsl_spec); if(!rsl) { char * tmp_str; tmp_str = globus_gram_prepare_log_string(update_rsl_spec); rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.state_machine.info " "level=ERROR " "gramid=%s " "query_type=%s " "rsl=\"%s\" " "msg=%s " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, "stdio_update", tmp_str ? tmp_str : "", "Error parsing query rsl", -rc, globus_gram_protocol_error_string(rc)); if (tmp_str) { free(tmp_str); } goto error_out; } rc = globus_rsl_assist_attributes_canonicalize(rsl); if(rc != GLOBUS_SUCCESS) { char * tmp_str; tmp_str = globus_gram_prepare_log_string(update_rsl_spec); rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.state_machine.end" "level=ERROR " "query_type=%s " "gramid=%s " "rsl=\"%s\" " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", "stdio_update", request->job_contact_path, tmp_str ? tmp_str : "", "Error canonicalizing RSL", -rc, globus_gram_protocol_error_string(rc)); if (tmp_str) { free(tmp_str); } goto free_rsl_out; } rc = globus_gram_job_manager_validate_rsl( request, rsl, GLOBUS_GRAM_VALIDATE_STDIO_UPDATE); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto free_rsl_out; } /* Remove unsupported stdout and stderr position attributes */ position = globus_gram_job_manager_rsl_extract_relation( rsl, GLOBUS_GRAM_PROTOCOL_STDOUT_POSITION_PARAM); if (position != NULL) { globus_rsl_free_recursive(position); } position = globus_gram_job_manager_rsl_extract_relation( rsl, GLOBUS_GRAM_PROTOCOL_STDERR_POSITION_PARAM); if (position != NULL) { globus_rsl_free_recursive(position); } /* Replace the string RSL representation for this job with the * merge of the original and this update. The new RSL unparsed * into a string and stored in request->rsl_spec */ original_rsl = globus_rsl_parse(request->rsl_spec); if (original_rsl == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto free_rsl_out; } new_unevaluated_rsl = globus_gram_job_manager_rsl_merge( original_rsl, rsl); if (new_unevaluated_rsl == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto free_original_rsl_out; } new_rsl_spec = globus_rsl_unparse(new_unevaluated_rsl); if (new_rsl_spec == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto free_new_unevaluated_rsl_out; } free(request->rsl_spec); request->rsl_spec = new_rsl_spec; new_rsl_spec = NULL; rc = globus_rsl_eval(rsl, &request->symbol_table); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED; goto free_new_unevaluated_rsl_out; } rc = globus_i_gram_request_stdio_update( request, rsl); free_new_unevaluated_rsl_out: globus_rsl_free_recursive(new_unevaluated_rsl); free_original_rsl_out: globus_rsl_free_recursive(original_rsl); free_rsl_out: globus_rsl_free_recursive(rsl); error_out: return rc; } /* globus_l_gram_stdio_update_signal() */ globus_gram_job_manager-13.53/globus_gram_job_manager_validate.c0000666000076400007640000011060111734127723022157 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_gram_job_manager_validate.c * * RSL Validation Support for the GRAM Job Manager. * * CVS Information: * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_job_manager_validate.c,v $ * $Date: 2012/03/26 18:05:07 $ * $Revision: 1.18.8.3 $ * $Author: bester $ */ #define GLOBUS_GRAM_VALIDATE_JOB_SUBMIT_STRING \ "GLOBUS_GRAM_JOB_SUBMIT" #define GLOBUS_GRAM_VALIDATE_JOB_MANAGER_RESTART_STRING \ "GLOBUS_GRAM_JOB_MANAGER_RESTART" #define GLOBUS_GRAM_VALIDATE_STDIO_UPDATE_STRING \ "GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE" #include "globus_common.h" #include "globus_gram_job_manager.h" #include "globus_rsl.h" #include "globus_rvf_parser.h" #include #include #include static char * validation_filename; static char * site_validation_filename; static char * lrm_validation_filename; static char * lrm_validation_filename_pattern; static char * site_lrm_validation_filename; static char * site_lrm_validation_filename_pattern; static int globus_l_gram_job_manager_attribute_match( void * datum, void * args); static int globus_gram_job_manager_validation_init( globus_gram_job_manager_t * manager); static globus_bool_t globus_l_gram_job_manager_validation_string_match( const char * str1, const char * str2); static int globus_l_gram_job_manager_check_rsl_attributes( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, globus_gram_job_manager_validation_when_t when); static globus_bool_t globus_l_gram_job_manager_attribute_exists( globus_list_t * attributes, char * attribute_name); static int globus_l_gram_job_manager_insert_default_rsl( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, globus_gram_job_manager_validation_when_t when); static void globus_l_gram_job_manager_validation_record_free( globus_rvf_record_t * record); static int globus_l_gram_job_manager_validation_rsl_error( const char * attribute); static int globus_l_gram_job_manager_validation_value_error( globus_gram_jobmanager_request_t * request, const char * attribute, const char * value, const char * enumerated_values); static int globus_l_gram_job_manager_missing_value_error( const char * attribute); extern int globus_gram_job_manager_validation_update( globus_gram_job_manager_t * manager) { time_t validation_timestamp = time(NULL); int rc = GLOBUS_SUCCESS; globus_result_t result; struct stat st; globus_bool_t do_update = GLOBUS_FALSE; if (validation_timestamp <= manager->validation_record_timestamp) { goto skip_update_check; } if (validation_filename == NULL) { result = globus_eval_path( "${datadir}/globus/globus_gram_job_manager/globus-gram-job-manager.rvf", &validation_filename); if (result != GLOBUS_SUCCESS || validation_filename == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto validation_filename_failed; } } if (site_validation_filename == NULL) { result = globus_eval_path( "${sysconfdir}/globus/gram/job-manager.rvf", &site_validation_filename); if (result != GLOBUS_SUCCESS || site_validation_filename == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto site_validation_filename_failed; } } if (lrm_validation_filename_pattern == NULL) { lrm_validation_filename_pattern = globus_common_create_string( "${datadir}/globus/globus_gram_job_manager/%s.rvf", manager->config->jobmanager_type); if(lrm_validation_filename_pattern == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto lrm_validation_filename_pattern_failed; } } if (lrm_validation_filename == NULL) { result = globus_eval_path( lrm_validation_filename_pattern, &lrm_validation_filename); if (result != GLOBUS_SUCCESS || lrm_validation_filename == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto lrm_validation_filename_failed; } } if (site_lrm_validation_filename_pattern == NULL) { site_lrm_validation_filename_pattern = globus_common_create_string( "${sysconfdir}/globus/gram/%s.rvf", manager->config->jobmanager_type); if(site_lrm_validation_filename_pattern == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto site_lrm_validation_filename_pattern_failed; } } if (site_lrm_validation_filename == NULL) { result = globus_eval_path(site_lrm_validation_filename_pattern, &site_lrm_validation_filename); if (result != GLOBUS_SUCCESS || site_lrm_validation_filename == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto site_lrm_validation_filename_failed; } } rc = stat(validation_filename, &st); if ((rc == GLOBUS_SUCCESS && ((!manager->validation_file_exists[0]) || st.st_mtime > manager->validation_record_timestamp)) || (rc != GLOBUS_SUCCESS && errno == ENOENT && manager->validation_file_exists[0])) { do_update = GLOBUS_TRUE; } if (!do_update) { rc = stat(lrm_validation_filename, &st); if ((rc == GLOBUS_SUCCESS && ((!manager->validation_file_exists[1]) || st.st_mtime > manager->validation_record_timestamp)) || (rc != GLOBUS_SUCCESS && errno == ENOENT && manager->validation_file_exists[1])) { do_update = GLOBUS_TRUE; } } if (!do_update) { rc = stat(site_validation_filename, &st); if ((rc == GLOBUS_SUCCESS && ((!manager->validation_file_exists[2]) || st.st_mtime > manager->validation_record_timestamp)) || (rc != GLOBUS_SUCCESS && errno == ENOENT && manager->validation_file_exists[2])) { do_update = GLOBUS_TRUE; } } if (!do_update) { rc = stat(site_lrm_validation_filename, &st); if ((rc == GLOBUS_SUCCESS && ((!manager->validation_file_exists[3]) || st.st_mtime > manager->validation_record_timestamp)) || (rc != GLOBUS_SUCCESS && errno == ENOENT && manager->validation_file_exists[3])) { do_update = GLOBUS_TRUE; } } if (do_update) { /* Free old validation entries */ globus_gram_job_manager_validation_destroy( manager->validation_records); manager->validation_records = NULL; rc = globus_gram_job_manager_validation_init(manager); } else { rc = GLOBUS_SUCCESS; } site_lrm_validation_filename_failed: site_lrm_validation_filename_pattern_failed: lrm_validation_filename_failed: lrm_validation_filename_pattern_failed: site_validation_filename_failed: validation_filename_failed: skip_update_check: return rc; } /* globus_gram_job_manager_validation_update() */ /** * @param manager * A job request. The validation field of this job request will be * updated with a list of validation records constructed from the * rsl validation files associated with the job manager. */ static int globus_gram_job_manager_validation_init( globus_gram_job_manager_t * manager) { time_t validation_timestamp = time(NULL); int rc = GLOBUS_SUCCESS; globus_list_t * l; manager->validation_records = NULL; manager->validation_file_exists[0] = GLOBUS_FALSE; manager->validation_file_exists[1] = GLOBUS_FALSE; manager->validation_file_exists[2] = GLOBUS_FALSE; manager->validation_file_exists[3] = GLOBUS_FALSE; /* Read in validation files. Do the generic job manager one first, * as the scheduler-specific one overrides it. */ rc = globus_rvf_parse_file( validation_filename, &manager->validation_records, &manager->gt3_failure_message); if(rc != GLOBUS_SUCCESS) { goto read_validation_failed; } manager->validation_file_exists[0] = GLOBUS_TRUE; if(access(lrm_validation_filename, R_OK) == 0) { rc = globus_rvf_parse_file( lrm_validation_filename, &manager->validation_records, &manager->gt3_failure_message); if (rc != GLOBUS_SUCCESS) { goto read_lrm_validation_filename_failed; } manager->validation_file_exists[1] = GLOBUS_TRUE; } if (access(site_validation_filename, R_OK) == 0) { rc = globus_rvf_parse_file( site_validation_filename, &manager->validation_records, &manager->gt3_failure_message); if (rc != GLOBUS_SUCCESS) { goto read_site_validation_filename_failed; } manager->validation_file_exists[2] = GLOBUS_TRUE; } if (access(site_lrm_validation_filename, R_OK) == 0) { rc = globus_rvf_parse_file( site_lrm_validation_filename, &manager->validation_records, &manager->gt3_failure_message); if (rc != GLOBUS_SUCCESS) { goto read_site_lrm_validation_filename_failed; } manager->validation_file_exists[3] = GLOBUS_TRUE; } for(l = manager->validation_records; l != NULL; l = globus_list_rest(l)) { globus_rvf_record_t * record = globus_list_first(l); if (record->valid_when == -1) { record->valid_when = 0; } if (record->default_when == -1) { record->default_when = 0; } if (record->required_when == -1) { record->required_when = 0; } if (record->publishable == -1) { record->publishable = 1; } } manager->validation_record_timestamp = validation_timestamp; read_site_lrm_validation_filename_failed: read_site_validation_filename_failed: read_lrm_validation_filename_failed: if(rc != GLOBUS_SUCCESS) { globus_gram_job_manager_validation_destroy( manager->validation_records); manager->validation_records = NULL; } read_validation_failed: return rc; } /* globus_gram_job_manager_validation_init() */ int globus_gram_job_manager_validation_destroy( globus_list_t * validation_records) { globus_list_t * tmp; globus_rvf_record_t * record; tmp = validation_records; while (!globus_list_empty(tmp)) { record = globus_list_first(tmp); tmp = globus_list_rest(tmp); globus_l_gram_job_manager_validation_record_free(record); } globus_list_free(validation_records); return GLOBUS_SUCCESS; } /** * Validate a request's RSL. * @ingroup globus_gram_job_manager_rsl_validation * * Validate the RSL tree defining a job request, using validation files. * An RSL is valid if all required RSL parameters and defined in the RSL, * and if all RSL parameters in the RSL tree are supported by the job * manager and/or scheduler. * * As a side effect, the RSL will be modified to include any missing RSL * paramaters which have default values defined in one of the validation * files. * * @param request * A job request. The rsl field of this job request is validated * according to the rsl validation data stored in the two files * passed in to this function. * * @return Returns GLOBUS_SUCCESS if the RSL is valid, and GLOBUS_FAILURE * if it is not. * @see globus_gram_job_manager_rsl_validation_file */ int globus_gram_job_manager_validate_rsl( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, globus_gram_job_manager_validation_when_t when) { int rc; /* First validation: RSL is a boolean "&" */ if(!globus_rsl_is_boolean_and(rsl)) { return GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; } rc = globus_gram_job_manager_validation_update(request->manager); if (rc != GLOBUS_SUCCESS) { return rc; } /* * Make sure all of the attributes match defined RSL validation records. */ rc = globus_l_gram_job_manager_check_rsl_attributes( request, rsl, when); if(rc != GLOBUS_SUCCESS) { goto rsl_check_failed; } /* * Insert default RSL values where appropriate, make sure everything * which is required is defined. */ rc = globus_l_gram_job_manager_insert_default_rsl( request, rsl, when); if (rc != GLOBUS_SUCCESS) { goto insert_default_rsl_failed; } insert_default_rsl_failed: rsl_check_failed: return rc; } /* globus_gram_job_manager_validate_rsl() */ /** * Attribute name matching search predicate. * * Compares a validation record against the desired attribute name. Used * as a predicate in globus_list_search_pred(). * * @param datum * A void * cast of a validation record. * @param args * A void * cast of the desired attribute name. */ static int globus_l_gram_job_manager_attribute_match( void * datum, void * args) { globus_rvf_record_t * tmp = datum; return globus_l_gram_job_manager_validation_string_match( tmp->attribute, args); } /* globus_l_gram_job_manager_attribute_match() */ static globus_bool_t globus_l_gram_job_manager_validation_string_match( const char * str1, const char * str2) { return (strcmp(str1, str2) == 0); } /* globus_l_gram_job_manager_validation_string_match() */ /** * Validate RSL attributes * * Checks that all of the RSL attributes in the request's RSL match * a validation record. If an RSL has an enumerated list of values, * then the value of the RSL is compared against that list. * * @param request * The job request containing the RSL to validate. * @param when * Which RSL validation time scope we will use to decide * whether to use the default values or not. */ static int globus_l_gram_job_manager_check_rsl_attributes( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, globus_gram_job_manager_validation_when_t when) { globus_list_t * operands; globus_list_t * node; globus_rsl_t * relation; char * attribute; char * value_str; globus_rvf_record_t * record; globus_rsl_value_t * value; int rc = GLOBUS_SUCCESS; static const char * operation_types[] = { "??", "=", "!=", ">", ">=", "<", "<=", "??", "&", "|", "+" }; operands = globus_rsl_boolean_get_operand_list(rsl); /* Check to make sure that every attribute is recognized by this * job manager. */ while(!globus_list_empty(operands)) { relation = globus_list_first(operands); operands = globus_list_rest(operands); if (!globus_rsl_is_relation(relation)) { int operator = globus_rsl_boolean_get_operator(relation); if (operator > 10 || operator < 0) { operator = 0; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_rsl.end " "level=ERROR " "msg=\"Required RSL relation, got boolean\" " "operator=%s " "status=%d " "\n", operation_types[operator], -GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL); if (request->gt3_failure_message == NULL) { request->gt3_failure_message = globus_common_create_string( "Required RSL relation, got boolean %s", operation_types[operator]); } } else if (!globus_rsl_is_relation_eq(relation)) { int operator = globus_rsl_relation_get_operator(relation); if (operator > 10 || operator < 0) { operator = 0; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_rsl.end " "level=ERROR " "msg=\"Unsupported RSL operation\" " "attribute=%s " "operator=%s " "status=%d " "\n", globus_rsl_relation_get_attribute(relation), operation_types[operator], -GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL); if (request->gt3_failure_message == NULL) { request->gt3_failure_message = globus_common_create_string( "the job manager does not support the RSL operator " "\"%s\" for the %s attribute", operation_types[operator], globus_rsl_relation_get_attribute(relation)); } return GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; } attribute = globus_rsl_relation_get_attribute(relation); node = globus_list_search_pred( request->manager->validation_records, globus_l_gram_job_manager_attribute_match, attribute); if(!node) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_rsl.end " "level=ERROR " "msg=\"Unsupported RSL attribute\" " "attribute=%s " "status=%d " "\n", globus_rsl_relation_get_attribute(relation), -GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL); if (request->gt3_failure_message == NULL) { request->gt3_failure_message = globus_common_create_string( "the RSL attribute \"%s\" is not supported by the LRM adapter", globus_rsl_relation_get_attribute(relation)); } return GLOBUS_GRAM_PROTOCOL_ERROR_PARAMETER_NOT_SUPPORTED; } record = globus_list_first(node); /* Check valid_when */ if((record->valid_when & when) == 0) { const char * whenstr = "unknown operation"; switch(when) { case GLOBUS_GRAM_VALIDATE_JOB_SUBMIT: whenstr = "submit"; rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SUBMIT_ATTRIBUTE; break; case GLOBUS_GRAM_VALIDATE_JOB_MANAGER_RESTART: whenstr = "restart"; rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_RESTART_ATTRIBUTE; break; case GLOBUS_GRAM_VALIDATE_STDIO_UPDATE: whenstr = "stdio_update"; rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDIO_UPDATE_ATTRIBUTE; break; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_rsl.end " "level=ERROR " "msg=\"Invalid RSL attribute for operation\" " "attribute=%s " "operation=%s " "status=%d " "\n", globus_rsl_relation_get_attribute(relation), whenstr, -rc); if (request->gt3_failure_message == NULL) { request->gt3_failure_message = globus_common_create_string( "Invalid RSL attribute \"%s\" for %s", globus_rsl_relation_get_attribute(relation), whenstr); } return rc; } /* Check enumerated values if applicable */ if(record->enumerated_values) { value = globus_rsl_relation_get_single_value(relation); if(!value) { return globus_l_gram_job_manager_validation_rsl_error(attribute); } value_str = globus_rsl_value_literal_get_string(value); if(!value_str) { return globus_l_gram_job_manager_validation_rsl_error( attribute); } if(strstr(record->enumerated_values, value_str) == GLOBUS_NULL) { rc = globus_l_gram_job_manager_validation_value_error( request, attribute, value_str, record->enumerated_values); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_rsl.end " "level=ERROR " "msg=\"RSL attribute value not in enumeration\" " "attribute=%s " "value=%s " "enumeration=\"%s\" " "status=%d " "\n", record->attribute, value_str, record->enumerated_values, -rc); return rc; } } } return GLOBUS_SUCCESS; } /* globus_l_gram_job_manager_check_rsl_attributes() */ /** * Add default values to RSL and verify required parameters * * Inserts default values to RSL when an RSL parameter is not defined * in it. After this is complete, it checks that all RSL parameters * with the "required_when" flag set are present in the RSL tree. * * @param request * Request which contains the RSL tree to validate. * @param when * Which RSL validation time scope we will use to decide * whether to use the default values or not. */ static int globus_l_gram_job_manager_insert_default_rsl( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, globus_gram_job_manager_validation_when_t when) { globus_rvf_record_t * record; globus_list_t ** attributes; globus_rsl_t * new_relation; char * new_relation_str; globus_list_t * validation_records; int rc = GLOBUS_SUCCESS; attributes = globus_rsl_boolean_get_operand_list_ref(rsl); validation_records = request->manager->validation_records; while(!globus_list_empty(validation_records)) { record = globus_list_first(validation_records); validation_records = globus_list_rest(validation_records); if(record->default_value && (record->default_when&when)) { if(!globus_l_gram_job_manager_attribute_exists( *attributes, record->attribute)) { new_relation_str = globus_common_create_string( "%s = %s", record->attribute, record->default_value); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.validate_rsl.info " "level=TRACE " "msg=\"Inserting default RSL for attribute\" " "attribute=%s " "default=\"%s\" " "\n", record->attribute, record->default_value); new_relation = globus_rsl_parse(new_relation_str); globus_list_insert(attributes, new_relation); free(new_relation_str); } } if(record->required_when & when) { if(!globus_l_gram_job_manager_attribute_exists( *attributes, record->attribute)) { rc = globus_l_gram_job_manager_missing_value_error( record->attribute); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_rsl.end " "level=ERROR " "msg=\"RSL missing required attribute\" " "attribute=%s " "\n", record->attribute); return rc; } } } return rc; } /* globus_l_gram_job_manager_insert_default_rsl() */ /** * Check that a relation for a required RSL attribute is present. * * @param attributes * List of relations which are part of the job request's * RSL. * @param attribute_name * The name of the attribute to search for. */ static globus_bool_t globus_l_gram_job_manager_attribute_exists( globus_list_t * attributes, char * attribute_name) { char * tmp; globus_rsl_t * relation; while(!globus_list_empty(attributes)) { relation = globus_list_first(attributes); attributes = globus_list_rest(attributes); tmp = globus_rsl_relation_get_attribute(relation); if(globus_l_gram_job_manager_validation_string_match( tmp, attribute_name)) { return GLOBUS_TRUE; } } return GLOBUS_FALSE; } /* globus_l_gram_job_manager_attribute_exists() */ /** * Free a validation record * * Frees all strings referenced by the validation record, and * then frees the record itself. * * @param record * The record to free. */ static void globus_l_gram_job_manager_validation_record_free( globus_rvf_record_t * record) { if(!record) { return; } if(record->attribute) { free(record->attribute); } if(record->description) { free(record->description); } if(record->default_value) { free(record->default_value); } if(record->enumerated_values) { free(record->enumerated_values); } free(record); } /* globus_l_gram_job_manager_validation_record_free() */ #define HANDLE_RSL_ERROR(param,error) \ if(globus_l_gram_job_manager_validation_string_match( \ attribute, param)) \ { \ return error; \ } /** * Decide what type of RSL error to return when the value of @a attribute. * is not of the appropriate type. * * @param attribute * Attribute to check. * * @note This should go away when we have better error reporting in the * GRAM protocol. */ static int globus_l_gram_job_manager_validation_rsl_error( const char * attribute) { HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_ARGUMENTS_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_ARGUMENTS) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_COUNT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_COUNT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_DIR_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_DIRECTORY) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_DRY_RUN_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_DRYRUN) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_ENVIRONMENT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_ENVIRONMENT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_EXECUTABLE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EXECUTABLE) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_FILE_CLEANUP_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_CLEANUP) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_IN) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_SHARED_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_IN_SHARED) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_FILE_STAGE_OUT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_OUT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_GASS_CACHE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_GASS_CACHE) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MYJOB_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_MYJOB) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_HOST_COUNT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_HOST_COUNT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_JOB_TYPE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_JOBTYPE) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MAX_CPU_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_MAX_CPU_TIME) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MAX_MEMORY_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_MAX_MEMORY) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MAX_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_MAXTIME) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MAX_WALL_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_MAX_WALL_TIME) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MIN_MEMORY_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_MIN_MEMORY) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_PROJECT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_PROJECT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_QUEUE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_QUEUE) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_REMOTE_IO_URL_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_REMOTE_IO_URL) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_RESTART_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_RESTART) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_SAVE_STATE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SAVE_STATE) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_SCRATCHDIR_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SCRATCH) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_STDERR_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDERR) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_STDERR_POSITION_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDERR_POSITION) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_STDIN_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDIN) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_STDOUT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_STDOUT_POSITION_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT_POSITION) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_TWO_PHASE_COMMIT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_TWO_PHASE_COMMIT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_PROXY_TIMEOUT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_PROXY_TIMEOUT) return GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SCHEDULER_SPECIFIC; } /* globus_l_gram_job_manager_validation_rsl_error() */ static int globus_l_gram_job_manager_validation_value_error( globus_gram_jobmanager_request_t * request, const char * attribute, const char * value, const char * enumerated_values) { if (request->gt3_failure_message == NULL) { request->gt3_failure_message = globus_common_create_string( "RSL attribute \"%s\" has value \"%s\" which is not one of the allowed values (%s)", attribute, value, enumerated_values); } HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_COUNT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_COUNT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MYJOB_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_GRAM_MYJOB) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_HOST_COUNT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_HOST_COUNT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_JOB_TYPE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_JOBTYPE) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MAX_CPU_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_MAX_CPU_TIME) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MAX_MEMORY_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_MAX_MEMORY) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MAX_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_MAXTIME) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MAX_WALL_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_MAX_WALL_TIME) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_MIN_MEMORY_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_MIN_MEMORY) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_PROJECT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_PROJECT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_QUEUE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_QUEUE) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_SAVE_STATE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SAVE_STATE) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_SCRATCHDIR_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRATCH) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_STDERR_POSITION_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDERR_POSITION) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_STDOUT_POSITION_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDOUT_POSITION) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_TWO_PHASE_COMMIT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_TWO_PHASE_COMMIT) HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_PROXY_TIMEOUT_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_PROXY_TIMEOUT) return GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SCHEDULER_SPECIFIC; } /* globus_l_gram_job_manager_validation_value_error() */ static int globus_l_gram_job_manager_missing_value_error( const char * attribute) { HANDLE_RSL_ERROR(GLOBUS_GRAM_PROTOCOL_EXECUTABLE_PARAM, GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_EXE) return GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE; } /* globus_l_gram_job_manager_missing_value_error() */ #endif /* !GLOBUS_DONT_DOCUMENT_INTERNAL */ globus_gram_job_manager-13.53/libxml.m40000666000076400007640000001731011374531663015053 00000000000000# Configure paths for LIBXML2 # Mike Hommey 2004-06-19 # use CPPFLAGS instead of CFLAGS # Toshio Kuratomi 2001-04-21 # Adapted from: # Configure paths for GLIB # Owen Taylor 97-11-3 dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS dnl AC_DEFUN([AM_PATH_XML2],[ AC_ARG_WITH(xml-prefix, [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)], xml_config_prefix="$withval", xml_config_prefix="") AC_ARG_WITH(xml-exec-prefix, [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)], xml_config_exec_prefix="$withval", xml_config_exec_prefix="") AC_ARG_ENABLE(xmltest, [ --disable-xmltest Do not try to compile and run a test LIBXML program],, enable_xmltest=yes) if test x$xml_config_exec_prefix != x ; then xml_config_args="$xml_config_args" if test x${XML2_CONFIG+set} != xset ; then XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config fi fi if test x$xml_config_prefix != x ; then xml_config_args="$xml_config_args --prefix=$xml_config_prefix" if test x${XML2_CONFIG+set} != xset ; then XML2_CONFIG=$xml_config_prefix/bin/xml2-config fi fi AC_PATH_PROG(XML2_CONFIG, xml2-config, no) min_xml_version=ifelse([$1], ,2.0.0,[$1]) AC_MSG_CHECKING(for libxml - version >= $min_xml_version) no_xml="" if test "$XML2_CONFIG" = "no" ; then no_xml=yes else XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags` XML_LIBS=`$XML2_CONFIG $xml_config_args --libs` xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_xmltest" = "xyes" ; then ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" LIBS="$XML_LIBS $LIBS" dnl dnl Now check if the installed libxml is sufficiently new. dnl (Also sanity checks the results of xml2-config to some extent) dnl rm -f conf.xmltest AC_TRY_RUN([ #include #include #include #include int main() { int xml_major_version, xml_minor_version, xml_micro_version; int major, minor, micro; char *tmp_version; system("touch conf.xmltest"); /* Capture xml2-config output via autoconf/configure variables */ /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = (char *)strdup("$min_xml_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string from xml2-config\n", "$min_xml_version"); exit(1); } free(tmp_version); /* Capture the version information from the header files */ tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION); if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) { printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION"); exit(1); } free(tmp_version); /* Compare xml2-config output to the libxml headers */ if ((xml_major_version != $xml_config_major_version) || (xml_minor_version != $xml_config_minor_version) || (xml_micro_version != $xml_config_micro_version)) { printf("*** libxml header files (version %d.%d.%d) do not match\n", xml_major_version, xml_minor_version, xml_micro_version); printf("*** xml2-config (version %d.%d.%d)\n", $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version); return 1; } /* Compare the headers to the library to make sure we match */ /* Less than ideal -- doesn't provide us with return value feedback, * only exits if there's a serious mismatch between header and library. */ LIBXML_TEST_VERSION; /* Test that the library is greater than our minimum version */ if ((xml_major_version > major) || ((xml_major_version == major) && (xml_minor_version > minor)) || ((xml_major_version == major) && (xml_minor_version == minor) && (xml_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", xml_major_version, xml_minor_version, xml_micro_version); printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the xml2-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n"); printf("*** correct copy of xml2-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } return 1; } ],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_xml" = x ; then AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$XML2_CONFIG" = "no" ; then echo "*** The xml2-config script installed by LIBXML could not be found" echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the XML2_CONFIG environment variable to the" echo "*** full path to xml2-config." else if test -f conf.xmltest ; then : else echo "*** Could not run libxml test program, checking why..." CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" LIBS="$LIBS $XML_LIBS" AC_TRY_LINK([ #include #include ], [ LIBXML_TEST_VERSION; return 0;], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBXML or finding the wrong" echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means LIBXML was incorrectly installed" echo "*** or that you have moved LIBXML since it was installed. In the latter case, you" echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ]) CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi fi XML_CPPFLAGS="" XML_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(XML_CPPFLAGS) AC_SUBST(XML_LIBS) rm -f conf.xmltest ]) globus_gram_job_manager-13.53/gram.logrotate.in0000666000076400007640000000035011664744216016575 00000000000000@LOGDIR@/gram_*.log { daily dateext compress missingok notifempty nocreate rotate 4 sharedscripts postrotate /usr/bin/killall -USR1 globus-job-manager 2> /dev/null || true endscript } globus_gram_job_manager-13.53/main.dox0000666000076400007640000000107511620260407014750 00000000000000/** @mainpage GRAM Job Manager Reference Manual @anchor globus_gram_job_manager_main The GRAM Job Manager program starts and monitors jobs on behalf of a GRAM client application. The job manager is typically started by the Gatekeeper program. It interfaces with a local scheduler to start jobs based on a job request RSL string. - @ref globus_gram_job_manager_configuration - @ref globus_gram_job_manager_rsl_validation_file - @ref globus_gram_job_manager_job_execution_environment - @ref globus_gram_job_manager_rsl - @ref globus_gram_job_manager_script_interface */ globus_gram_job_manager-13.53/install-sh0000755000076400007640000002202112145177132015307 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_gram_job_manager-13.53/globus_automake_post0000644000076400007640000000000012055152374017446 00000000000000globus_gram_job_manager-13.53/globus_gram_job_manager.h0000666000076400007640000016016111767655341020331 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * Description: * This header contains the exported interface of the Job Management. * * CVS Information: * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_job_manager.h,v $ * $Date: 2012/06/18 16:44:17 $ * $Revision: 1.70.2.9 $ * $Author: bester $ */ #ifndef GLOBUS_GRAM_JOB_MANAGER_INCLUDE #define GLOBUS_GRAM_JOB_MANAGER_INCLUDE /* Includes */ #include "globus_common.h" #include "globus_gram_protocol.h" #include "globus_rsl.h" #include "globus_gass_cache.h" #include "globus_gsi_credential.h" /* Defines */ #define GLOBUS_GRAM_AUTHZ_CALLOUT_TYPE "globus_gram_jobmanager_authz" EXTERN_C_BEGIN #define GLOBUS_GRAM_JOB_MANAGER_EXPIRATION_ATTR "expiration" /** Pointer to the current request to allow per-job logging to occur */ extern globus_thread_key_t globus_i_gram_request_key; /* Type definitions */ typedef enum { GLOBUS_GRAM_JOB_MANAGER_LOG_FATAL = 1 << 0, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR = 1 << 1, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN = 1 << 2, GLOBUS_GRAM_JOB_MANAGER_LOG_INFO = 1 << 3, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG = 1 << 4, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE = 1 << 5 } globus_gram_job_manager_log_level_t; typedef enum { GLOBUS_GRAM_JOB_MANAGER_STATE_START, GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE, GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED, GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN, GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT, GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1, GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2, GLOBUS_GRAM_JOB_MANAGER_STATE_CLOSE_OUTPUT, GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT, GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END, GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED, GLOBUS_GRAM_JOB_MANAGER_STATE_FILE_CLEAN_UP, GLOBUS_GRAM_JOB_MANAGER_STATE_SCRATCH_CLEAN_UP, GLOBUS_GRAM_JOB_MANAGER_STATE_CACHE_CLEAN_UP, GLOBUS_GRAM_JOB_MANAGER_STATE_DONE, GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED, GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT, GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE, GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED, GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_FILE_CLEAN_UP, GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP, GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CACHE_CLEAN_UP, GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE, GLOBUS_GRAM_JOB_MANAGER_STATE_STOP, GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1, GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2, /* GLOBUS_GRAM_JOB_MANAGER_STATE_PROXY_REFRESH OBSOLETE STATE, */ GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2+2, GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1, GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2 /* GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_PROXY_REFRESH OBSOLETE STATE */ } globus_gram_jobmanager_state_t; typedef enum { GLOBUS_GRAM_JOB_MANAGER_STAGE_IN, GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED, GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT, GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS } globus_gram_job_manager_staging_type_t; typedef enum { GLOBUS_GRAM_JOB_MANAGER_SIGNAL, GLOBUS_GRAM_JOB_MANAGER_CANCEL, GLOBUS_GRAM_JOB_MANAGER_PROXY_REFRESH } globus_gram_job_manager_query_type_t; typedef enum { GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_CANCEL, GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_SIGNAL, GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_SUBMIT, GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_STAGE_OUT, GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_STAGE_IN, GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_POLL } globus_gram_script_priority_level_t; typedef struct { globus_gram_script_priority_level_t priority_level; uint64_t sequence; } globus_gram_script_priority_t; typedef struct { globus_gram_job_manager_staging_type_t type; globus_rsl_value_t * from; char * evaled_from; globus_rsl_value_t * to; char * evaled_to; } globus_gram_job_manager_staging_info_t; typedef struct { /** * Query type */ globus_gram_job_manager_query_type_t type; /** * Connection handle * * Handle to send the script response to. */ globus_gram_protocol_handle_t handle; /** * Signal * * Type of signal to process. */ globus_gram_protocol_job_signal_t signal; /** * Signal-specific data * * If a priority change maybe something like high, medium, low. see * the documentation on signals in the globus_gram_protocol library. */ char * signal_arg; /** * Query-specific RSL tree * * If the query is a stdio update signal, then the arg is an RSL * string which may contain replacement values for * stdout, stderr, stdout_position, stderr_position, and remoteio_url. * This will be merged with the request's tree as the signal is handled. */ globus_rsl_t * rsl; globus_gram_protocol_error_t failure_code; /* When doing a proxy refresh, the newly delegated credential */ gss_cred_id_t delegated_credential; } globus_gram_job_manager_query_t; /** * Command-line configuration for a LRM instance. All of these items are * read from command-line or startup environment and do not change while * the job manager is running. */ typedef struct { /* * ------------------------------------------------------------------- * Values derived from command-line options and configuration file * ------------------------------------------------------------------- */ /** True if we are using kerberos for security instead of X.509 * certificates. */ globus_bool_t kerberos; /** * Path to globus installation. */ char * globus_location; /** * GLOBUS_LOCATION which can be used on the target execution nodes. */ char * target_globus_location; /** * Job Manager Type * * Identifies the scheduler which will be used to process this job * request. Possible values are fork, loadleveler, lsf, easymcs, pbs, * and others. */ char * jobmanager_type; /** * Directory to store job state history information */ char * job_history_dir; /** * Default cache path (may contain RSL substitutions) */ char * cache_location; /** * Scratch directory root * * If the client requests a scratch directory with a relative path, * this base directory is prepended to it. It defaults to $(HOME), * but can be overridden on the job manager command line or configuration * file. */ char * scratch_dir_base; /** * Condor Architecture * * Used only when type=condor. Must match one of the archetecture values * as defined by condor */ char * condor_arch; /** * Condor Operating System * * Used only when type=condor. Must match one of the opsys values as * defined by condor */ char * condor_os; /** gatekeeper host RSL substitution */ char * globus_gatekeeper_host; /** gatekeeper port RSL substitution */ char * globus_gatekeeper_port; /** gatekeeper subject RSL substitution */ char * globus_gatekeeper_subject; /** host manufacturer RSL substitution */ char * globus_host_manufacturer; /** host cputype RSL substitution */ char * globus_host_cputype; /** host OS name RSL substitution */ char * globus_host_osname; /** host OS version RSL substitution */ char * globus_host_osversion; /** * Firewall-friendly range of TCP ports that will be used for network * traffic. */ char * tcp_port_range; /** * Firewall-friendly range of TCP ports that will be used as sources for network * traffic. */ char * tcp_source_range; /** Directory to store job_state files */ char * job_state_file_dir; /** * Site-wide trusted certificate path. */ char * x509_cert_dir; /** * List of char * which are variables to be added to the job environment. * They can be specified as just a name (in which case the value in the * job manager's environment will be used, or a NAME=VALUE string. */ globus_list_t * extra_envvars; /** * SEG module to use instead of polling. */ char * seg_module; /** * Path to job auditing directory. */ char * auditing_dir; /** Globus Toolkit version */ char * globus_version; /** Usage stats enabled by default */ globus_bool_t usage_disabled; /** Usage stats target servers * List of servers to report usage statistics to. A null value * will result in the standard Globus listener getting the default set * of packets. */ char * usage_targets; /** * Streaming * * streaming_disabled is set from the config option -disable-streaming. * The default is false. * This is passed to the batch system script to decide whether to allow the * job. This lets admins disable streaming for most jobs, but allow it for * certain ones (e.g. the grid monitor). */ globus_bool_t streaming_disabled; /** * Minimum proxy lifetime (in seconds) to allow. Once it is noticed that * the proxy will expire before that time, the job manager will go into the * STOP state. */ int proxy_timeout; /** * Events to record to syslog/log file. A bitwise or of the values from the * globus_gram_job_manager_log_level_t enumeration. */ int log_levels; /** * Flag indicating whether to use syslog for logging */ globus_bool_t syslog_enabled; /** * Log file pattern. This may contain standard RSL substitutions. */ const char * log_pattern; /* * ------------------------------------------------------------------- * Values derived from job manager environment * ------------------------------------------------------------------- */ /** GSI Subject name */ char * subject; /** User home directory */ char * home; /** Username */ char * logname; /** GRAM host */ char * hostname; /** Short host name */ char * short_hostname; /** * Service tag to differentiate job managers which are processing * jobs for the same LRM with different configurations */ char * service_tag; /** * This is the prefix to directory which will contain host+lrm specific * state files. By default, it is $HOME/.globus/job, but can be * modified by -globus-job-dir command-line option */ char * job_dir_home; /** * Boolean flag indicating whether to enable GSI callouts * on GRAM operations or not. Default to no. */ globus_bool_t enable_callout; } globus_gram_job_manager_config_t; typedef struct { globus_callback_handle_t session_timer_handle; char * jm_id; globus_abstime_t jm_start_time; int count_total_done; int count_total_failed; int count_total_canceled; int count_restarted; int count_dryrun; int count_peak_jobs; int count_current_jobs; } globus_i_gram_usage_tracker_t; typedef struct globus_i_gram_usage_job_tracker_s { globus_abstime_t unsubmitted_timestamp; globus_abstime_t file_stage_in_timestamp; globus_abstime_t pending_timestamp; globus_abstime_t active_timestamp; globus_abstime_t failed_timestamp; globus_abstime_t file_stage_out_timestamp; globus_abstime_t done_timestamp; int restart_count; int callback_count; int status_count; int register_count; int unregister_count; int signal_count; int refresh_count; int file_clean_up_count; int file_stage_in_http_count; int file_stage_in_https_count; int file_stage_in_ftp_count; int file_stage_in_gsiftp_count; int file_stage_in_shared_http_count; int file_stage_in_shared_https_count; int file_stage_in_shared_ftp_count; int file_stage_in_shared_gsiftp_count; int file_stage_out_http_count; int file_stage_out_https_count; int file_stage_out_ftp_count; int file_stage_out_gsiftp_count; char * client_address; char * user_dn; } globus_i_gram_usage_job_tracker_t; typedef struct { /** Address of the client which submitted the job (hashtable key) */ char * client_addr; /** Queue of script contexts ready to run */ globus_priority_q_t script_queue; /** Number of script slots available for running scripts */ int script_slots_available; /** Fifo of available script handles */ globus_fifo_t script_handles; } globus_gram_job_manager_scripts_t; /** * Runtime state for a LRM instance. All of these items are * computed from the configuration state above and may change during the * lifetime of the job manager. */ typedef struct globus_gram_job_manager_s { /** Link to the static job manager configuration */ globus_gram_job_manager_config_t * config; /** * set to GLOBUS_TRUE when the seg monitoring has begun */ globus_bool_t seg_started; /** * Timestamp of the last SEG event we've completely processed. Initially * set to the time of the job submission. */ time_t seg_last_timestamp; /** * Callback handle for fork SEG-like polling */ globus_callback_handle_t fork_callback_handle; /** LRM-specific set of validation records */ globus_list_t * validation_records; /** Newest validation file timestamp */ time_t validation_record_timestamp; /** Track when validation files are added or removed */ globus_bool_t validation_file_exists[4]; /** GRAM job manager listener contact string */ char * url_base; /** Time when the job manager-wide proxy will expire */ time_t cred_expiration_time; /** Timer tracking until the proxy expiration callback causes the job * manager to stop. */ globus_callback_handle_t proxy_expiration_timer; /** Hashtable mapping request->job_contact_path to request */ globus_hashtable_t request_hash; /** Hashtable mapping job id->job_contact_path */ globus_hashtable_t job_id_hash; /** Lock for thread-safety */ globus_mutex_t mutex; /** Condition for noting when all jobs are done */ globus_cond_t cond; /** Unix domain socket for receiving new job requests for other * job managers */ int socket_fd; /** XIO Handle for socket_fd so we can use XIO's select loop */ globus_xio_handle_t active_job_manager_handle; /** Lock file related to the socket_fd */ int lock_fd; /** Socket file path */ char * socket_path; /** Lock file path */ char * lock_path; /** Pid file path */ char * pid_path; /** OSG wants to have different clients connecting to the same job manager * to have separate script queues fto have scalability with nonresponsive * clients. We hash on client's address and have separate script queue and * available slots. */ globus_list_t * scripts_per_client; /** Fifo of job state callback contexts to run */ globus_fifo_t state_callback_fifo; /** Number of job state contact slots available */ int state_callback_slots; /** Path of job manager credential */ char * cred_path; /** Grace period oneshot */ globus_callback_handle_t grace_period_timer; /** All jobs are done and grace period is complete */ globus_bool_t done; globus_fifo_t seg_event_queue; int seg_pause_count; /** All jobs are being stopped. Don't allow new ones in */ globus_bool_t stop; /** List of jobs that still need to be restarted, but haven't yet */ globus_list_t * pending_restarts; /** Periodic callback handle to process jobs in the pending_restarts list */ globus_callback_handle_t pending_restart_handle; /** Usage stats tracking data */ globus_i_gram_usage_tracker_t * usagetracker; /** * Error message extension for early misconfiguration-type errors that * occur before a request is read. */ char * gt3_failure_message; globus_xio_attr_t script_attr; /** * Periodic callback handle to expire jobs which completed or failed * but didn't have two-phase end happen. */ globus_callback_handle_t expiration_handle; /** * Periodic callback handle to abort if something removes the lock file. */ globus_callback_handle_t lockcheck_handle; /** * Periodic callback handle to clse idle perl script xio handles */ globus_callback_handle_t idle_script_handle; } globus_gram_job_manager_t; /** * Job Manager Request */ typedef struct globus_gram_job_manager_request_s { /** Link to LRM-specific configuration */ globus_gram_job_manager_config_t * config; /** Link to LRM-specific runtime state */ globus_gram_job_manager_t * manager; /** * Job State * * The state of the job. This corresponds to the job state machine * described in the GRAM documentation. * * Use globus_gram_job_manager_request_set_status() to change. * */ globus_gram_protocol_job_state_t status; /** * Terminal state * * The projected terminal state of the job. In the case of multiple * ids returned from the submit script, this will be set to failed if * any subjobs failed, or done otherwise. */ globus_gram_protocol_job_state_t expected_terminal_state; /** * Last time status was changed * * The time that the status member was last changed. * Automatically set by globus_gram_job_manager_request_set_status(). */ time_t status_update_time; /** * Job Failure Reason * * If the state is GLOBUS_GRAM_STATE_FAILED, then this * is an integer code that defines the failure. It is one of * GLOBUS_GRAM_PROTOCOL_ERROR_*. */ int failure_code; /** * Extended error message */ char * gt3_failure_message; /** * Extended error type */ char * gt3_failure_type; /** * Extended error information for staging errors (source url) */ char * gt3_failure_source; /** * Extended error information for staging errors (destination url) */ char * gt3_failure_destination; /** * Job Exit Code * * If the state is GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE, then this * is an integer exit code from the job's executable. */ int exit_code; /** Stop Reason * * If the job request is stopped either by an explicit signal or a proxy * timeout, this will be set to something besides 0, and that will be * sent as part of a fail message to satisfy condor */ int stop_reason; /** * Job identifier string * * String representation of the LRM job id. May be a comma-separated * string of separately-pollable ID values. This value is filled in when the * request is submitted. This version is modified as the subjobs complete. */ char * job_id_string; /** * Job identifier string * * String representation of the LRM job id. May be a comma-separated string * of separately-pollable ID values. This value is filled in when the * request is submitted. */ char * original_job_id_string; /** * Poll Frequency * * How often should a check of the job status and output files be done. */ unsigned int poll_frequency; /** * Dry Run * * If this is GLOBUS_TRUE, do not actually submit the job to the scheduler, * just verify the job parameters. */ globus_bool_t dry_run; /** * * Two-phase commit. * * Non-zero if request should be confirmed via another signal. * * The value is how many seconds to wait before timing out. */ int two_phase_commit; /** * Value to extend the two-phase commit wait time by if a commit extend * signal arrives. */ int commit_extend; /** Time when job manager process is first begun */ time_t creation_time; /** Time when job manager gets jobid from scheduler */ time_t queued_time; /** Job-specific GASS cache tag. */ char * cache_tag; /** RSL substitution symbol table */ globus_symboltable_t symbol_table; /** Parsed RSL values */ globus_rsl_t * rsl; /** Canonical RSL document */ char * rsl_spec; /** * Previous Job Manager Contact * * If we're restarting from a terminated Job Manager, this will specify * the old job contact so we can locate the Job Manager state file. */ char * jm_restart; /** * Unique job identifier * * Unique id for this job that will be consistent * across jobmanager restarts/recoveries. */ char * uniq_id; /** Job contact string */ char * job_contact; /** Unique job contact suffix */ char * job_contact_path; /** Job-specific persistence file */ char * job_state_file; /** Job-specific scratch directory after RSL evaluation */ char * scratch_dir_base; /** * Job scratch directory. * * Scratch subdirectory created for this job. It will be removed * when the job completes. This is a subdirectory of scratch_dir_base. */ char * scratchdir; /** remote_io_url value */ char * remote_io_url; /** file to write remote_io_url to */ char * remote_io_url_file; /** Job-specific proxy file */ char * x509_user_proxy; /** Thread safety */ globus_mutex_t mutex; /** Thread safety */ globus_cond_t cond; /** Clients registered for job state changes */ globus_list_t * client_contacts; /** List of file_stage_in values which haven't yet been processed */ globus_list_t * stage_in_todo; /** List of file_stage_in_shared values which haven't yet been processed */ globus_list_t * stage_in_shared_todo; /** List of file_stage_out values which haven't yet been processed */ globus_list_t * stage_out_todo; /** List of file_stream_out values which haven't yet been processed */ globus_list_t * stage_stream_todo; /** Current state machine state */ globus_gram_jobmanager_state_t jobmanager_state; /** State to resume from in the case of a restart */ globus_gram_jobmanager_state_t restart_state; /** * True if a job state change hasn't been sent to the callbacks registered * with it */ globus_bool_t unsent_status_change; /** Timer tracking until the next job poll */ globus_callback_handle_t poll_timer; /** * Queue of job-specific operations (signals, cancel, etc) sent via the job * interface. */ globus_fifo_t pending_queries; /** Directory for temporary job-specific files. */ char * job_dir; /** * streaming_requested is set to true if there's at least one remote * destination for stdout or stderr. Otherwise, it's false. */ globus_bool_t streaming_requested; /** Job-specific cache path after RSL evaluation */ char * cache_location; /** Handle to add/remove files from the GASS cache */ globus_gass_cache_t cache_handle; /** Path to job history file */ char * job_history_file; /** Last job state stored in the job history file */ int job_history_status; /** * Value of the GLOBUS_CACHED_STDOUT RSL substitution */ char * cached_stdout; /** * Value of the GLOBUS_CACHED_STDERR RSL substitution */ char * cached_stderr; /** Security context used to submit job */ gss_ctx_id_t response_context; /** Job Contact of this job when being handled by another process */ char * old_job_contact; /** * Queue of pending SEG events */ globus_fifo_t seg_event_queue; /** * Timestamp of the last SEG event we've completely processed. Initially * set to the time of the job submission. */ time_t seg_last_timestamp; /** * TG Gateway user for auditing (from SAML assertion) */ char * gateway_user; /** * Information to be tracked for usagestats */ globus_i_gram_usage_job_tracker_t job_stats; /** * Per-job log configuration, a bitwise or of values from the * globus_gram_job_manager_log_level_t enumeration. */ int job_log_level; /** * Per-job log filename pattern. If not set, the global log path will be used */ char * log_pattern; } globus_gram_jobmanager_request_t; typedef struct globus_gram_job_manager_ref_s { /* Local copy of the unique hashtable key */ char * key; /* Pointer to manager */ globus_gram_job_manager_t * manager; /* Pointer to the request, may be NULL if the request is swapped out of * memory because there is no active reference to it */ globus_gram_jobmanager_request_t * request; /* Count of callbacks, queries, etc that refer to this job. * When 0, the request is eligible for removal from memory. */ int reference_count; /* Timer to delay cleaning up unreferenced requests */ globus_callback_handle_t cleanup_timer; /* Current job state, for status updates without having to reload */ globus_gram_protocol_job_state_t job_state; /* Current job failure code, for status updates without having to reload */ int failure_code; /* Job exit code */ int exit_code; /* Number of times status query was processed while the job is swapped * out */ int status_count; /* * True if the job has been loaded from the state file at recovery * time, but hasn't yet had its state machine started. In that case, * we have to go to the TWO_PHASE_COMMITTED state unless the job has * completed execution. */ globus_bool_t loaded_only; /** * Timestamp of when to auto-destroy this job. Thsi will be 0 unless * the job has completed and failed to have it's two-phase commit end. * A periodic event will poll through the refs that have this attribute * set, and will reload them with a fake commit to get them cleaned up. */ time_t expiration_time; /* The following are used for the internal fakeseg stuff for condor*/ /** * Timestamp of the last SEG event we've completely processed. Initially * set to the time of the job submission. */ time_t seg_last_timestamp; /** * Size of the Condor log file last time we polled. */ globus_off_t seg_last_size; } globus_gram_job_manager_ref_t; /* globus_gram_job_manager_config.c */ int globus_gram_job_manager_config_init( globus_gram_job_manager_config_t * config, int argc, char ** argv); void globus_gram_job_manager_config_destroy( globus_gram_job_manager_config_t * config); int globus_i_gram_parse_log_levels( const char * unparsed_string, int * log_levels, char ** error_string); /* globus_gram_job_manager_request.c */ #ifdef DEBUG_THREADS #define GlobusGramJobManagerRequestLock(request) \ do { \ globus_gram_job_manager_request_log( \ request, \ "JM: [tid=%ld] Locking request (%s:%d) %p\n", \ (long) globus_thread_self(), \ __FILE__, \ __LINE__, \ (request)); \ globus_mutex_lock(&(request)->mutex); \ } while (0) #define GlobusGramJobManagerRequestUnlock(request) \ do { \ globus_gram_job_manager_request_log( \ request, \ "JM: [tid=%ld] Unlocking request (%s:%d) %p\n", \ (long) globus_thread_self() \ __FILE__, \ __LINE__, \ (request)); \ globus_mutex_unlock(&(request)->mutex); \ } while (0) #else #define GlobusGramJobManagerRequestLock(request) \ globus_mutex_lock(&(request)->mutex) #define GlobusGramJobManagerRequestUnlock(request) \ globus_mutex_unlock(&(request)->mutex) #endif int globus_gram_job_manager_request_init( globus_gram_jobmanager_request_t ** request, globus_gram_job_manager_t * manager, char * rsl, gss_cred_id_t delegated_credential, gss_ctx_id_t response_ctx, globus_gsi_cred_handle_t peer_cred, globus_bool_t reinit, char ** old_job_contact, globus_gram_jobmanager_request_t ** old_job_request, char ** gt3_failure_message); void globus_gram_job_manager_request_destroy( globus_gram_jobmanager_request_t * request); void globus_gram_job_manager_request_free( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_request_set_status( globus_gram_jobmanager_request_t * request, globus_gram_protocol_job_state_t status); int globus_gram_job_manager_request_set_status_time( globus_gram_jobmanager_request_t * request, globus_gram_protocol_job_state_t status, time_t valid_time); void globus_gram_job_manager_request_log( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_log_level_t level, const char * format, ...); int globus_gram_job_manager_request_acct( globus_gram_jobmanager_request_t * request, const char * format, ...); int globus_gram_job_manager_symbol_table_populate( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_history_file_set( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_history_file_create( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_request_load( globus_gram_job_manager_t * manager, int http_body_fd, int context_fd, gss_cred_id_t credential, const char * peer_address, globus_gsi_cred_handle_t peer_cred_handle, size_t content_length, globus_gram_jobmanager_request_t ** request, gss_ctx_id_t * context, char ** contact, int * job_state_mask, char ** old_job_contact, globus_gram_jobmanager_request_t ** old_job_request, globus_bool_t * version_only, char ** gt3_failure_message); int globus_gram_job_manager_request_start( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, int response_fd, const char * client_contact, int job_state_mask); void globus_gram_job_manager_destroy_directory( globus_gram_jobmanager_request_t * request, const char * directory); int globus_gram_job_manager_request_load_all( globus_gram_job_manager_t * manager); int globus_i_gram_request_stdio_update( globus_gram_jobmanager_request_t * request, globus_rsl_t * update_rsl); int globus_i_gram_symbol_table_populate( globus_gram_job_manager_config_t * config, globus_symboltable_t * symbol_table); /* globus_gram_job_manager_validate.c */ /** * Select when an RSL parameter is valid or required. * @ingroup globus_gram_job_manager_rsl_validation */ typedef enum { GLOBUS_GRAM_VALIDATE_JOB_SUBMIT = 1, GLOBUS_GRAM_VALIDATE_JOB_MANAGER_RESTART = 2, GLOBUS_GRAM_VALIDATE_STDIO_UPDATE = 4 } globus_gram_job_manager_validation_when_t; extern int globus_gram_job_manager_validation_destroy( globus_list_t * validation_records); extern int globus_gram_job_manager_validate_rsl( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, globus_gram_job_manager_validation_when_t when); /* globus_gram_job_manager_contact.c */ int globus_gram_job_manager_contact_add( globus_gram_jobmanager_request_t * request, const char * contact, int job_state_mask); int globus_gram_job_manager_contact_remove( globus_gram_jobmanager_request_t * request, const char * contact); int globus_gram_job_manager_contact_list_free( globus_gram_jobmanager_request_t * request); void globus_gram_job_manager_contact_state_callback( globus_gram_jobmanager_request_t * request, globus_bool_t restart_state_machine); int globus_gram_job_manager_write_callback_contacts( globus_gram_jobmanager_request_t * request, FILE * fp); int globus_gram_job_manager_read_callback_contacts( globus_gram_jobmanager_request_t * request, FILE * fp); /* globus_gram_job_manager_state.c */ extern const char * globus_i_gram_job_manager_state_strings[]; int globus_gram_job_manager_read_request( globus_gram_job_manager_t * manager, int fd, size_t content_length, char ** rsl, char ** client_contact, int * job_state_mask, globus_bool_t * version_only); int globus_gram_job_manager_reply( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_t * manager, int response_code, const char * job_contact, int response_fd, gss_ctx_id_t response_context, const char * gt3_failure_message); int globus_gram_job_manager_validate_username( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_state_machine_register( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, globus_reltime_t * delay); int globus_i_gram_remote_io_url_update( globus_gram_jobmanager_request_t * request); void globus_gram_job_manager_state_machine_callback( void * user_arg); /* globus_gram_job_manager_gsi.c */ int globus_gram_job_manager_import_sec_context( globus_gram_job_manager_t * manager, int context_fd, gss_ctx_id_t * response_contextp); globus_bool_t globus_gram_job_manager_gsi_used( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_gsi_register_proxy_timeout( globus_gram_job_manager_t * manager, gss_cred_id_t cred, int timeout, globus_callback_handle_t * callback_handle); int globus_gram_job_manager_gsi_get_subject( char ** subject_name); int globus_gram_job_manager_gsi_update_credential( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, gss_cred_id_t credential); int globus_gram_job_manager_gsi_write_credential( globus_gram_jobmanager_request_t * request, gss_cred_id_t credential, const char * path); int globus_gram_job_manager_gsi_update_proxy_timeout( globus_gram_job_manager_t * manager, gss_cred_id_t cred, int timeout, globus_callback_handle_t * callback_handle); int globus_gram_job_manager_gsi_relocate_proxy( globus_gram_jobmanager_request_t * request, const char * new_proxy); int globus_gram_job_manager_call_authz_callout( globus_gram_job_manager_config_t * config, gss_ctx_id_t request_context, gss_ctx_id_t authz_context, const char * uniq_id, const globus_rsl_t * rsl, const char * auth_type); int globus_gram_job_manager_authz_query( globus_gram_job_manager_t * manager, globus_gram_protocol_handle_t handle, const char * uri, const char * auth_type); int globus_gram_gsi_get_dn_hash( gss_cred_id_t cred, unsigned long * hash); /* globus_gram_job_manager_query.c */ void globus_gram_job_manager_query_callback( void * arg, globus_gram_protocol_handle_t handle, globus_byte_t * buf, globus_size_t nbytes, int errorcode, char * uri); void globus_gram_job_manager_query_reply( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_query_t * query); /* globus_gram_job_manager_staging.c */ int globus_gram_job_manager_staging_create_list( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_streaming_list_replace( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_staging_remove( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_staging_type_t type, char * from, char * to); int globus_gram_job_manager_staging_write_state( globus_gram_jobmanager_request_t * request, FILE * fp); int globus_gram_job_manager_staging_read_state( globus_gram_jobmanager_request_t * request, FILE * fp); void globus_gram_job_manager_staging_free_all( globus_gram_jobmanager_request_t * request); /* globus_gram_job_manager_rsl.c */ globus_rsl_t * globus_gram_job_manager_rsl_merge( globus_rsl_t * base_rsl, globus_rsl_t * override_rsl); globus_bool_t globus_gram_job_manager_rsl_attribute_exists( globus_rsl_t * rsl, const char * attribute); globus_bool_t globus_gram_job_manager_rsl_need_stage_in( globus_gram_jobmanager_request_t * request); globus_bool_t globus_gram_job_manager_rsl_need_stage_out( globus_gram_jobmanager_request_t * request); globus_bool_t globus_gram_job_manager_rsl_need_file_cleanup( globus_gram_jobmanager_request_t * request); globus_bool_t globus_gram_job_manager_rsl_need_scratchdir( globus_gram_jobmanager_request_t * request); globus_bool_t globus_gram_job_manager_rsl_need_restart( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_rsl_env_add( globus_rsl_t * ast_node, const char * var, const char * value); int globus_gram_job_manager_rsl_eval_one_attribute( globus_gram_jobmanager_request_t * request, char * attribute, char ** value); int globus_gram_job_manager_rsl_remove_attribute( globus_rsl_t * rsl, char * attribute); globus_rsl_t * globus_gram_job_manager_rsl_extract_relation( globus_rsl_t * rsl, const char * attribute); int globus_gram_job_manager_rsl_add_relation( globus_rsl_t * rsl, globus_rsl_t * relation); int globus_gram_job_manager_rsl_parse_value( char * value_string, globus_rsl_value_t ** rsl_value); int globus_gram_job_manager_rsl_evaluate_value( globus_symboltable_t * symbol_table, globus_rsl_value_t * value, char ** value_string); int globus_gram_job_manager_rsl_eval_string( globus_symboltable_t * symbol_table, const char * string, char ** value_string); int globus_gram_job_manager_rsl_attribute_get_string_value( globus_rsl_t * rsl, const char * attribute, const char ** value_ptr); int globus_gram_job_manager_rsl_attribute_get_boolean_value( globus_rsl_t * rsl, const char * attribute, globus_bool_t * value_ptr); int globus_gram_job_manager_rsl_attribute_get_int_value( globus_rsl_t * rsl, const char * attribute, int * value_ptr); int globus_gram_rsl_add_output( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, const char * attribute, const char * value); int globus_gram_rsl_add_stream_out( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, const char * source, const char * destination); /* globus_gram_job_manager_state_file.c */ int globus_gram_job_manager_state_file_set( globus_gram_jobmanager_request_t * request, char ** state_file); int globus_gram_job_manager_file_lock( int fd); int globus_gram_job_manager_state_file_read( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_state_file_write( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_state_file_register_update( globus_gram_jobmanager_request_t * request); /* globus_gram_job_manager_script.c */ int globus_gram_job_manager_script_stage_in( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_script_stage_out( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_script_submit( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_script_poll( globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_script_signal( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_query_t * query); int globus_gram_job_manager_script_cancel( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_query_t * query); globus_bool_t globus_i_gram_job_manager_script_valid_state_change( globus_gram_jobmanager_request_t * request, globus_gram_protocol_job_state_t new_state); void globus_gram_job_manager_script_close_all( globus_gram_job_manager_t * manager); void globus_gram_script_close_idle( void * arg); extern globus_xio_driver_t globus_i_gram_job_manager_popen_driver; extern globus_xio_stack_t globus_i_gram_job_manager_popen_stack; /* globus_gram_job_manager_seg.c */ globus_result_t globus_gram_job_manager_init_seg( globus_gram_job_manager_t * request); globus_result_t globus_gram_job_manager_shutdown_seg( globus_gram_job_manager_t * manager); void globus_gram_job_manager_seg_handle_event( globus_gram_jobmanager_request_t * request); void globus_gram_job_manager_seg_pause( globus_gram_job_manager_t * manager); void globus_gram_job_manager_seg_resume( globus_gram_job_manager_t * manager); int globus_gram_job_manager_seg_parse_condor_id( globus_gram_jobmanager_request_t * request, char ** condor_id); /* globus_gram_job_manager_auditing.c */ int globus_gram_job_manager_auditing_file_write( globus_gram_jobmanager_request_t * request); /* globus_gram_job_manager.c */ #ifdef DEBUG_THREADS #define GlobusGramJobManagerLock(manager) \ do { \ globus_gram_job_manager_log( \ manager, \ "JM: [tid=%ld] Locking manager (%s:%d) %p\n", \ (long) globus_thread_self() \ __FILE__, \ __LINE__, \ (manager)); \ globus_mutex_lock(&(manager)->mutex); \ } while (0) #define GlobusGramJobManagerUnlock(manager) \ do { \ globus_gram_job_manager_log( \ manager, \ "JM: [tid=%d] Unlocking manager (%s:%d) %p\n", \ (long) globus_thread_self() \ __FILE__, \ __LINE__, \ (manager)); \ globus_mutex_unlock(&(manager)->mutex); \ } while (0) #define GlobusGramJobManagerWait(manager) \ do { \ globus_gram_job_manager_log( \ manager, \ GLOBUS_GRAM_LOG_TRACE, \ "JM: [tid=%ld] Condition Wait: Unlocking manager (%s:%d) %p\n", \ (long) globus_thread_self() \ __FILE__, \ __LINE__, \ (manager)); \ globus_cond_wait(&(manager)->cond, &(manager)->mutex); \ globus_gram_job_manager_log( \ manager, \ GLOBUS_GRAM_LOG_TRACE, \ "JM: [tid=%ld] Condition Wait Returns: Locking manager (%s:%d) %p\n", \ (long) globus_thread_self() \ __FILE__, \ __LINE__, \ (manager)); \ } while (0) #else #define GlobusGramJobManagerLock(manager) \ globus_mutex_lock(&(manager)->mutex) #define GlobusGramJobManagerUnlock(manager) \ globus_mutex_unlock(&(manager)->mutex) #define GlobusGramJobManagerWait(manager) \ globus_cond_wait(&(manager)->cond, &(manager)->mutex); #endif int globus_gram_job_manager_init( globus_gram_job_manager_t * manager, gss_cred_id_t cred, globus_gram_job_manager_config_t * config); void globus_gram_job_manager_destroy( globus_gram_job_manager_t * manager); void globus_gram_job_manager_log( globus_gram_job_manager_t * manager, globus_gram_job_manager_log_level_t level, const char * format, ...); int globus_gram_job_manager_add_request( globus_gram_job_manager_t * manager, const char * key, globus_gram_jobmanager_request_t * request); int globus_gram_job_manager_add_reference( globus_gram_job_manager_t * manager, const char * key, const char * reason, globus_gram_jobmanager_request_t ** request); int globus_gram_job_manager_remove_reference( globus_gram_job_manager_t * manager, const char * reason, const char * key); int globus_gram_job_manager_register_job_id( globus_gram_job_manager_t * manager, char * job_id, globus_gram_jobmanager_request_t * request, globus_bool_t prelocked); int globus_gram_job_manager_unregister_job_id( globus_gram_job_manager_t * manager, char * job_id); int globus_gram_job_manager_add_reference_by_jobid( globus_gram_job_manager_t * manager, const char * jobid, const char * reason, globus_gram_jobmanager_request_t ** request); int globus_gram_job_manager_get_job_id_list( globus_gram_job_manager_t * manager, globus_list_t ** job_id_list); globus_bool_t globus_gram_job_manager_request_exists( globus_gram_job_manager_t * manager, const char * key); void globus_gram_job_manager_set_grace_period_timer( globus_gram_job_manager_t * manager); void globus_gram_job_manager_expire_old_jobs( void * arg); int globus_gram_job_manager_set_status( globus_gram_job_manager_t * manager, const char * key, globus_gram_protocol_job_state_t state, int failure_code, int exit_code); int globus_gram_job_manager_get_status( globus_gram_job_manager_t * manager, const char * key, globus_gram_protocol_job_state_t * state, int * failure_code, int * exit_code); void globus_gram_job_manager_stop_all_jobs( globus_gram_job_manager_t * manager); int globus_gram_split_subjobs( const char * job_id, globus_list_t ** subjobs); int globus_i_gram_mkdir( char * path); /* globus_gram_job_manager_usagestats.c */ globus_result_t globus_i_gram_usage_start_session_stats( globus_gram_job_manager_t * manager); globus_result_t globus_i_gram_usage_end_session_stats( globus_gram_job_manager_t * manager); void globus_i_gram_send_session_stats( globus_gram_job_manager_t * manager); void globus_i_gram_send_job_stats( globus_gram_jobmanager_request_t * request); void globus_i_gram_send_job_failure_stats( globus_gram_job_manager_t * manager, int rc); globus_result_t globus_i_gram_usage_stats_init( globus_gram_job_manager_t * manager); globus_result_t globus_i_gram_usage_stats_destroy( globus_gram_job_manager_t * manager); /* startup_socket.c */ int globus_gram_job_manager_startup_lock( globus_gram_job_manager_t * manager, int * lock_fd); int globus_gram_job_manager_startup_socket_init( globus_gram_job_manager_t * manager, globus_xio_handle_t * handle, int * socket_fd); int globus_gram_job_manager_starter_send( globus_gram_job_manager_t * manager, int http_body_fd, int context_fd, int response_fd, gss_cred_id_t cred); int globus_gram_job_manager_starter_send_v2( globus_gram_job_manager_t * manager, gss_cred_id_t cred); extern globus_xio_driver_t globus_i_gram_job_manager_file_driver; extern globus_xio_stack_t globus_i_gram_job_manager_file_stack; /* tg_gateway.c */ int globus_i_gram_get_tg_gateway_user( gss_ctx_id_t context, globus_gsi_cred_handle_t peer_cred, char ** gateway_user); /* logging.c */ extern globus_logging_handle_t globus_i_gram_job_manager_log_stdio; extern globus_logging_handle_t globus_i_gram_job_manager_log_sys; extern void globus_i_job_manager_log_rotate(int sig); extern int globus_gram_job_manager_logging_init( globus_gram_job_manager_config_t * config); extern void globus_gram_job_manager_logging_destroy(void); extern char * globus_gram_prepare_log_string( const char * instr); EXTERN_C_END #endif /* GLOBUS_GRAM_JOB_MANAGER_INCLUDE */ #endif /* ! GLOBUS_DONT_DOCUMENT_INTERNAL */ globus_gram_job_manager-13.53/globus_gram_job_manager_gsi.c0000666000076400007640000010077011734355146021160 00000000000000/* * Copyright 1999-2009 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_gram_job_manager.h" #include "globus_gsi_system_config.h" #include "globus_callout.h" #include "globus_callout_constants.h" #include "globus_gram_jobmanager_callout_error.h" #include #include static void globus_l_gram_job_manager_proxy_expiration( void * callback_arg); static int globus_l_gram_job_manager_gsi_register_proxy_timeout( globus_gram_job_manager_t * manager, globus_reltime_t * timeout, globus_callback_handle_t * callback_handle); int globus_gram_job_manager_import_sec_context( globus_gram_job_manager_t * manager, int context_fd, gss_ctx_id_t * response_contextp) { OM_uint32 major_status; OM_uint32 minor_status; int token_status; gss_name_t globus_id = NULL; gss_buffer_desc globus_id_token = { 0, NULL }; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.import_sec_context.start level=TRACE fd=%d\n", context_fd); major_status = globus_gss_assist_import_sec_context( &minor_status, response_contextp, &token_status, context_fd, NULL /*manager->jobmanager_log_fp*/); if (GSS_ERROR(major_status)) { char * error_string = NULL; char * escaped_error_string; globus_gss_assist_display_status_str( &error_string, "", major_status, minor_status, 0); escaped_error_string = globus_gram_prepare_log_string(error_string); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.import_sec_context.end level=ERROR status=%d " "major_status=%d msg=\"Failed to load security context\" " "reason=\"%s\"\n", -GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED, major_status, escaped_error_string ? escaped_error_string : ""); if (error_string) { free(error_string); } if (escaped_error_string) { free(escaped_error_string); } return GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED; } if (manager && manager->config->log_levels & GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE) { do { major_status = gss_inquire_context( &minor_status, *response_contextp, &globus_id, NULL, NULL, NULL, NULL, NULL, NULL); } while (major_status == GSS_S_CONTINUE_NEEDED); if (major_status == GSS_S_COMPLETE) { do { major_status = gss_display_name( &minor_status, globus_id, &globus_id_token, NULL); } while (major_status == GSS_S_CONTINUE_NEEDED); } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.import_sec_context.end " "level=TRACE " "status=%d " "globusid=\"%s\" " "\n", 0, globus_id_token.value != NULL ? globus_id_token.value : ""); gss_release_buffer( &minor_status, &globus_id_token); gss_release_name( &minor_status, &globus_id); } return GLOBUS_SUCCESS; } /* globus_gram_job_manager_import_sec_context() */ /** * Check to see if we are using GSI. * * Checks the GSSAPI implementation mechanisms to decide if we * are using the GSI implementation of the GSSAPI specification. * If so, we can do some nice tricks like relocation of a user proxy * into the user's GASS cache. * * @param request * The request we are processing. Used for logging. * * @return This function returns GLOBUS_TRUE if the job manager is * using GSI, GLOBUS_FALSE otherwise. */ globus_bool_t globus_gram_job_manager_gsi_used( globus_gram_jobmanager_request_t * request) { OM_uint32 major_status; OM_uint32 minor_status; /* * define the Globus object ids * This is regestered as a private enterprise * via IANA * http://www.isi.edu/in-notes/iana/assignments/enterprise-numbers * * iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) * globus 3536 * security 1 * gssapi_ssleay 1 */ gss_OID_desc gsi_mech = {9, "\x2b\x06\x01\x04\x01\x9b\x50\x01\x01"}; gss_OID_set mechs; int present = 0; /* * Figure out if we're using GSI */ major_status = gss_indicate_mechs( &minor_status, &mechs); if(major_status == GSS_S_COMPLETE) { major_status = gss_test_oid_set_member( &minor_status, &gsi_mech, mechs, &present); if(major_status != GSS_S_COMPLETE) { present = 0; } gss_release_oid_set(&minor_status, &mechs); } return (present ? GLOBUS_TRUE : GLOBUS_FALSE); } /* globus_l_gram_job_manager_gsi_used() */ /** * Register timeout to occur when the job manager's proxy is set to expire * * @param manager * Job manager state (for logging) * @param cred * Job manager credential * @param timeout * Time (in seconds) to stop the manager if no credential is available. * @param callback_handle * Pointer to be set to the handle to the expiration callback. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_EXPIRED * User proxy expired * @retval GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES * No resources for callback * @retval GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_NOT_FOUND * Proxy not found */ int globus_gram_job_manager_gsi_register_proxy_timeout( globus_gram_job_manager_t * manager, gss_cred_id_t cred, int timeout, globus_callback_handle_t * callback_handle) { int rc = GLOBUS_SUCCESS; globus_reltime_t delay; OM_uint32 major_status; OM_uint32 minor_status; OM_uint32 lifetime; time_t cred_expiration_time; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.register_proxy_timeout.start " "level=TRACE " "\n"); *callback_handle = GLOBUS_NULL_HANDLE; cred_expiration_time = time(NULL); major_status = gss_inquire_cred( &minor_status, cred, NULL, &lifetime, NULL, NULL); if (major_status != GSS_S_COMPLETE) { char * error_string = NULL; rc = GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_NOT_FOUND; globus_gss_assist_display_status_str( &error_string, "", major_status, minor_status, 0); globus_gram_prepare_log_string(error_string); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.register_proxy_timeout.end " "level=ERROR " "status=%d " "msg=\"%s\" " "major_status=%d " "reason=\"%s\"\n", -rc, "gss_inquire_cred failed", major_status, error_string ? error_string : ""); if (error_string) { free(error_string); } goto failed_inquire_cred; } if (lifetime == GSS_C_INDEFINITE) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.register_proxy_timeout.end " "level=TRACE " "status=%d " "lifetime=indefinite " "msg=\"%s\" " "\n", "User proxy has indefinite lifetime"); goto wont_expire; } cred_expiration_time += (time_t) lifetime; if (((long) lifetime - timeout) <= 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_EXPIRED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.register_proxy_timeout.end " "level=ERROR " "status=%d " "lifetime=%d " "msg=\"user proxy lifetime is less than minimum " "(%d seconds)\" " "reason=\"%s\" " "\n", (int) -rc, lifetime, timeout, globus_gram_protocol_error_string(rc)); goto proxy_expired; } GlobusTimeReltimeSet(delay, lifetime - timeout, 0); manager->cred_expiration_time = cred_expiration_time; rc = globus_l_gram_job_manager_gsi_register_proxy_timeout( manager, &delay, callback_handle); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.register_proxy_timeout.end " "level=ERROR " "status=%d " "lifetime=%d " "msg=\"Error registering proxy timeout callback\" " "reason=\"%s\" " "\n", (int) -rc, lifetime, globus_gram_protocol_error_string(rc)); } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.register_proxy_timeout.end " "level=TRACE " "status=%d " "lifetime=%d " "timeout=%d " "\n", (int) -rc, lifetime, timeout); } proxy_expired: wont_expire: failed_inquire_cred: return rc; } /* globus_gram_job_manager_gsi_register_proxy_timeout() */ /** * Look up subject name from the process's credential. * * @param subject_namep * Pointer to set to a copy of the subject name. The caller is responsible * for freeing this string. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_NOT_FOUND * Proxy not found. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. */ int globus_gram_job_manager_gsi_get_subject( char ** subject_namep) { OM_uint32 major_status; OM_uint32 minor_status; int rc = GLOBUS_SUCCESS; gss_name_t name; gss_buffer_desc export_name; char * subject_name = NULL; export_name.value = NULL; export_name.length = 0; globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram_gsi_get_subject.start " "level=TRACE \n"); major_status = gss_inquire_cred( &minor_status, GSS_C_NO_CREDENTIAL, &name, NULL, NULL, NULL); if (major_status != GSS_S_COMPLETE) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_NOT_FOUND; goto failed_inquire_cred; } major_status = gss_display_name( &minor_status, name, &export_name, NULL); if (major_status != GSS_S_COMPLETE) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_display_name; } subject_name = strdup(export_name.value); if (subject_name == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_subject_name_copy; } failed_subject_name_copy: gss_release_buffer(&minor_status, &export_name); failed_display_name: major_status = gss_release_name( &minor_status, &name); failed_inquire_cred: *subject_namep = subject_name; if (rc != GLOBUS_SUCCESS) { char *errmsg = NULL, *errmsg_escaped = NULL; if (major_status != GSS_S_COMPLETE) { globus_gss_assist_display_status_str( &errmsg, "Error getting subject", major_status, minor_status, 0); errmsg_escaped = globus_gram_prepare_log_string(errmsg); } globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram_gsi_get_subject.end " "level=ERROR " "status=%d " "reason=\"%s\" " "\n", -rc, errmsg_escaped ? errmsg_escaped : globus_gram_protocol_error_string(rc)); if (errmsg) { free(errmsg); } if (errmsg_escaped) { free(errmsg_escaped); } } return rc; } /* globus_gram_job_manager_gsi_get_subject() */ /** * Register timeout to occur when the job manager's proxy is set to expire * * @param manager * Job manager state (for logging) * @param timeout * Relative time to delay before firing the proxy timeout * @param callback_handle * Pointer to the expiration callback handle. If this points to * GLOBUS_NULL_HANDLE, then a new callback will be created and this will * be modified to point to it. Otherwise, the callback handle will be * modified. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_EXPIRED * User proxy expired * @retval GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES * No resources for callback * @retval GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_NOT_FOUND * Proxy not found */ static int globus_l_gram_job_manager_gsi_register_proxy_timeout( globus_gram_job_manager_t * manager, globus_reltime_t * timeout, globus_callback_handle_t * callback_handle) { int rc = GLOBUS_SUCCESS; globus_result_t result; if (*callback_handle == GLOBUS_NULL_HANDLE) { result = globus_callback_register_oneshot( callback_handle, timeout, globus_l_gram_job_manager_proxy_expiration, manager); } else { result = globus_callback_adjust_oneshot( *callback_handle, timeout); } if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } return rc; } /* globus_l_gram_job_manager_gsi_register_proxy_timeout() */ /** * Update the request with a new security credential. * * If the new credential will live longer than the current Job Manager-wide * credential, use the new one with the GRAM protocol library, write it to the * state directory, and update the proxy timeout. * * If the request is non-null, update the proxy on disk in the job directory so * this particular job will have a copy of this credential. * * The credential is either destroyed or passed to the GRAM Protocol library, * which will destroy it when no longer needed. The caller must not free * the credential. * * @param request * Job request to update with this credential * @param credential * New GSSAPI credential. */ int globus_gram_job_manager_gsi_update_credential( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, gss_cred_id_t credential) { OM_uint32 major_status; OM_uint32 minor_status; OM_uint32 lifetime; time_t credential_expiration_time; int rc = GLOBUS_SUCCESS; globus_reltime_t delay_time; globus_bool_t set_credential = GLOBUS_FALSE; credential_expiration_time = time(NULL); major_status = gss_inquire_cred( &minor_status, credential, NULL, &lifetime, NULL, NULL); if (GSS_ERROR(major_status)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; goto inquire_cred_failed; } if (lifetime != GSS_C_INDEFINITE) { credential_expiration_time += lifetime; } else { credential_expiration_time = 0; } if (manager->cred_expiration_time != 0 && (lifetime == GSS_C_INDEFINITE || credential_expiration_time > manager->cred_expiration_time)) { manager->cred_expiration_time = credential_expiration_time; rc = globus_gram_job_manager_gsi_write_credential( request, credential, manager->cred_path); if (rc != 0) { goto write_manager_cred_failed; } set_credential = GLOBUS_TRUE; manager->stop = GLOBUS_FALSE; } if (request) { rc = globus_gram_job_manager_gsi_write_credential( request, credential, request->x509_user_proxy); if (rc != 0) { goto write_job_cred_failed; } } if (set_credential) { GlobusTimeReltimeSet( delay_time, lifetime - manager->config->proxy_timeout, 0); rc = globus_l_gram_job_manager_gsi_register_proxy_timeout( manager, &delay_time, &manager->proxy_expiration_timer); if (rc != GLOBUS_SUCCESS) { goto register_timeout_failed; } rc = globus_gram_protocol_set_credentials(credential); credential = GSS_C_NO_CREDENTIAL; if (rc != GLOBUS_SUCCESS) { goto set_credentials_failed; } } set_credentials_failed: register_timeout_failed: write_job_cred_failed: write_manager_cred_failed: inquire_cred_failed: if (credential != GSS_C_NO_CREDENTIAL) { gss_release_cred(&minor_status, &credential); } return rc; } /* globus_gram_job_manager_gsi_update_credential() */ /* Write a GSSAPI credential to a given path * @param credential * Credential to write * @param path * Path to write to * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY * Error opening path */ int globus_gram_job_manager_gsi_write_credential( globus_gram_jobmanager_request_t * request, gss_cred_id_t credential, const char * path) { OM_uint32 major_status; OM_uint32 minor_status; gss_buffer_desc credential_buffer; int rc; int fd; char * gt3_error_message = NULL; int written; int save_errno; major_status = gss_export_cred(&minor_status, credential, GSS_C_NO_OID, 0, &credential_buffer); if(GSS_ERROR(major_status)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; (void) globus_gss_assist_display_status_str( >3_error_message, "credential export failed", major_status, minor_status, 0); goto export_failed; } fd = open( path, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); if(fd == -1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; save_errno = errno; gt3_error_message = globus_common_create_string( "open credential file for writing failed: %s: %s (%d)", path, strerror(save_errno), save_errno); goto job_proxy_open_failed; } written = 0; do { rc = write( fd, ((char *) credential_buffer.value) + written, (size_t) credential_buffer.length - written); if(rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE_USER_PROXY; save_errno = errno; gt3_error_message = globus_common_create_string( "writing credential file failed: %s: %s (%d)", path, strerror(save_errno), save_errno); goto job_proxy_write_failed; } else if (rc == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE_USER_PROXY; gt3_error_message = globus_common_create_string( "writing credential file failed: %s: %s", path, "short write"); goto job_proxy_write_failed; } else { written += rc; } } while (written < credential_buffer.length); rc = close(fd); if (rc != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE_USER_PROXY; save_errno = errno; gt3_error_message = globus_common_create_string( "writing credential file failed: %s: %s (%d)", path, strerror(save_errno), save_errno); goto job_proxy_close_failed; } rc = 0; fd = -1; job_proxy_write_failed: if(fd != -1) { close(fd); fd = -1; } job_proxy_close_failed: job_proxy_open_failed: (void) gss_release_buffer(&minor_status, &credential_buffer); export_failed: if (request != NULL && request->gt3_failure_message == NULL) { request->gt3_failure_message = gt3_error_message; } else if (gt3_error_message) { free(gt3_error_message); } return rc; } /* globus_gram_job_manager_gsi_write_credential() */ static void globus_l_gram_job_manager_proxy_expiration( void * callback_arg) { globus_gram_job_manager_t * manager; manager = callback_arg; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.proxy_expire.end level=WARN " "msg=\"Proxy expired, stopping job manager\"\n"); globus_gram_job_manager_stop_all_jobs(manager); } /* globus_l_gram_job_manager_proxy_expiration() */ int globus_gram_job_manager_call_authz_callout( globus_gram_job_manager_config_t * config, gss_ctx_id_t request_context, gss_ctx_id_t authz_context, const char * uniq_id, const globus_rsl_t * rsl, const char * auth_type) { int rc = GLOBUS_SUCCESS; globus_result_t result; globus_object_t * error; char * filename; globus_callout_handle_t authz_handle; if (! config->enable_callout) { return GLOBUS_SUCCESS; } result = GLOBUS_GSI_SYSCONFIG_GET_AUTHZ_CONF_FILENAME(&filename); if(result != GLOBUS_SUCCESS) { error = globus_error_peek(result); if(! globus_error_match( error, GLOBUS_GSI_SYSCONFIG_MODULE, GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_FILENAME)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION_SYSTEM_FAILURE; } goto conf_filename_failed; } result = globus_callout_handle_init(&authz_handle); if(result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION_SYSTEM_FAILURE; goto handle_init_failed; } result = globus_callout_read_config(authz_handle, filename); if(result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION_SYSTEM_FAILURE; goto read_config_failed; } result = globus_callout_call_type(authz_handle, GLOBUS_GRAM_AUTHZ_CALLOUT_TYPE, request_context, authz_context, uniq_id, rsl, auth_type); if(result != GLOBUS_SUCCESS) { error = globus_error_peek(result); if (globus_error_match( error, GLOBUS_CALLOUT_MODULE, GLOBUS_CALLOUT_ERROR_TYPE_NOT_REGISTERED)) { /* For queries, check authz self by default. The start case * is handled by the gatekeeper. */ if (strcmp(auth_type, "start") != 0) { if (globus_gram_protocol_authorize_self(authz_context)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION_DENIED; } } } else if (globus_error_match( error, GLOBUS_GRAM_JOBMANAGER_CALLOUT_ERROR_MODULE, GLOBUS_GRAM_JOBMANAGER_CALLOUT_AUTHZ_DENIED)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION_DENIED; } else if (globus_error_match( error, GLOBUS_GRAM_JOBMANAGER_CALLOUT_ERROR_MODULE, GLOBUS_GRAM_JOBMANAGER_CALLOUT_AUTHZ_DENIED_INVALID_JOB)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION_DENIED_JOB_ID; } else if (globus_error_match( error, GLOBUS_GRAM_JOBMANAGER_CALLOUT_ERROR_MODULE, GLOBUS_GRAM_JOBMANAGER_CALLOUT_AUTHZ_DENIED_BAD_EXECUTABLE)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION_DENIED_EXECUTABLE; } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION_SYSTEM_FAILURE; } } read_config_failed: globus_callout_handle_destroy(authz_handle); handle_init_failed: free(filename); conf_filename_failed: return rc; } /* globus_gram_job_manager_call_authz_callout() */ int globus_gram_job_manager_authz_query( globus_gram_job_manager_t * manager, globus_gram_protocol_handle_t handle, const char * uri, const char * auth_type) { int rc = GLOBUS_SUCCESS; gss_ctx_id_t context; globus_gram_jobmanager_request_t * request; if (! manager->config->enable_callout) { goto skip_authz; } if ((rc = globus_gram_protocol_get_sec_context( handle, &context)) != GLOBUS_SUCCESS) { goto get_sec_context_failed; } rc = globus_gram_job_manager_add_reference( manager, uri, "query authz", &request); if (rc != GLOBUS_SUCCESS) { goto add_reference_failed; } rc = globus_gram_job_manager_call_authz_callout( request->config, request->response_context, context, request->uniq_id, request->rsl, auth_type); if (rc != GLOBUS_SUCCESS) { goto authz_failed; } authz_failed: globus_gram_job_manager_remove_reference( manager, request->job_contact_path, "query authz"); add_reference_failed: get_sec_context_failed: skip_authz: return rc; } /* globus_gram_job_manager_authz_query() */ /** * @brief Look up the identity of a GSSAPI credential and generate a hash * @ingroup globus_gram_gsi * * @details * The globus_gram_gsi_get_dn_hash() function inspects the credential * named by @a cred parameter to determine the identity of the credential. * It then computes the default hash on that name and assigns a copy of * that value to the @a hash parameter. The caller is responsible for freeing * that value. * * @param cred * GSSAPI credential to inspect * @param hash * Pointer to be set to the hash of the identity of @a cred. * * @return * On success, globus_gram_gsi_get_dn_hash() returns GLOBUS_SUCCESS * and modifies the @a hash parameter to point to a copy of the string * representation of the hash. If an error occurs, * globus_gram_gsi_get_dn_hash() returns a non-zero error code and the * the value of @a hash is undefined. */ int globus_gram_gsi_get_dn_hash( gss_cred_id_t cred, unsigned long * hash) { int rc = GLOBUS_SUCCESS; OM_uint32 major, minor; gss_name_t name; gss_buffer_desc namebuf; unsigned char md[EVP_MAX_MD_SIZE+1]; const EVP_MD * evp_md; EVP_MD_CTX evp_ctx; unsigned int mdlen; unsigned long hash_value; if (hash == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NULL_PARAMETER; goto out; } *hash = 0L; if (cred == GSS_C_NO_CREDENTIAL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_NOT_FOUND; goto out; } major = gss_inquire_cred( &minor, cred, &name, NULL, NULL, NULL); if (major != GSS_S_COMPLETE) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_NOT_FOUND; goto out; } major = gss_display_name( &minor, name, &namebuf, NULL); if (major != GSS_S_COMPLETE) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_NOT_FOUND; goto free_name_out; } evp_md = EVP_get_digestbyname("sha1"); if (evp_md == NULL) { evp_md = EVP_get_digestbyname("md5"); } if (evp_md == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto free_namebuf_out; } EVP_MD_CTX_init(&evp_ctx); if (EVP_DigestInit_ex(&evp_ctx, evp_md, NULL) != 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto free_namebuf_out; } if (EVP_DigestUpdate(&evp_ctx, namebuf.value, namebuf.length) != 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto free_digest_out; } if (EVP_DigestFinal_ex(&evp_ctx, md, &mdlen) != 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto free_digest_out; } hash_value = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) | ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L)) & 0xffffffffL; *hash = hash_value; free_digest_out: EVP_MD_CTX_cleanup(&evp_ctx); free_namebuf_out: gss_release_buffer(&minor, &namebuf); free_name_out: gss_release_name(&minor, &name); out: return rc; } /* globus_gram_gsi_get_dn_hash() */ globus_gram_job_manager-13.53/rsl.50000666000076400007640000002634411735076151014214 00000000000000'\" t .\" Title: rsl .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 03/29/2012 .\" Manual: GRAM5 Commands .\" Source: University of Chicago .\" Language: English .\" .TH "RSL" "5" "03/29/2012" "University of Chicago" "GRAM5 Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" rsl \- GRAM5 RSL Attributes .SH "DESCRIPTION" .PP .PP arguments .RS 4 The command line arguments for the executable\&. Use quotes, if a space is required in a single argument\&. .RE .PP count .RS 4 The number of executions of the executable\&. [Default: 1] .RE .PP directory .RS 4 Specifies the path of the directory the jobmanager will use as the default directory for the requested job\&. [Default: $(HOME)] .RE .PP dry_run .RS 4 If dryrun = yes then the jobmanager will not submit the job for execution and will return success\&. [Default: no] .RE .PP environment .RS 4 The environment variables that will be defined for the executable in addition to default set that is given to the job by the jobmanager\&. .RE .PP executable .RS 4 The name of the executable file to run on the remote machine\&. If the value is a GASS URL, the file is transferred to the remote gass cache before executing the job and removed after the job has terminated\&. .RE .PP expiration .RS 4 Time (in seconds) after a a job fails to receive a two\-phase commit end signal before it is cleaned up\&. [Default: 14400] .RE .PP file_clean_up .RS 4 Specifies a list of files which will be removed after the job is completed\&. .RE .PP file_stage_in .RS 4 Specifies a list of ("remote URL" "local file") pairs which indicate files to be staged to the nodes which will run the job\&. .RE .PP file_stage_in_shared .RS 4 Specifies a list of ("remote URL" "local file") pairs which indicate files to be staged into the cache\&. A symlink from the cache to the "local file" path will be made\&. .RE .PP file_stage_out .RS 4 Specifies a list of ("local file" "remote URL") pairs which indicate files to be staged from the job to a GASS\-compatible file server\&. .RE .PP gass_cache .RS 4 Specifies location to override the GASS cache location\&. .RE .PP gram_my_job .RS 4 Obsolete and ignored\&. [Default: collective] .RE .PP host_count .RS 4 Only applies to clusters of SMP computers, such as newer IBM SP systems\&. Defines the number of nodes ("pizza boxes") to distribute the "count" processes across\&. .RE .PP job_type .RS 4 This specifies how the jobmanager should start the job\&. Possible values are single (even if the count > 1, only start 1 process or thread), multiple (start count processes or threads), mpi (use the appropriate method (e\&.g\&. mpirun) to start a program compiled with a vendor\-provided MPI library\&. Program is started with count nodes), and condor (starts condor jobs in the "condor" universe\&.) [Default: multiple] .RE .PP library_path .RS 4 Specifies a list of paths to be appended to the system\-specific library path environment variables\&. [Default: $(GLOBUS_LOCATION)/lib] .RE .PP loglevel .RS 4 Override the default log level for this job\&. The value of this attribute consists of a combination of the strings FATAL, ERROR, WARN, INFO, DEBUG, TRACE joined by the | character .RE .PP logpattern .RS 4 Override the default log path pattern for this job\&. The value of this attribute is a string (potentially containing RSL substitutions) that is evaluated to the path to write the log to\&. If the resulting string contains the string $(DATE) (or any other RSL substitution), it will be reevaluated at log time\&. .RE .PP max_cpu_time .RS 4 Explicitly set the maximum cputime for a single execution of the executable\&. The units is in minutes\&. The value will go through an atoi() conversion in order to get an integer\&. If the GRAM scheduler cannot set cputime, then an error will be returned\&. .RE .PP max_memory .RS 4 Explicitly set the maximum amount of memory for a single execution of the executable\&. The units is in Megabytes\&. The value will go through an atoi() conversion in order to get an integer\&. If the GRAM scheduler cannot set maxMemory, then an error will be returned\&. .RE .PP max_time .RS 4 The maximum walltime or cputime for a single execution of the executable\&. Walltime or cputime is selected by the GRAM scheduler being interfaced\&. The units is in minutes\&. The value will go through an atoi() conversion in order to get an integer\&. .RE .PP max_wall_time .RS 4 Explicitly set the maximum walltime for a single execution of the executable\&. The units is in minutes\&. The value will go through an atoi() conversion in order to get an integer\&. If the GRAM scheduler cannot set walltime, then an error will be returned\&. .RE .PP min_memory .RS 4 Explicitly set the minimum amount of memory for a single execution of the executable\&. The units is in Megabytes\&. The value will go through an atoi() conversion in order to get an integer\&. If the GRAM scheduler cannot set minMemory, then an error will be returned\&. .RE .PP project .RS 4 Target the job to be allocated to a project account as defined by the scheduler at the defined (remote) resource\&. .RE .PP proxy_timeout .RS 4 Obsolete and ignored\&. Now a job\-manager\-wide setting\&. .RE .PP queue .RS 4 Target the job to a queue (class) name as defined by the scheduler at the defined (remote) resource\&. .RE .PP remote_io_url .RS 4 Writes the given value (a URL base string) to a file, and adds the path to that file to the environment throught the GLOBUS_REMOTE_IO_URL environment variable\&. If this is specified as part of a job restart RSL, the job manager will update the file\*(Aqs contents\&. This is intended for jobs that want to access files via GASS, but the URL of the GASS server has changed due to a GASS server restart\&. .RE .PP restart .RS 4 Start a new job manager, but instead of submitting a new job, start managing an existing job\&. The job manager will search for the job state file created by the original job manager\&. If it finds the file and successfully reads it, it will become the new manager of the job, sending callbacks on status and streaming stdout/err if appropriate\&. It will fail if it detects that the old jobmanager is still alive (via a timestamp in the state file)\&. If stdout or stderr was being streamed over the network, new stdout and stderr attributes can be specified in the restart RSL and the jobmanager will stream to the new locations (useful when output is going to a GASS server started by the client that\*(Aqs listening on a dynamic port, and the client was restarted)\&. The new job manager will return a new contact string that should be used to communicate with it\&. If a jobmanager is restarted multiple times, any of the previous contact strings can be given for the restart attribute\&. .RE .PP rsl_substitution .RS 4 Specifies a list of values which can be substituted into other rsl attributes\*(Aq values through the $(SUBSTITUTION) mechanism\&. .RE .PP save_state .RS 4 Causes the jobmanager to save it\*(Aqs job state information to a persistent file on disk\&. If the job manager exits or is suspended, the client can later start up a new job manager which can continue monitoring the job\&. .RE .PP savejobdescription .RS 4 Save a copy of the job description to $HOME [Default: no] .RE .PP scratch_dir .RS 4 Specifies the location to create a scratch subdirectory in\&. A SCRATCH_DIRECTORY RSL substitution will be filled with the name of the directory which is created\&. .RE .PP stderr .RS 4 The name of the remote file to store the standard error from the job\&. If the value is a GASS URL, the standard error from the job is transferred dynamically during the execution of the job\&. There are two accepted forms of this value\&. It can consist of a single destination: stderr = URL, or a sequence of destinations: stderr = (DESTINATION) (DESTINATION)\&. In the latter case, the DESTINATION may itself be a URL or a sequence of an x\-gass\-cache URL followed by a cache tag\&. [Default: /dev/null] .RE .PP stderr_position .RS 4 Specifies where in the file remote standard error streaming should be restarted from\&. Must be 0\&. .RE .PP stdin .RS 4 The name of the file to be used as standard input for the executable on the remote machine\&. If the value is a GASS URL, the file is transferred to the remote gass cache before executing the job and removed after the job has terminated\&. [Default: /dev/null] .RE .PP stdout .RS 4 The name of the remote file to store the standard output from the job\&. If the value is a GASS URL, the standard output from the job is transferred dynamically during the execution of the job\&. There are two accepted forms of this value\&. It can consist of a single destination: stdout = URL, or a sequence of destinations: stdout = (DESTINATION) (DESTINATION)\&. In the latter case, the DESTINATION may itself be a URL or a sequence of an x\-gass\-cache URL followed by a cache tag\&. [Default: /dev/null] .RE .PP stdout_position .RS 4 Specifies where in the file remote output streaming should be restarted from\&. Must be 0\&. .RE .PP two_phase .RS 4 Use a two\-phase commit for job submission and completion\&. The job manager will respond to the initial job request with a WAITING_FOR_COMMIT error\&. It will then wait for a signal from the client before doing the actual job submission\&. The integer supplied is the number of seconds the job manager should wait before timing out\&. If the job manager times out before receiving the commit signal, or if a client issues a cancel signal, the job manager will clean up the job\*(Aqs files and exit, sending a callback with the job status as GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED\&. After the job manager sends a DONE or FAILED callback, it will wait for a commit signal from the client\&. If it receives one, it cleans up and exits as usual\&. If it times out and save_state was enabled, it will leave all of the job\*(Aqs files in place and exit (assuming the client is down and will attempt a job restart later)\&. The timeoutvalue can be extended via a signal\&. When one of the following errors occurs, the job manager does not delete the job state file when it exits: GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT, GLOBUS_GRAM_PROTOCOL_ERROR_TTL_EXPIRED, GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED, GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_EXPIRED\&. In these cases, it can not be restarted, so the job manager will not wait for the commit signal after sending the FAILED callback .RE .PP username .RS 4 Verify that the job is running as this user\&. .RE globus_gram_job_manager-13.53/config.guess0000755000076400007640000012206511312032604015621 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-06-17' # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 ;' # 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 ## for Red Hat Linux if test -f /etc/redhat-release ; then VENDOR=redhat ; else VENDOR= ; fi # 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 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # 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 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/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; 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 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; 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 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; 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 0 ;; 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 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; 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 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # 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 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; 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 \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; 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 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????: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 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; 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 0 ;; *: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 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 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 0 ;; *: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 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 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 # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 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 && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; 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 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; 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 0 ;; 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 0 ;; ppc:Linux:*:*) echo powerpc-${VENDOR:-unknown}-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-${VENDOR:-unknown}-linux-gnu exit 0 ;; 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 0 ;; 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 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-${VENDOR:-unknown}-linux-gnu exit 0 ;; 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 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # 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 0 ;; 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 EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; 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 0 ;; 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 0 ;; 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 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; 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 0 ;; i*86:*:5:[78]*) 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 0 ;; 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 0 ;; 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 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; 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 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*: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) 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 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *: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 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; 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 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; 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"); 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 && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # 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 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; 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_gram_job_manager-13.53/globus_gram_job_manager_contact.c0000666000076400007640000014060111734355146022026 00000000000000/* * Copyright 1999-2009 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_gram_job_manager.h" #include "version.h" #include typedef struct globus_gram_job_manager_contact_s { char * contact; int job_state_mask; int failed_count; } globus_gram_job_manager_contact_t; typedef struct globus_gram_job_callback_context_s { globus_gram_jobmanager_request_t * request; globus_list_t * contacts; unsigned char * message; globus_size_t message_length; int active; globus_bool_t restart_state_when_done; } globus_gram_job_callback_context_t; static int globus_l_gram_callback_queue( globus_gram_job_manager_t * manager, globus_gram_job_callback_context_t *context); static void globus_l_gram_callback_reply( void * arg, globus_gram_protocol_handle_t handle, globus_byte_t * message, globus_size_t msgsize, int errorcode, char * uri); /** * Add a callback contact to the request's list. * * @param request * The request to modify * @param contact * The callback contact URL string. * @param job_state_mask * The job state mask for this callback contact. * * @retval GLOBUS_SUCCESS * The callback contact was successfully added to the * request. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INSERTING_CONTACT * The callback contact failed to be inserted into the * request. */ int globus_gram_job_manager_contact_add( globus_gram_jobmanager_request_t * request, const char * contact, int job_state_mask) { globus_gram_job_manager_contact_t * callback; int rc = GLOBUS_SUCCESS; globus_list_t * tmp_list; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.callback_register.start " "level=TRACE " "gramid=%s " "contact=%s " "mask=%d " "\n", request->job_contact_path, contact, job_state_mask); /* * If the contact is already registered, update the job_state_mask * to be the set of states in the old or new job state masks. * This means that if a contact is registered multiple times, it will * receive only one callback for each job state change that it is * registered for. */ tmp_list = request->client_contacts; while(!globus_list_empty(tmp_list)) { callback = globus_list_first(tmp_list); if(strcmp(contact, callback->contact) == 0) { callback->job_state_mask |= job_state_mask; goto done; } tmp_list = globus_list_rest(tmp_list); } callback = malloc(sizeof(globus_gram_job_manager_contact_t)); if(callback == NULL) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback_register.end " "level=ERROR " "gramid=%s " "contact=%s " "mask=%d " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, contact, job_state_mask, "Malloc failed", -GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED, errno, strerror(errno)); goto error_exit; } callback->contact = strdup(contact); if(callback->contact == NULL) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback_register.end " "level=ERROR " "gramid=%s " "contact=%s " "mask=%d " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, contact, job_state_mask, "Malloc failed", -GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED, errno, strerror(errno)); goto strdup_contact_failed; } callback->job_state_mask = job_state_mask; callback->failed_count = 0; rc = globus_list_insert(&request->client_contacts, (void *) callback); if(rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback_register.end " "level=ERROR " "gramid=%s " "contact=%s " "mask=%d " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, contact, job_state_mask, "List insert failed", strerror(errno), -GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED); goto list_insert_failed; } done: globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.callback_register.end " "level=TRACE " "gramid=%s " "contact=%s " "mask=%d " "status=%d\n", request->job_contact_path, contact, job_state_mask, 0); return rc; list_insert_failed: free(callback->contact); strdup_contact_failed: free(callback); error_exit: return GLOBUS_GRAM_PROTOCOL_ERROR_INSERTING_CLIENT_CONTACT; } /* globus_gram_job_manager_contact_add() */ int globus_gram_job_manager_contact_remove( globus_gram_jobmanager_request_t * request, const char * contact) { globus_list_t * tmp_list; int rc; globus_gram_job_manager_contact_t * client_contact_node; rc = GLOBUS_GRAM_PROTOCOL_ERROR_CLIENT_CONTACT_NOT_FOUND; tmp_list = request->client_contacts; while(!globus_list_empty(tmp_list)) { client_contact_node = globus_list_first(tmp_list); if(strcmp(contact, client_contact_node->contact) == 0) { globus_list_remove(&request->client_contacts, tmp_list); free(client_contact_node->contact); free(client_contact_node); rc = GLOBUS_SUCCESS; break; } tmp_list = globus_list_rest(tmp_list); } return rc; } /* globus_gram_job_manager_contact_remove() */ int globus_gram_job_manager_contact_list_free( globus_gram_jobmanager_request_t * request) { globus_gram_job_manager_contact_t * client_contact_node; while(!globus_list_empty(request->client_contacts)) { client_contact_node = globus_list_remove( &request->client_contacts, request->client_contacts); free (client_contact_node->contact); free (client_contact_node); } return GLOBUS_SUCCESS; } /* globus_gram_job_manager_contact_list_free() */ /** * @brief Send a job state callback to registered clients * @details * Start processing a job state callback for the given request, sending * its current job state to all clients which are registered with a * mask that includes the current state. If the * @a restart_state_machine_when_done parameter is GLOBUS_TRUE, then * the state machine will be reregistered after the callback has been * sent and its reply parsed. Otherwise, the state machine is assumed * to not care about when this completes. * * @param request * Job request to send state changes about * @param restart_state_machine_when_done * Flag indicating whether to restart the state machine when complete */ void globus_gram_job_manager_contact_state_callback( globus_gram_jobmanager_request_t * request, globus_bool_t restart_state_machine_when_done) { int rc; globus_list_t * tmp_list; globus_gram_job_manager_contact_t * client_contact_node; globus_hashtable_t extensions = NULL; globus_gram_protocol_extension_t * entry = NULL; globus_gram_protocol_job_state_t state; state = (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) ? GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED : request->status; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.callback.start " "level=DEBUG " "gramid=%s " "state=%d " "restart_when_done=%s " "\n", request->job_contact_path, state, restart_state_machine_when_done ? "true" : "false"); globus_gram_job_callback_context_t *context = NULL; tmp_list = request->client_contacts; if (globus_list_empty(tmp_list)) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.callback.end " "level=DEBUG " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "\n", request->job_contact_path, state, 0, "Empty callback contact list"); if (restart_state_machine_when_done) { globus_reltime_t delay; GlobusTimeReltimeSet(delay, request->two_phase_commit, 0); rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay); } return; } context = malloc(sizeof(globus_gram_job_callback_context_t)); if (context == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Malloc failed", errno, strerror(errno)); goto context_malloc_failed; } rc = globus_gram_job_manager_add_reference( request->manager, request->job_contact_path, "Job state callbacks", &context->request); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, state, -rc, "Add reference failed", globus_gram_protocol_error_string(rc)); goto add_reference_failed; } context->contacts = NULL; context->message = NULL; context->message_length = 0; context->active = 0; context->restart_state_when_done = restart_state_machine_when_done; rc = globus_hashtable_init( &extensions, 7, globus_hashtable_string_hash, globus_hashtable_string_keyeq); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, state, -rc, "Hashtable init failed", globus_gram_protocol_error_string(rc)); goto fail_extensions_init; } /* Create message extensions to send exit code if known */ if (request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE && (request->config->seg_module != NULL || strcmp(request->config->jobmanager_type, "condor") == 0)) { entry = globus_gram_protocol_create_extension( "exit-code", "%d", request->exit_code); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, state, -rc, "Message extension initialization failed", globus_gram_protocol_error_string(rc)); goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, state, -rc, "Message extension hashtable insert failed", globus_gram_protocol_error_string(rc)); goto fail_entry_insert; } } else if (request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED) { if (request->gt3_failure_type != NULL) { entry = globus_gram_protocol_create_extension( "gt3-failure-type", "%s", request->gt3_failure_type); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension initialization failed", globus_gram_protocol_error_string(rc)); goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension hashtable insert failed", globus_gram_protocol_error_string(rc)); goto fail_entry_insert; } } if (request->gt3_failure_message != NULL) { entry = globus_gram_protocol_create_extension( "gt3-failure-message", "%s", request->gt3_failure_message); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension initialization failed", globus_gram_protocol_error_string(rc)); goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension hashtable insert failed", globus_gram_protocol_error_string(rc)); goto fail_entry_insert; } } if (request->gt3_failure_source != NULL) { entry = globus_gram_protocol_create_extension( "gt3-failure-source", "%s", request->gt3_failure_source); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension hashtable insert failed", globus_gram_protocol_error_string(rc)); goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension hashtable insert failed", globus_gram_protocol_error_string(rc)); goto fail_entry_insert; } } if (request->gt3_failure_destination != NULL) { entry = globus_gram_protocol_create_extension( "gt3-failure-destination", "%s", request->gt3_failure_destination); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension initialization failed", globus_gram_protocol_error_string(rc)); goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension hashtable insert failed", globus_gram_protocol_error_string(rc)); goto fail_entry_insert; } } } /* Add extensions for version numbers */ entry = globus_gram_protocol_create_extension( "toolkit-version", "%s", request->config->globus_version); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension initialization failed", globus_gram_protocol_error_string(rc)); goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension hashtable insert failed", globus_gram_protocol_error_string(rc)); goto fail_entry_insert; } entry = globus_gram_protocol_create_extension( "version", "%d.%d (%d-%d)", local_version.major, local_version.minor, local_version.timestamp, local_version.branch_id); if (entry == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension initialization failed", globus_gram_protocol_error_string(rc)); goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, entry->attribute, entry); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Message extension hashtable insert failed", globus_gram_protocol_error_string(rc)); goto fail_entry_insert; } entry = NULL; if (extensions != NULL) { rc = globus_gram_protocol_pack_status_update_message_with_extensions( request->job_contact, (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) ? GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED : request->status, (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) ? request->stop_reason : request->failure_code, &extensions, &context->message, &context->message_length); } else { rc = globus_gram_protocol_pack_status_update_message( request->job_contact, (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) ? GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED : request->status, (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) ? request->stop_reason : request->failure_code, &context->message, &context->message_length); } if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Error packing message", globus_gram_protocol_error_string(rc)); goto pack_message_failed; } while(!globus_list_empty(tmp_list)) { client_contact_node = globus_list_first(tmp_list); tmp_list = globus_list_rest(tmp_list); if ((request->status & client_contact_node->job_state_mask) && client_contact_node->failed_count < 4) { char * contact = strdup(client_contact_node->contact); if (contact == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d" "contact=%s " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", request->job_contact_path, state, -rc, client_contact_node->contact, "Copy of contact string failed", errno, strerror(errno)); continue; } rc = globus_list_insert(&context->contacts, contact); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.end " "level=ERROR " "gramid=%s " "state=%d " "status=%d" "contact=%s " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, client_contact_node->contact, "Error inserting contact string into list", globus_gram_protocol_error_string(rc)); free(contact); continue; } } } if (globus_list_empty(context->contacts)) { /* Nothing to send... free context */ rc = GLOBUS_FAILURE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.callback.end " "level=WARN " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Unexpectedly empty contact list", globus_gram_protocol_error_string(rc)); goto nothing_to_send; } rc = globus_l_gram_callback_queue(request->manager, context); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.callback.end " "level=WARN " "gramid=%s " "state=%d " "status=%d" "msg=\"%s\" " "reason=\"%s\"\n", request->job_contact_path, state, -rc, "Error queuing callback messages", globus_gram_protocol_error_string(rc)); goto queue_failed; } if (extensions != NULL) { globus_gram_protocol_hash_destroy(&extensions); } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.callback.end " "level=DEBUG " "gramid=%s " "state=%d " "status=%d " "msg=\"%s\"\n", request->job_contact_path, state, rc, "Done queuing callback messages"); if (rc != GLOBUS_SUCCESS) { queue_failed: tmp_list = context->contacts; while (!globus_list_empty(tmp_list)) { char * tmp = globus_list_first(tmp_list); tmp_list = globus_list_rest(tmp_list); free(tmp); } nothing_to_send: if (restart_state_machine_when_done) { globus_reltime_t delay; GlobusTimeReltimeSet(delay, request->two_phase_commit, 0); rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay); } free(context->message); globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "Job state callbacks"); if (entry != NULL) { fail_entry_insert: free(entry->value); free(entry->attribute); free(entry); } extension_create_failed: if (extensions) { globus_gram_protocol_hash_destroy(&extensions); } fail_extensions_init: add_reference_failed: pack_message_failed: free(context); context_malloc_failed: ; } } /* globus_gram_job_manager_state_callback() */ /** * Write list of callback contacts to the given file * * @param request * Job request which should have its callback contacts written * @param fp * File to write to * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_STATE_FILE * Error writing state file * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed */ int globus_gram_job_manager_write_callback_contacts( globus_gram_jobmanager_request_t * request, FILE * fp) { globus_gram_job_manager_contact_t * contact; globus_list_t * tmp; int rc; tmp = request->client_contacts; rc = fprintf(fp, "%d\n", globus_list_size(tmp)); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_STATE_FILE; goto failed_write_count; } while (! globus_list_empty(tmp)) { contact = globus_list_first(tmp); tmp = globus_list_rest(tmp); rc = fprintf(fp, "%d %s\n", contact->job_state_mask, contact->contact); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_STATE_FILE; goto failed_write_contact; } } rc = GLOBUS_SUCCESS; failed_write_contact: failed_write_count: return rc; } /* globus_gram_job_manager_write_callback_contacts() */ /** * Read list of callback contacts from the given file * * @param request * Job request which should have its callback contacts read * @param fp * File to read from * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE * Error reading state file * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed */ int globus_gram_job_manager_read_callback_contacts( globus_gram_jobmanager_request_t * request, FILE * fp) { globus_gram_job_manager_contact_t * contact; globus_list_t ** tmp; int count; int rc; long off1, off2; int i; request->client_contacts = NULL; tmp = &request->client_contacts; rc = fscanf(fp, "%d%*[\n]", &count); if (rc != 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto failed_read_count; } for (i = 0; i < count; i++) { contact = malloc(sizeof(globus_gram_job_manager_contact_t)); if (contact == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_malloc_contact; } off1 = ftell(fp); if (off1 < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto failed_ftell; } rc = fscanf(fp, "%d %*s%*[\n]", &contact->job_state_mask); if (rc < 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto failed_read_mask; } off2 = ftell(fp); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto failed_ftell2; } rc = fseek(fp, off1, SEEK_SET); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto failed_fseek; } contact->contact = malloc(off2-off1+1); if (contact->contact == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_malloc_contact_string_failed; } rc = fscanf(fp, "%*d %s%*[\n]", contact->contact); if (rc < 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto failed_scan_contact; } contact->failed_count = 0; rc = globus_list_insert(tmp, contact); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_list_insert; } tmp = globus_list_rest_ref(*tmp); } rc = GLOBUS_SUCCESS; if (rc != GLOBUS_SUCCESS) { failed_list_insert: failed_scan_contact: free(contact->contact); failed_malloc_contact_string_failed: failed_fseek: failed_ftell2: failed_read_mask: failed_ftell: free(contact); failed_malloc_contact: globus_gram_job_manager_contact_list_free(request); failed_read_count: ; } return rc; } /* globus_gram_job_manager_read_callback_contacts() */ static int globus_l_gram_callback_queue( globus_gram_job_manager_t * manager, globus_gram_job_callback_context_t *context) { int rc = GLOBUS_SUCCESS; globus_list_t * references = NULL; globus_gram_jobmanager_request_t * request; if (manager->config->log_levels & GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE) { char * message; message = globus_gram_prepare_log_string((char *) context->message); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.callback.queue.start " "level=TRACE " "gramid=%s " "msg=\"%s\" " "status_message=\"%s\"" "\n", context->request->job_contact_path, "Queuing status update message", message ? message : ""); if (message) { free(message); } } GlobusGramJobManagerLock(manager); rc = globus_fifo_enqueue(&manager->state_callback_fifo, context); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_FAILURE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.callback.queue.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\"" "\n", context->request->job_contact_path, "Error enqueuing context in callback fifo", -rc, globus_gram_protocol_error_string(rc)); goto failed_enqueue; } while (manager->state_callback_slots > 0 && !globus_fifo_empty(&manager->state_callback_fifo)) { context = globus_fifo_peek(&manager->state_callback_fifo); request = context->request; while (manager->state_callback_slots > 0 && !globus_list_empty(context->contacts)) { char * contact; contact = globus_list_remove(&context->contacts, context->contacts); if (manager->config->log_levels & GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE) { char * message; message = globus_gram_prepare_log_string( (char *) context->message); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.callback.queue.process.start " "level=TRACE " "gramid=%s " "msg=\"%s\" " "contact=%s " "status_message=\"%s\"" "\n", context->request->job_contact_path, "Sending status update message", contact, message ? message : ""); if (message) { free(message); } } rc = globus_gram_protocol_post( contact, NULL, NULL, context->message, context->message_length, globus_l_gram_callback_reply, context); if (rc == GLOBUS_SUCCESS) { request->job_stats.callback_count++; manager->state_callback_slots--; context->active++; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.callback.queue.process.end " "level=TRACE " "gramid=%s " "contact=%s " "msg=\"%s\" " "status=%d " "\n", context->request->job_contact_path, contact, "Message posted", rc); } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.callback.queue.process.end " "level=WARN " "gramid=%s " "contact=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", context->request->job_contact_path, contact, "Message posted", -rc, globus_gram_protocol_error_string(rc)); rc = GLOBUS_SUCCESS; } free(contact); } if (globus_list_empty(context->contacts)) { (void) globus_fifo_dequeue(&manager->state_callback_fifo); } if (context->active == 0 && globus_list_empty(context->contacts)) { free(context->message); free(context); context = NULL; globus_list_insert(&references, request->job_contact_path); } } failed_enqueue: GlobusGramJobManagerUnlock(manager); while (!globus_list_empty(references)) { char * key = globus_list_remove(&references, references); globus_gram_job_manager_remove_reference( manager, key, "Job state callbacks"); } if (rc == GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.callback.queue.end " "level=TRACE " "%s%s%s" "status=%d\n", context ? "gramid=" : "", context ? context->request->job_contact_path : "", context ? " " : "", -rc); } return rc; } /* globus_l_gram_callback_queue() */ static void globus_l_gram_callback_reply( void * arg, globus_gram_protocol_handle_t handle, globus_byte_t * message, globus_size_t msgsize, int errorcode, char * uri) { globus_gram_job_callback_context_t *context; globus_gram_jobmanager_request_t * request; globus_gram_job_manager_t * manager; globus_list_t * references = NULL; globus_list_t * references_to_restart = NULL; int rc = GLOBUS_SUCCESS; context = arg; request = context->request; manager = request->manager; GlobusGramJobManagerLock(manager); context->active--; manager->state_callback_slots++; if (context->active == 0 && globus_list_empty(context->contacts)) { if (context->restart_state_when_done) { globus_list_insert(&references_to_restart, request); } else { globus_list_insert(&references, request); } free(context->message); free(context); } while (manager->state_callback_slots > 0 && !globus_fifo_empty(&manager->state_callback_fifo)) { context = globus_fifo_peek(&manager->state_callback_fifo); request = context->request; while (manager->state_callback_slots > 0 && !globus_list_empty(context->contacts)) { char * contact; contact = globus_list_remove(&context->contacts, context->contacts); rc = globus_gram_protocol_post( contact, NULL, NULL, context->message, context->message_length, globus_l_gram_callback_reply, context); if (rc == GLOBUS_SUCCESS) { manager->state_callback_slots--; context->active++; } free(contact); } if (globus_list_empty(context->contacts)) { (void) globus_fifo_dequeue(&manager->state_callback_fifo); } if (context->active == 0 && globus_list_empty(context->contacts)) { if (context->restart_state_when_done) { globus_list_insert(&references_to_restart, request); } else { globus_list_insert(&references, request); } free(context->message); free(context); } } GlobusGramJobManagerUnlock(manager); while (!globus_list_empty(references)) { request = globus_list_remove(&references, references); globus_gram_job_manager_remove_reference( manager, request->job_contact_path, "Job state callbacks"); } while (!globus_list_empty(references_to_restart)) { globus_reltime_t delay; request = globus_list_remove( &references_to_restart, references_to_restart); GlobusGramJobManagerRequestLock(request); if (request->jobmanager_state != GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) { GlobusTimeReltimeSet(delay, request->two_phase_commit, 0); } else { GlobusTimeReltimeSet(delay, 0, 0); } rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay); globus_gram_job_manager_remove_reference( manager, request->job_contact_path, "Job state callbacks"); GlobusGramJobManagerRequestUnlock(request); } } /* globus_l_gram_callback_reply() */ globus_gram_job_manager-13.53/globus_gram_job_manager_history_file.c0000666000076400007640000001416511263441005023063 00000000000000/* * Copyright 1999-2009 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_gram_job_manager.h" #include /** * Determine the name of the job history file for this job request * * @param request * Job to create file name for. The request's @a job_history_file member * is modified by this function. * * @retval GLOBUS_SUCCESS * Success. */ int globus_gram_job_manager_history_file_set( globus_gram_jobmanager_request_t * request) { int rc = GLOBUS_SUCCESS; if (! request->config->job_history_dir) { request->job_history_file = NULL; goto no_history; } request->job_history_file = globus_common_create_string( "%s/history.%s-%s_%s", request->config->job_history_dir, request->config->hostname, request->config->jobmanager_type, request->uniq_id ); if (request->job_history_file == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto history_file_malloc_failed; } history_file_malloc_failed: no_history: return rc; } /* globus_gram_job_manager_history_file_set() */ /** * Create job or update the job history file * * @param request * Job to create or update the job history file for. If the file exists, * information about the new job state is appended to it. Otherwise, * the file is created and information about the RSL, job contact, and * client identity are recorded along with the new job state data. * * @retval GLOBUS_SUCCESS * Success. */ int globus_gram_job_manager_history_file_create( globus_gram_jobmanager_request_t * request) { FILE * history_fp; char * status_str; unsigned long timestamp; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.history_file_create.start " "level=TRACE " "gramid=%s " "\n", request->job_contact_path); timestamp = time(0); if(!request->config->job_history_dir) { return GLOBUS_SUCCESS; } switch(request->status) { case GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING: status_str = "PENDING "; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE: status_str = "ACTIVE "; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED: if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) status_str = "JOBMANAGER_STOP"; else status_str = "FAILED "; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE: status_str = "DONE "; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_SUSPENDED: status_str = "SUSPENDED "; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_UNSUBMITTED: status_str = "UNSUBMITTED "; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_IN: status_str = "STAGE_IN "; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT: status_str = "STAGE_OUT "; break; default: status_str = "UNKNOWN "; break; } if(access(request->job_history_file, F_OK) == 0) { /* the file exists, so just append a line which has the * job status and timestamp */ history_fp = fopen(request->job_history_file, "a+"); if(history_fp == NULL) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.history_file_create.end " "level=WARN " "gramid=%s " "msg=\"%s\" " "path=\"%s\" " "errno=%d " "reason=\"%s\" " "status=-1 " "\n", request->job_contact_path, "Error opening job history file", request->job_history_file, errno, strerror(errno)); return GLOBUS_FAILURE; } fprintf(history_fp, "%s\t%10ld\n", status_str,timestamp); } else if((history_fp = fopen(request->job_history_file, "w")) == NULL) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.history_file_create.end " "level=WARN " "gramid=%s " "msg=\"%s\" " "path=\"%s\" " "errno=%d " "reason=\"%s\" " "status=-1\n", request->job_contact_path, request->job_history_file, errno, strerror(errno)); return GLOBUS_FAILURE; } else { fprintf(history_fp, "%s\n%s\n%s\n%s\t%10ld\n", request->rsl_spec, request->job_contact, request->config->subject, status_str,timestamp); } fclose(history_fp); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.history_file_create.end " "level=TRACE " "gramid=%s " "path=\"%s\" " "status=%d\n", request->job_contact_path, request->job_history_file, 0); return GLOBUS_SUCCESS; } /* globus_gram_job_manager_history_file_create() */ globus_gram_job_manager-13.53/globus_gram_streamer.c0000666000076400007640000006334211727722172017676 00000000000000/* * Copyright 1999-2010 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. */ /* * @file globus_gram_streamer.c GRAM File Streamer Application * * @details * The globus-gram-streamer program provides support for live file * streaming of stdout and stderr. It is intended to be run by the fork * job management module for cases where output streaming is required during * the execution of the job. It is started as an additional process by * the fork module and its pid is included along with the other pids that * must be monitored for the job to be complete. * * CVS Information: * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_streamer.c,v $ * $Date: 2012/03/13 19:48:10 $ * $Revision: 1.3.8.1 $ * $Author: bester $ */ #include "globus_common.h" #include "globus_gass_transfer.h" #include "globus_gram_job_manager.h" #include "globus_symboltable.h" #include enum { STREAMER_MAX = 256 }; const off_t STREAMER_BLOCKSIZE = 4096; typedef enum { GLOBUS_GRAM_STREAM_NONE, GLOBUS_GRAM_STREAM_NEW, GLOBUS_GRAM_STREAM_ACTIVE, GLOBUS_GRAM_STREAM_RESTART, GLOBUS_GRAM_STREAM_RESTART_NEW, GLOBUS_GRAM_STREAM_FAIL, GLOBUS_GRAM_STREAM_DONE } globus_gram_stream_state_t; typedef struct { int fd; off_t sent; char * source; char * destination; globus_gass_transfer_request_t handle; globus_gram_stream_state_t state; int blocks; int last_sent; } globus_gram_stream_t; typedef struct { globus_mutex_t mutex; globus_cond_t cond; globus_gram_jobmanager_request_t request; globus_callback_handle_t local_poll_periodic; time_t remote_io_url_file_time; globus_gram_stream_t output_stream; globus_gram_stream_t error_stream; globus_callback_handle_t waitpids_poll_periodic; pid_t pids[STREAMER_MAX]; int pid_count; } globus_gram_streamer_monitor_t; static void globus_l_gram_streamer_request_ready( void * arg, globus_gass_transfer_request_t request); static void globus_l_gram_streamer_local_poll( void * arg); static int globus_l_gram_streamer_get_destinations( globus_gram_streamer_monitor_t * monitor); static int globus_l_gram_streamer_open_destination( globus_gram_streamer_monitor_t * monitor, globus_gram_stream_t * stream); static void globus_l_gram_streamer_waitpids( void * arg); int main( int argc, char ** argv) { int opt; globus_gram_streamer_monitor_t monitor; int rc; char local_path[16]; globus_result_t result; globus_reltime_t period; globus_module_descriptor_t * modules[] = { GLOBUS_COMMON_MODULE, GLOBUS_GASS_TRANSFER_MODULE, NULL }; globus_module_descriptor_t * failed_module; memset(&monitor, 0, sizeof(globus_gram_streamer_monitor_t)); globus_mutex_init(&monitor.request.mutex, NULL); globus_cond_init(&monitor.request.cond, NULL); while ((opt = getopt(argc, argv, "s:p:d:h")) != -1) { switch (opt) { case 's': monitor.request.job_state_file = optarg; /* * Assume that the remote I/O file will not be newer than the * current time */ monitor.remote_io_url_file_time = time(NULL); rc = globus_gram_job_manager_state_file_read(&monitor.request); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "%d:Error reading state file %s\n", rc, optarg); } break; case 'p': if ((monitor.pid_count+1) == STREAMER_MAX) { fprintf(stderr, "%d:Too many pids for streamer\n", GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES); exit(EXIT_FAILURE); } monitor.pids[monitor.pid_count++] = (pid_t) strtol(optarg, NULL, 10); break; case 'd': rc = chdir(optarg); if (rc != 0) { int save_errno = errno; fprintf(stderr, "%d:Error accessing job state directory: %s (%d)\n", GLOBUS_GRAM_PROTOCOL_ERROR_BAD_DIRECTORY, strerror(save_errno), save_errno); exit(EXIT_FAILURE); } break; case 'h': printf("Usage: %s -s STATE-FILE -p pid [-p pid]...\n", argv[0]); exit(EXIT_SUCCESS); break; case '?': default: fprintf(stderr, "%d:Unknown option: %c\n", GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED, (char) opt); exit(EXIT_FAILURE); } } rc = globus_module_activate_array(modules, &failed_module); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "%d:Activation failed: %s %d\n", GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED, failed_module->module_name, rc); exit(EXIT_FAILURE); } strcpy(local_path, "stdout"); monitor.output_stream.fd = open(local_path, O_RDONLY); strcpy(local_path, "stderr"); monitor.error_stream.fd = open(local_path, O_RDONLY); rc = globus_mutex_init(&monitor.mutex, NULL); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "%d:Mutex init failed\n", GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED); exit(EXIT_FAILURE); } rc = globus_cond_init(&monitor.cond, NULL); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "%d:Mutex init failed\n", GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED); exit(EXIT_FAILURE); } globus_mutex_lock(&monitor.mutex); GlobusTimeReltimeSet(period, 5, 0); result = globus_callback_register_periodic( &monitor.local_poll_periodic, &globus_i_reltime_zero, &period, globus_l_gram_streamer_local_poll, &monitor); if (result != GLOBUS_SUCCESS) { char * errstr = globus_error_print_friendly(globus_error_peek(result)); fprintf(stderr, "%d:Initialization error: %s\n", GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED, errstr); free(errstr); exit(EXIT_FAILURE); } result = globus_callback_register_periodic( &monitor.waitpids_poll_periodic, &globus_i_reltime_zero, &period, globus_l_gram_streamer_waitpids, &monitor); if (result != GLOBUS_SUCCESS) { char * errstr = globus_error_print_friendly(globus_error_peek(result)); fprintf(stderr, "%d:Initialization error: %s\n", GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED, errstr); free(errstr); exit(EXIT_FAILURE); } rc = globus_l_gram_streamer_get_destinations( &monitor); if (rc != GLOBUS_SUCCESS) { exit(EXIT_FAILURE); } if (monitor.output_stream.fd != -1 && monitor.output_stream.destination != NULL) { rc = globus_l_gram_streamer_open_destination( &monitor, &monitor.output_stream); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "%d:Error opening stdout destination %s (%d)\n", GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDOUT, monitor.output_stream.destination, rc); exit(EXIT_FAILURE); } monitor.output_stream.state = GLOBUS_GRAM_STREAM_NEW; } else { monitor.output_stream.state = GLOBUS_GRAM_STREAM_NONE; } if (monitor.error_stream.fd != -1 && monitor.error_stream.destination != NULL) { rc = globus_l_gram_streamer_open_destination( &monitor, &monitor.error_stream); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "%d:Error opening stderr destination %s (%d)\n", GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDERR, monitor.error_stream.destination, rc); exit(EXIT_FAILURE); } monitor.error_stream.state = GLOBUS_GRAM_STREAM_NEW; } else { monitor.error_stream.state = GLOBUS_GRAM_STREAM_NONE; } while (monitor.pid_count > 0 || (monitor.output_stream.state != GLOBUS_GRAM_STREAM_NONE && monitor.output_stream.state != GLOBUS_GRAM_STREAM_DONE && monitor.output_stream.state != GLOBUS_GRAM_STREAM_FAIL) || (monitor.error_stream.state != GLOBUS_GRAM_STREAM_NONE && monitor.error_stream.state != GLOBUS_GRAM_STREAM_DONE && monitor.error_stream.state != GLOBUS_GRAM_STREAM_FAIL)) { globus_cond_wait(&monitor.cond, &monitor.mutex); } if (monitor.output_stream.state == GLOBUS_GRAM_STREAM_DONE) { printf("%s %s\n", monitor.output_stream.source, monitor.output_stream.destination); } if (monitor.error_stream.state == GLOBUS_GRAM_STREAM_DONE) { printf("%s %s\n", monitor.error_stream.source, monitor.error_stream.destination); } globus_mutex_unlock(&monitor.mutex); globus_module_deactivate(GLOBUS_GASS_TRANSFER_MODULE); globus_module_activate(GLOBUS_COMMON_MODULE); exit(EXIT_SUCCESS); } /* main() */ static void globus_l_gram_streamer_request_ready( void * arg, globus_gass_transfer_request_t request) { globus_gram_streamer_monitor_t * monitor = arg; globus_gram_stream_t * stream; globus_gass_transfer_request_status_t status; globus_mutex_lock(&monitor->mutex); stream = globus_gass_transfer_request_get_user_pointer(request); status = globus_gass_transfer_request_get_status(request); switch (status) { case GLOBUS_GASS_TRANSFER_REQUEST_INVALID: case GLOBUS_GASS_TRANSFER_REQUEST_STARTING: globus_gass_transfer_request_destroy(request); stream->state = GLOBUS_GRAM_STREAM_FAIL; globus_cond_signal(&monitor->cond); break; case GLOBUS_GASS_TRANSFER_REQUEST_FAILED: case GLOBUS_GASS_TRANSFER_REQUEST_DENIED: globus_gass_transfer_request_destroy(request); stream->state = GLOBUS_GRAM_STREAM_FAIL; globus_cond_signal(&monitor->cond); break; case GLOBUS_GASS_TRANSFER_REQUEST_REFERRED: globus_gass_transfer_request_destroy(request); stream->state = GLOBUS_GRAM_STREAM_DONE; globus_cond_signal(&monitor->cond); break; case GLOBUS_GASS_TRANSFER_REQUEST_DONE: globus_gass_transfer_request_destroy(request); stream->state = GLOBUS_GRAM_STREAM_DONE; globus_cond_signal(&monitor->cond); break; case GLOBUS_GASS_TRANSFER_REQUEST_PENDING: stream->state = GLOBUS_GRAM_STREAM_ACTIVE; break; default: fprintf(stderr, "%d:GASS Transfer returned invalid status: %d\n", GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED, (int) status); exit(EXIT_FAILURE); } globus_mutex_unlock(&monitor->mutex); } static void globus_l_gram_streamer_fail( void * arg, globus_gass_transfer_request_t request) { globus_gram_streamer_monitor_t * monitor = arg; globus_gram_stream_t * stream; globus_mutex_lock(&monitor->mutex); stream = globus_gass_transfer_request_get_user_pointer(request); stream->state = GLOBUS_GRAM_STREAM_RESTART_NEW; stream->sent = 0; stream->last_sent = GLOBUS_FALSE; lseek(stream->fd, 0, SEEK_SET); stream->handle = GLOBUS_NULL_HANDLE; globus_mutex_unlock(&monitor->mutex); } /* globus_l_gram_streamer_fail() */ static void globus_l_gram_streamer_data_callback( void * arg, globus_gass_transfer_request_t request, globus_byte_t * bytes, globus_size_t length, globus_bool_t last_data) { globus_gram_streamer_monitor_t * monitor = arg; globus_gram_stream_t * stream; globus_gass_transfer_request_status_t status; globus_mutex_lock(&monitor->mutex); stream = globus_gass_transfer_request_get_user_pointer(request); free(bytes); stream->blocks--; status = globus_gass_transfer_request_get_status(request); if (last_data && stream->blocks == 0) { switch (status) { case GLOBUS_GASS_TRANSFER_REQUEST_INVALID: case GLOBUS_GASS_TRANSFER_REQUEST_STARTING: case GLOBUS_GASS_TRANSFER_REQUEST_FAILED: case GLOBUS_GASS_TRANSFER_REQUEST_DENIED: case GLOBUS_GASS_TRANSFER_REQUEST_REFERRED: globus_gass_transfer_request_destroy(request); if (stream->state != GLOBUS_GRAM_STREAM_RESTART) { stream->state = GLOBUS_GRAM_STREAM_FAIL; globus_cond_signal(&monitor->cond); } break; case GLOBUS_GASS_TRANSFER_REQUEST_DONE: globus_gass_transfer_request_destroy(request); if (stream->state == GLOBUS_GRAM_STREAM_ACTIVE) { stream->state = GLOBUS_GRAM_STREAM_DONE; } globus_cond_signal(&monitor->cond); break; case GLOBUS_GASS_TRANSFER_REQUEST_PENDING: break; default: fprintf(stderr, "%d:GASS Transfer returned invalid status: %d\n", GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED, (int) status); exit(EXIT_FAILURE); } } globus_mutex_unlock(&monitor->mutex); } /* globus_l_gram_streamer_data_callback() */ static void globus_l_gram_streamer_local_poll( void * arg) { globus_gram_streamer_monitor_t * monitor = arg; int rc; struct stat st; unsigned char * data; off_t data_size; globus_size_t amt; globus_bool_t last_data; int i; char * save_state_file; globus_gram_stream_t * streams[] = { &monitor->output_stream, &monitor->error_stream, NULL }; globus_gram_stream_t * stream; globus_mutex_lock(&monitor->mutex); /* Check if remote_io_file has changed */ rc = stat("remote_io_file", &st); if (rc == 0) { if (st.st_mtime > monitor->remote_io_url_file_time) { /* Start the termination of the current output streams */ for (i = 0; streams[i] != NULL; i++) { stream = streams[i]; switch (stream->state) { case GLOBUS_GRAM_STREAM_NEW: case GLOBUS_GRAM_STREAM_ACTIVE: globus_gass_transfer_fail( stream->handle, globus_l_gram_streamer_fail, monitor); stream->state = GLOBUS_GRAM_STREAM_RESTART; break; case GLOBUS_GRAM_STREAM_FAIL: case GLOBUS_GRAM_STREAM_DONE: stream->state = GLOBUS_GRAM_STREAM_RESTART_NEW; stream->sent = 0; stream->last_sent = GLOBUS_FALSE; lseek(stream->fd, 0, SEEK_SET); stream->handle = GLOBUS_NULL_HANDLE; break; case GLOBUS_GRAM_STREAM_RESTART: case GLOBUS_GRAM_STREAM_RESTART_NEW: case GLOBUS_GRAM_STREAM_NONE: break; } } monitor->remote_io_url_file_time = st.st_mtime; /* Load new state file */ save_state_file = monitor->request.job_state_file; monitor->request.job_state_file = NULL; globus_gram_job_manager_request_free(&monitor->request); monitor->request.rsl = NULL; monitor->request.job_state_file = save_state_file; rc = globus_gram_job_manager_state_file_read(&monitor->request); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "%d:", rc); exit(EXIT_FAILURE); } if (monitor->output_stream.source != NULL) { free(monitor->output_stream.source); monitor->output_stream.source = NULL; } if (monitor->output_stream.destination != NULL) { free(monitor->output_stream.destination); monitor->output_stream.destination = NULL; } if (monitor->error_stream.source != NULL) { free(monitor->error_stream.source); monitor->error_stream.source = NULL; } if (monitor->error_stream.destination != NULL) { free(monitor->error_stream.destination); monitor->error_stream.destination = NULL; } /* Re-evaluate RSL */ rc = globus_l_gram_streamer_get_destinations( monitor); } } /* On the first poll after everything is ready to restart, we'll reload * state information and reopen the stream */ for (i = 0; streams[i] != NULL; i++) { stream = streams[i]; if (stream->state == GLOBUS_GRAM_STREAM_RESTART_NEW) { /* Re-open output stream */ if (stream->fd != -1 && stream->destination != NULL) { rc = globus_l_gram_streamer_open_destination( monitor, stream); if (rc == GLOBUS_SUCCESS) { stream->state = GLOBUS_GRAM_STREAM_NEW; } else { stream->state = GLOBUS_GRAM_STREAM_FAIL; } } else { stream->state = GLOBUS_GRAM_STREAM_DONE; } } } /* Only queue data if the transfer is alive */ for (i = 0; streams[i] != NULL; i++) { stream = streams[i]; if (stream->state == GLOBUS_GRAM_STREAM_ACTIVE && (fstat(stream->fd, &st) == 0)) { data_size = st.st_size - stream->sent; if (data_size > STREAMER_BLOCKSIZE) { data_size = STREAMER_BLOCKSIZE; } amt = 0; data = NULL; if (data_size > 0) { data = malloc((size_t) data_size); do { rc = read(stream->fd, data + amt, data_size - amt); if (rc < 0) { if (errno != EINTR) { break; } } else if (rc == 0) { break; } else { amt += rc; } } while (amt < data_size); } if (amt > 0 || ((monitor->pid_count == 0) && (!stream->last_sent))) { stream->sent += amt; stream->blocks++; last_data = (monitor->pid_count == 0) && (stream->sent == st.st_size); rc = globus_gass_transfer_send_bytes( stream->handle, (data == NULL) ? malloc(1) : data, amt, last_data, globus_l_gram_streamer_data_callback, monitor); switch (rc) { case GLOBUS_SUCCESS: stream->last_sent = last_data; break; case GLOBUS_GASS_TRANSFER_ERROR_NULL_POINTER: fprintf(stderr, "NULL pointer"); exit(EXIT_FAILURE); break; case GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE: stream->last_sent = GLOBUS_TRUE; globus_gass_transfer_request_destroy(stream->handle); stream->state = GLOBUS_GRAM_STREAM_FAIL; break; case GLOBUS_GASS_TRANSFER_ERROR_NOT_INITIALIZED: fprintf(stderr, "Not initialized"); exit(EXIT_FAILURE); break; case GLOBUS_GASS_TRANSFER_REQUEST_FAILED: fprintf(stderr, "Failed "); exit(EXIT_FAILURE); } } } } globus_mutex_unlock(&monitor->mutex); } static int globus_l_gram_streamer_get_destinations( globus_gram_streamer_monitor_t * monitor) { globus_list_t * tmp; globus_gram_job_manager_staging_info_t * info; char * s; tmp = monitor->request.stage_stream_todo; while (tmp != NULL) { info = globus_list_first(tmp); tmp = globus_list_rest(tmp); if (monitor->output_stream.destination == NULL) { s = strstr(info->evaled_from, "/stdout"); if (s != NULL && strcmp(s, "/stdout") == 0) { monitor->output_stream.source = strdup(info->evaled_from); monitor->output_stream.destination = strdup(info->evaled_to); continue; } } if (monitor->error_stream.destination == NULL) { s = strstr(info->evaled_from, "/stderr"); if (s != NULL && strcmp(s, "/stderr") == 0) { monitor->error_stream.source = strdup(info->evaled_from); monitor->error_stream.destination = strdup(info->evaled_to); continue; } } } return 0; } static int globus_l_gram_streamer_open_destination( globus_gram_streamer_monitor_t * monitor, globus_gram_stream_t * stream) { globus_gass_transfer_requestattr_t attr; char scheme[16]; int i; int rc; for (i = 0; i < sizeof(scheme); i++) { if (stream->destination[i] == ':') { scheme[i] = 0; break; } else { scheme[i] = stream->destination[i]; } } scheme[15] = 0; rc = globus_gass_transfer_requestattr_init( &attr, scheme); if (rc != GLOBUS_SUCCESS) { return rc; } rc = globus_gass_transfer_register_append( &stream->handle, &attr, (char *) stream->destination, GLOBUS_GASS_TRANSFER_LENGTH_UNKNOWN, globus_l_gram_streamer_request_ready, monitor); if (rc == GLOBUS_SUCCESS) { (void) globus_gass_transfer_request_set_user_pointer( stream->handle, stream); } (void) globus_gass_transfer_requestattr_destroy(&attr); return rc; } /* globus_l_gram_streamer_open_destination() */ /** * @brief Determine if the job's processes are still running * * The globus_l_gram_streamer_waitpids() function is called periodically to * check whether the pids associated with this streamer are still running. * If they are all complete, globus_l_gram_streamer_waitpids() will signal * the main thread and disable this callback from being called again. */ static void globus_l_gram_streamer_waitpids( void * arg) { int i; globus_gram_streamer_monitor_t * monitor = arg; globus_mutex_lock(&monitor->mutex); for (i = 0; i < STREAMER_MAX; i++) { if (monitor->pids[i] == 0) { continue; } if (kill(monitor->pids[i], 0) == -1) { monitor->pids[i] = 0; monitor->pid_count--; } } if (monitor->pid_count == 0) { globus_cond_signal(&monitor->cond); globus_callback_unregister( monitor->waitpids_poll_periodic, NULL, NULL, NULL); } globus_mutex_unlock(&monitor->mutex); } /* globus_l_gram_streamer_waitpids */ globus_gram_job_manager-13.53/globus-personal-gatekeeper-manual.xml0000666000076400007640000002231011415701523022527 00000000000000 globus-personal-gatekeeper 1 University of Chicago globus-personal-gatekeeper Manage a user's personal gatekeeper daemon globus-personal-gatekeeper -help -usage -version -versions -list -directory CONTACT globus-personal-gatekeeper -debug -start -jmtype LRM -auditdir AUDIT_DIRECTORY -port PORT -log=DIRECTORY -seg -acctfile ACCOUNTING_FILE globus-personal-gatekeeper -killall -kill Description The globus-personal-gatekeeper command is a utility which manages a gatekeeper and job manager service for a single user. Depending on the command-line arguments it will operate in one of several modes. In the first set of arguments indicated in the synopsis, the program provides information about the globus-personal-gatekeeper command or about instances of the globus-personal-gatekeeper that are running currently. The second set of arguments indicated in the synopsis provide control over starting a new globus-personal-gatekeeper instance. The final set of arguments provide control for terminating one or more globus-personal-gatekeeper instances. The mode will create a new subdirectory of $HOME/.globus and write the configuration files needed to start a globus-gatekeeper daemon which will invoke the globus-job-manager service when new authenticated connections are made to its service port. The globus-personal-gatekeeper then exits, printing the contact string for the new gatekeeper prefixed by GRAM contact: to standard output. In addition to the arguments described above, any arguments described in globus-job-manager(8) can be appended to the command-line and will be added to the job manager configuration for the service started by the globus-gatekeeper. The new globus-gatekeeper will continue to run in the background until killed by invoking globus-personal-gatekeeper with the or argument. When killed, it will kill the globus-gatekeeper and globus-job-manager processes, remove state files and configuration data, and then exit. Jobs which are running when the personal gatekeeper is killed will continue to run, but their job directory will be destroyed so they may fail in the LRM. The full set of command-line options to globus-personal-gatekeeper consists of: Print command-line option summary and exit Print software version Print software version including DiRT information Print a list of all currently running personal gatekeepers. These entries will be printed one per line. Print the configuration directory for the personal gatekeeper with the contact string CONTACT. Print additional debugging information when starting a personal gatekeeper. This option is ignored in other modes. Start a new personal gatekeeper process. Use LRM as the local resource manager interface. If not provided when starting a personal gatekeeper, the job manager will use the default fork LRM. Write audit report files to AUDIT_DIRECTORY. If not provided, the job manager will not write any audit files. Listen for gatekeeper TCP/IP connections on the port PORT. If not provided, the gatekeeper will let the operating system choose. Write job manager log files to DIRECTORY. If DIRECTORY is omitted, the default of $HOME will be used. If this option is not present, the job manager will not write any log files. Try to use the SEG mechanism to receive job state change information, instead of polling for these. These require either the system administrator or the user to run an instance of the globus-job-manager-event-generator program for the LRM specified by the option. Write gatekeeper accounting entries to ACCOUNTING_FILE. If not provided, no accounting records are written. Examples This example shows the output when starting a new personal gatekeeper which will schedule jobs via the lsf LRM, with debugging enabled. % globus-personal-gatekeeper -start -jmtype lsf verifying setup... done. GRAM contact: personal-grid.example.org:57846:/DC=org/DC=example/CN=Joe User This example shows the output when listing the current active personal gatekeepers. % globus-personal-gatekeeper -list personal-grid.example.org:57846:/DC=org/DC=example/CN=Joe User This example shows the output when querying the configuration directory for th eabove personal gatekeeper. gatekeepers. % globus-personal-gatekeeper -directory "personal-grid.example.org:57846:/DC=org/DC=example/CN=Joe User" /home/juser/.globus/.personal-gatekeeper.personal-grid.example.org.1337 % globus-personal-gatekeeper -kill "personal-grid.example.org:57846:/DC=org/DC=example/CN=Joe User" killing gatekeeper: "personal-grid.example.org:57846:/DC=org/DC=example/CN=Joe User" See Also globusrun1, globus-job-manager8, globus-gatekeeper8 globus_gram_job_manager-13.53/globus_gram_job_manager.c0000666000076400007640000031377012040264633020313 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_gram_job_manager.c LRM-Specific state * * CVS Information: * * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_job_manager.c,v $ * $Date: 2012/10/19 14:54:19 $ * $Revision: 1.64.2.8 $ * $Author: bester $ */ #include "globus_common.h" #include "globus_gram_job_manager.h" #include "globus_xio_popen_driver.h" #include /* This value (in seconds) is the length of time after a job hits a waiting * for SEG state before freeing its memory */ static int globus_l_gram_swap_out_delay = 10; /* * This value (in seconds) is the length of time after all jobs have been * completed that the job manager will terminate */ static int globus_l_gram_grace_period_delay = 60; typedef struct globus_gram_job_id_ref_s { /* Local copy of the unique job id used as the key to the job_id_hash */ char * job_id; /* Local copy of the request job_contact_path */ char * job_contact_path; } globus_gram_job_id_ref_t; static void globus_l_gram_job_manager_grace_period_expired( void * arg); static void globus_l_gram_ref_swap_out( void * arg); static int globus_l_gram_add_reference_locked( globus_gram_job_manager_t * manager, const char * key, const char * reason, globus_gram_jobmanager_request_t ** request); static int globus_l_gram_restart_job( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t ** request, const char * job_contact_path); static int globus_l_gram_read_job_manager_cred( globus_gram_job_manager_t * manager, const char * cred_path, gss_cred_id_t * cred); static int globus_l_gram_job_manager_add_ref_stub( globus_gram_job_manager_t * manager, const char * key, globus_gram_jobmanager_request_t * request, globus_gram_job_manager_ref_t ** ref); static int globus_l_gram_job_manager_remove_reference_locked( globus_gram_job_manager_t * manager, const char * key, const char * reason); static int globus_l_gram_script_attr_init( globus_gram_job_manager_t * manager); static int globus_l_gram_job_manager_request_load_all_from_dir( globus_gram_job_manager_t * manager, const char * state_file_dir, const char * state_file_pattern); #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ /** * Initialize runtime state associated with a LRM instance * * @param manager * Job manager structure to initialize * @param cred * Credential to use for this job manager. * @param config * Configuration parameters defining this service instance * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_REQUEST * Invalid request. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES * No resources. */ int globus_gram_job_manager_init( globus_gram_job_manager_t * manager, gss_cred_id_t cred, globus_gram_job_manager_config_t * config) { int rc; char * dir_prefix = NULL; struct sockaddr_un s; if (manager == NULL || config == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NULL_PARAMETER; goto out; } manager->gt3_failure_message = NULL; manager->usagetracker = NULL; manager->config = config; manager->stop = GLOBUS_FALSE; manager->pending_restarts = NULL; manager->expiration_handle = GLOBUS_NULL_HANDLE; rc = globus_mutex_init(&manager->mutex, NULL); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto mutex_init_failed; } rc = globus_cond_init(&manager->cond, NULL); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto cond_init_failed; } /* Lock this, as we might have callbacks happen in the allow attach and * proxy timeout code before we finish initializing everything */ GlobusGramJobManagerLock(manager); manager->seg_last_timestamp = 0; manager->seg_started = GLOBUS_FALSE; /* After addition of site specific rvf files, reload validation * files when changed */ manager->validation_record_timestamp = (time_t) 0; manager->validation_records = NULL; manager->validation_file_exists[0] = 0; manager->validation_file_exists[1] = 0; manager->validation_file_exists[2] = 0; manager->validation_file_exists[3] = 0; rc = globus_hashtable_init( &manager->request_hash, 89, globus_hashtable_string_hash, globus_hashtable_string_keyeq); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto request_hashtable_init_failed; } rc = globus_hashtable_init( &manager->job_id_hash, 89, globus_hashtable_string_hash, globus_hashtable_string_keyeq); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto job_id_hashtable_init_failed; } dir_prefix = globus_common_create_string( "%s/%s", manager->config->job_dir_home, manager->config->short_hostname); if (dir_prefix == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_dir_prefix_failed; } rc = globus_i_gram_mkdir(dir_prefix); if (rc != GLOBUS_SUCCESS) { goto mkdir_failed; } manager->cred_path = globus_common_create_string( "%s/%s.%s.cred", dir_prefix, manager->config->jobmanager_type, manager->config->service_tag); if (manager->cred_path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_cred_path_failed; } if (cred == GSS_C_NO_CREDENTIAL) { rc = globus_l_gram_read_job_manager_cred( manager, manager->cred_path, &cred); if (rc != GLOBUS_SUCCESS) { goto read_credentials_failed; } } setenv("X509_USER_PROXY", manager->cred_path, 1); rc = globus_gram_protocol_set_credentials(cred); if (rc != GLOBUS_SUCCESS) { goto set_credentials_failed; } rc = globus_gram_protocol_allow_attach( &manager->url_base, globus_gram_job_manager_query_callback, manager); if (rc != GLOBUS_SUCCESS) { goto allow_attach_failed; } if (cred != GSS_C_NO_CREDENTIAL) { manager->cred_expiration_time = 1; rc = globus_gram_job_manager_gsi_register_proxy_timeout( manager, cred, manager->config->proxy_timeout, &manager->proxy_expiration_timer); if (rc != GLOBUS_SUCCESS) { goto proxy_timeout_init_failed; } } else { manager->proxy_expiration_timer = GLOBUS_NULL_HANDLE; } manager->active_job_manager_handle = NULL; manager->lock_fd = -1; manager->lock_path = globus_common_create_string( "%s/%s.%s.lock", dir_prefix, manager->config->jobmanager_type, manager->config->service_tag); if (manager->lock_path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_lock_path_failed; } manager->socket_fd = -1; manager->socket_path = globus_common_create_string( "%s/%s.%s.sock", dir_prefix, manager->config->jobmanager_type, manager->config->service_tag); if (manager->socket_path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_socket_path_failed; } else if (strlen(manager->socket_path) > sizeof(s.sun_path)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED; if (manager->gt3_failure_message == NULL) { manager->gt3_failure_message = globus_common_create_string( "the job manager wants to use %s as a socket path, but the path is too long (use the -globus-job-dir option in etc/globus/globus-gram-job-manager.conf)", manager->socket_path); } goto malloc_socket_path_failed; } manager->pid_path = globus_common_create_string( "%s/%s.%s.pid", dir_prefix, manager->config->jobmanager_type, manager->config->service_tag); if (manager->pid_path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_pid_path_failed; } manager->scripts_per_client = NULL; rc = globus_fifo_init(&manager->state_callback_fifo); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto state_callback_fifo_init_failed; } rc = globus_l_gram_script_attr_init(manager); if (rc != GLOBUS_SUCCESS) { goto script_attr_init_failed; } /* Default number of job state callback notifications that can * occur simultaneously */ manager->state_callback_slots = 5; GlobusGramJobManagerUnlock(manager); free(dir_prefix); manager->done = GLOBUS_FALSE; manager->grace_period_timer = GLOBUS_NULL_HANDLE; manager->seg_pause_count = 0; rc = globus_fifo_init(&manager->seg_event_queue); manager->usagetracker = globus_calloc(1, sizeof(globus_i_gram_usage_tracker_t)); if (rc != GLOBUS_SUCCESS) { script_attr_init_failed: state_callback_fifo_init_failed: free(manager->pid_path); manager->pid_path = NULL; malloc_pid_path_failed: free(manager->socket_path); manager->socket_path = NULL; malloc_socket_path_failed: free(manager->lock_path); manager->lock_path = NULL; malloc_lock_path_failed: proxy_timeout_init_failed: globus_gram_protocol_callback_disallow(manager->url_base); free(manager->url_base); allow_attach_failed: set_credentials_failed: read_credentials_failed: free(manager->cred_path); manager->cred_path = NULL; malloc_cred_path_failed: mkdir_failed: free(dir_prefix); dir_prefix = NULL; malloc_dir_prefix_failed: globus_hashtable_destroy(&manager->job_id_hash); job_id_hashtable_init_failed: globus_hashtable_destroy(&manager->request_hash); request_hashtable_init_failed: globus_gram_job_manager_validation_destroy( manager->validation_records); manager->validation_records = NULL; globus_cond_destroy(&manager->cond); cond_init_failed: GlobusGramJobManagerUnlock(manager); globus_mutex_destroy(&manager->mutex); mutex_init_failed: ; } out: return rc; } /* globus_gram_job_manager_init() */ /** * Destroy job manager state * * Memory used for runtime processing is freed, the GRAM listener and the SEG * are shut down. * * @param manager * Manager to destroy */ void globus_gram_job_manager_destroy( globus_gram_job_manager_t * manager) { if (!manager) { return; } globus_gram_job_manager_shutdown_seg(manager); globus_gram_protocol_callback_disallow(manager->url_base); free(manager->url_base); manager->url_base = NULL; globus_gram_job_manager_validation_destroy( manager->validation_records); manager->validation_records = NULL; globus_hashtable_destroy(&manager->request_hash); globus_hashtable_destroy(&manager->job_id_hash); globus_fifo_destroy(&manager->state_callback_fifo); while (!globus_list_empty(manager->scripts_per_client)) { globus_gram_job_manager_scripts_t *scripts; scripts = globus_list_remove( &manager->scripts_per_client, manager->scripts_per_client); globus_priority_q_destroy(&scripts->script_queue); globus_fifo_destroy(&scripts->script_handles); free(scripts->client_addr); free(scripts); } if(manager->usagetracker) { free(manager->usagetracker); } return; } /* globus_gram_job_manager_destroy() */ void globus_gram_job_manager_log( globus_gram_job_manager_t * manager, globus_gram_job_manager_log_level_t level, const char * format, ...) { va_list ap; time_t now; struct tm * nowtm; globus_bool_t logged = GLOBUS_FALSE; if (globus_i_gram_job_manager_log_sys != NULL) { va_start(ap, format); globus_logging_vwrite( globus_i_gram_job_manager_log_sys, level, format, ap); va_end(ap); logged = GLOBUS_TRUE; } if (globus_i_gram_job_manager_log_stdio != NULL) { va_start(ap, format); globus_logging_vwrite( globus_i_gram_job_manager_log_stdio, level, format, ap); va_end(ap); logged = GLOBUS_TRUE; } if ((!logged) && (manager && !manager->done)) { /* Hack to write to stderr in the case the error happens before we * have parsed command-line options to figure out where log messages * ought to go */ now = time(NULL); nowtm = gmtime(&now); fprintf(stderr, "ts=%04d-%02d-%02dT%02d:%02d:%02dZ id=%lu ", nowtm->tm_year + 1900, nowtm->tm_mon + 1, nowtm->tm_mday, nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec, (unsigned long) getpid()); va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } } /* globus_gram_job_manager_log() */ /** * Add a job request to a reference-counting hashtable * * Adds the job request to the reference-counting hashtable with an initial * reference count of 0. Calls to globus_gram_job_manager_add_reference() and * globus_gram_job_manager_remove_reference() will increase and decrease the * reference count. Callbacks and job status queries, etc should call those * to dereference the job's unique key to a pointer to a * globus_gram_jobmanager_request_t structure and then release that reference * when the callback has been completely processed. * If at any time the reference count equals 0, it becomes a candidate to be * swapped out of memory. This can happen when the job is being processed, * after a submit to LRM but while waiting for the SEG to change * state. When the job is completed and the reference count equals 0, the * job reference stub is removed. * * @param manager * Job manager state * @param key * String key that uniquely identifies the job request * @param request * Request to add to manager's set of requests * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. * */ int globus_gram_job_manager_add_request( globus_gram_job_manager_t * manager, const char * key, globus_gram_jobmanager_request_t * request) { int rc = GLOBUS_SUCCESS; globus_gram_job_manager_ref_t * ref; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.add_request.start " "level=TRACE " "gramid=%s " "\n", key); GlobusGramJobManagerLock(manager); if (manager->stop) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.add_request.end " "level=WARN " "gramid=%s " "status=%d " "reason=\"%s\" " "\n", key, -rc, globus_gram_protocol_error_string(rc)); goto stop; } rc = globus_l_gram_job_manager_add_ref_stub( manager, key, request, &ref); if(rc == GLOBUS_SUCCESS) { manager->usagetracker->count_current_jobs++; if(manager->usagetracker->count_peak_jobs < manager->usagetracker->count_current_jobs) { manager->usagetracker->count_peak_jobs = manager->usagetracker->count_current_jobs; } } if (rc != GLOBUS_SUCCESS) { if (globus_hashtable_lookup( &manager->request_hash, (void *) key) == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.add_request.end " "level=ERROR " "gramid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", key, -rc, "Error inserting request into hashtable", globus_gram_protocol_error_string(rc)); goto insert_failed; } if (manager->grace_period_timer != GLOBUS_NULL_HANDLE) { globus_callback_unregister( manager->grace_period_timer, NULL, NULL, NULL); if (manager->done) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.add_request.end " "level=WARN " "gramid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", key, -rc, "Manager is exiting", globus_gram_protocol_error_string(rc)); goto grace_period_expired; } manager->grace_period_timer = GLOBUS_NULL_HANDLE; } if (rc != GLOBUS_SUCCESS) { insert_failed: grace_period_expired: free(ref->key); free(ref); stop: ; } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.add_request.end " "level=TRACE " "gramid=%s " "status=%d " "\n", key, 0); } GlobusGramJobManagerUnlock(manager); return rc; } /* globus_gram_job_manager_add_request() */ /** * Add a reference struct to the request_hash in the manager struct * based on the values from the request. The new reference is returned * in the pointer passed as the @a ref parameter. The caller must not free its * value unless it also removes the reference from the request_hash table. * * @param manager * GRAM job manager state. * @param key * Request-specific unique hashtable key. * @param request * Pointer to the request to add to the hash table. * @param ref * Pointer to the reference counter structure that is allocated by * this function. * * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE * Old job manager alive * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed */ static int globus_l_gram_job_manager_add_ref_stub( globus_gram_job_manager_t * manager, const char * key, globus_gram_jobmanager_request_t * request, globus_gram_job_manager_ref_t ** ref) { int rc = GLOBUS_SUCCESS; *ref = NULL; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.add_ref_stub.start " "level=TRACE " "gramid=%s " "\n", key); *ref = globus_hashtable_lookup(&manager->request_hash, (void *) key); if (*ref != NULL) { if ((*ref)->request != NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; goto ref_already_exists; } else { (*ref)->request = request; goto ref_already_exists; } } (*ref) = malloc(sizeof(globus_gram_job_manager_ref_t)); if (*ref == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto ref_malloc_failed; } (*ref)->manager = manager; (*ref)->cleanup_timer = GLOBUS_NULL_HANDLE; (*ref)->job_state = request->status; (*ref)->failure_code = request->failure_code; (*ref)->exit_code = request->exit_code; (*ref)->status_count = 0; (*ref)->loaded_only = GLOBUS_FALSE; (*ref)->seg_last_timestamp = request ? request->seg_last_timestamp : 0; (*ref)->seg_last_size = 0; (*ref)->expiration_time = 0; (*ref)->key = strdup(key); if ((*ref)->key == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto key_malloc_failed; } (*ref)->request = request; (*ref)->reference_count = 0; rc = globus_hashtable_insert( &manager->request_hash, (*ref)->key, (*ref)); key_malloc_failed: if (rc != GLOBUS_SUCCESS) { free(*ref); *ref = NULL; } ref_malloc_failed: ref_already_exists: globus_gram_job_manager_log( manager, (rc != GLOBUS_SUCCESS) ? GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR : GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.add_ref_stub.end " "level=%s " "gramid=%s " "status=%d " "%s%s%s" "\n", (rc != GLOBUS_SUCCESS) ? "ERROR" : "TRACE", key, -rc, (rc != GLOBUS_SUCCESS) ? "reason=\"" : "", (rc != GLOBUS_SUCCESS) ? globus_gram_protocol_error_string(rc) : "", (rc != GLOBUS_SUCCESS) ? "\" " : "" ); return rc; } /* globus_gram_job_manager_add_ref_stub() */ /** * Add a reference to a job request based on its unique key identifier * * Looks up a job request in the manager's request table and returns it in * the value pointed to by @a request. The caller must make a corresponding * call to globus_gram_job_manager_remove_reference() for each time this * or globus_gram_job_manager_add_request() is called for a particular job * request. * * @param manager * Job manager state * @param key * String key that uniquely identifies the job request * @param reason * String describing why the reference is being added for logging * @param request * Pointer to be set to the corresponding job request if found in the * table. May be NULL if the caller already has a reference and wants to * add one. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND * Job contact not found. */ int globus_gram_job_manager_add_reference( globus_gram_job_manager_t * manager, const char * key, const char * reason, globus_gram_jobmanager_request_t ** requestp) { int rc = GLOBUS_SUCCESS; globus_result_t result; globus_list_t * pending_restart_ref = NULL; globus_gram_jobmanager_request_t * request = NULL; GlobusGramJobManagerLock(manager); rc = globus_l_gram_add_reference_locked( manager, key, reason, &request); /* GRAM-128: Scalable reloading of requests at job manager restart. * * This code handles the case where a job in the pending_restart list * is being reloaded by a query or by the restart_jobs_callback. In this * case, we'll do the following: * - Remove the contact from the pending_restarts list * - If it is a waiting-for-job-change state, pause the seg * - Add another reference to the job for the state machine and register * the state machine callback */ if (request != NULL && (pending_restart_ref = globus_list_search_pred(manager->pending_restarts, globus_hashtable_string_keyeq, request->job_contact_path)) != NULL) { char * pending_restarts_key = globus_list_remove( &manager->pending_restarts, pending_restart_ref); free(pending_restarts_key); pending_restarts_key = NULL; rc = globus_l_gram_add_reference_locked( manager, key, "state machine", NULL); if (rc != GLOBUS_SUCCESS) { goto remove_reference; } if (request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1 || request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2 || request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1 || request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2) { globus_gram_job_manager_seg_pause(manager); } result = globus_callback_register_oneshot( &request->poll_timer, NULL, globus_gram_job_manager_state_machine_callback, request); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_l_gram_job_manager_remove_reference_locked( manager, key, "state machine"); } if (rc != GLOBUS_SUCCESS) { remove_reference: globus_l_gram_job_manager_remove_reference_locked( manager, key, reason); request = NULL; } } GlobusGramJobManagerUnlock(manager); if (requestp) { *requestp = request; } return rc; } /* globus_gram_job_manager_add_reference() */ /** * Remove a reference to a job request based on its unique key identifier * * Looks up a job request in the manager's request table and dereferences its * reference count. When the reference count reaches 0, also removes * the request from the request table destroys it. * * @param manager * Job manager state * @param key * String key that uniquely identifies the job request * @param reason * String describing why the reference is being removed. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND * Job contact not found. */ int globus_gram_job_manager_remove_reference( globus_gram_job_manager_t * manager, const char * key, const char * reason) { int rc; char gramid[64]; strncpy(gramid, key, sizeof(gramid)); gramid[sizeof(gramid)-1] = 0; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.remove_reference.start " "level=TRACE " "gramid=%s " "reason=\"%s\" " "\n", key, reason); GlobusGramJobManagerLock(manager); rc = globus_l_gram_job_manager_remove_reference_locked( manager, key, reason); GlobusGramJobManagerUnlock(manager); globus_gram_job_manager_log( manager, rc == GLOBUS_SUCCESS ? GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE : GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.remove_reference.end " "level=%s " "gramid=%s " "status=%d " "%s%s%s " "\n", (rc == GLOBUS_SUCCESS) ? "TRACE" : "WARN", gramid, -rc, rc == GLOBUS_SUCCESS ? "" : "reason=\"", rc == GLOBUS_SUCCESS ? "" : globus_gram_protocol_error_string(rc), rc == GLOBUS_SUCCESS ? "" : "\" "); return rc; } /* globus_gram_job_manager_remove_reference() */ static int globus_l_gram_job_manager_remove_reference_locked( globus_gram_job_manager_t * manager, const char * key, const char * reason) { char gramid[64]; globus_gram_jobmanager_request_t * request = NULL; globus_gram_job_manager_ref_t * ref; int rc = GLOBUS_SUCCESS; strncpy(gramid, key, sizeof(gramid)); ref = globus_hashtable_lookup(&manager->request_hash, (void *) key); if (ref) { ref->reference_count--; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.remove_reference.info " "level=TRACE " "gramid=%s " "refcount=%d " "reason=\"%s\" " "\n", key, ref->reference_count, reason); if (ref->reference_count == 0) { /* Don't need to lock the request here---nothing else * refers to it */ request = ref->request; /* If the request is complete, or we are shutting down due to * a proxy expire, we can destroy it */ if ((request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_DONE || request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE) || (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP && (manager->stop == GLOBUS_TRUE))) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.remove_reference.info " "level=TRACE " "gramid=%s " "refcount=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", key, ref->reference_count, "Freeing state for unreferenced, completed job", reason); globus_hashtable_remove( &manager->request_hash, (void *) key); if (globus_hashtable_empty(&manager->request_hash)) { if (manager->stop) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.remove_reference.info " "level=TRACE " "msg=\"%s\" " "\n", "No jobs remain, stopping job manager", reason); manager->done = GLOBUS_TRUE; globus_cond_signal(&manager->cond); } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.remove_reference.info " "level=TRACE " "msg=\"%s\" " "\n", "No jobs remain, setting job manager termination timer"); globus_gram_job_manager_set_grace_period_timer(manager); } } if (ref->request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) { globus_gram_job_manager_request_free(ref->request); } else { globus_gram_job_manager_request_destroy(ref->request); } free(ref->request); free(ref->key); free(ref); } /* If we're waiting for a SEG event or stopped in a way that we * know the job is completed, we can swap the job out */ else if ((request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2 && request->config->seg_module && request->manager->seg_started && request->jobmanager_state != GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) || (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP && (manager->stop == GLOBUS_TRUE || manager->seg_started == GLOBUS_FALSE || request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END || request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE))) { globus_reltime_t delay; globus_result_t result; /* We can swap out if we waiting for SEG events */ GlobusTimeReltimeSet(delay, globus_l_gram_swap_out_delay, 0); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.remove_reference.info " "level=TRACE " "gramid=%s " "refcount=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", key, ref->reference_count, "Setting idle timeout for unreferenced job", reason); result = globus_callback_register_oneshot( &ref->cleanup_timer, &delay, globus_l_gram_ref_swap_out, ref); if (result != GLOBUS_SUCCESS) { char * errstr; char * errstr_escaped; errstr = globus_error_print_friendly( globus_error_peek(result)); errstr_escaped = globus_gram_prepare_log_string(errstr); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.remove_reference.info " "level=WARN " "gramid=%s " "refcount=%d " "msg=\"%s\" " "\n", key, ref->reference_count, "Unable to set idle timeout, leak possible", errstr_escaped ? errstr_escaped : ""); if (errstr) { free(errstr); } if (errstr_escaped) { free(errstr_escaped); } } } } } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; } return rc; } /** * Register a mapping between a LRM job ID and job request's unique job_contact_path * * @param manager * Job manager state * @param job_id * Job identifier * @param request * Request to associate with this job id. * @param prelocked * True if this is called from globus_gram_job_manager_request_load_all() * with the job manager mutex locked * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. */ int globus_gram_job_manager_register_job_id( globus_gram_job_manager_t * manager, char * job_id, globus_gram_jobmanager_request_t * request, globus_bool_t prelocked) { int rc = GLOBUS_SUCCESS; globus_gram_job_id_ref_t * ref; globus_gram_job_id_ref_t * old_ref; globus_list_t *subjobs = NULL, *tmp_list; char * subjob_id; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.job_id_register.start " "level=TRACE " "gramid=%s " "jobid=\"%s\" " "\n", request->job_contact_path, job_id); if (manager->config->seg_module != NULL || strcmp(manager->config->jobmanager_type, "condor") == 0) { /* If we're using the SEG, split on /,/ so that seg events can be * matched to the relevant job requests */ rc = globus_gram_split_subjobs(job_id, &subjobs); if (rc != GLOBUS_SUCCESS) { goto split_job_id_failed; } } else { char * tmp; tmp = strdup(job_id); if (tmp == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto dup_job_id_failed; } rc = globus_list_insert(&subjobs, tmp); if (tmp == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; free(tmp); goto insert_dup_failed; } } if (!prelocked) { GlobusGramJobManagerLock(manager); } for (tmp_list = subjobs; tmp_list != NULL; tmp_list = globus_list_rest(tmp_list)) { subjob_id = globus_list_first(tmp_list); old_ref = globus_hashtable_lookup( &manager->job_id_hash, subjob_id); if (old_ref != NULL) { if (strcmp(old_ref->job_contact_path, request->job_contact_path) != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.job_id_register.end " "level=ERROR " "gramid=%s " "jobid=\"%s\" " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, job_id, "Job ID references another job", -rc, globus_gram_protocol_error_string(rc)); goto old_ref_exists; } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.job_id.register.end " "level=TRACE " "gramid=%s " "jobid=%s " "status=%d " "msg=\"%s\" " "\n", request->job_contact_path, job_id, 0, "Job already registered, ignoring reregistration"); goto old_ref_exists; } } ref = malloc(sizeof(globus_gram_job_id_ref_t)); if (ref == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.job_id.register.end " "level=ERROR " "gramid=%s " "jobid=%s " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", job_id, request->job_contact_path, -rc, "Malloc failed", errno, strerror(errno)); goto ref_malloc_failed; } ref->job_id = strdup(subjob_id); if (ref->job_id == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.job_id.register.end " "level=ERROR " "gramid=%s " "jobid=%s " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", job_id, request->job_contact_path, -rc, "Malloc failed", errno, strerror(errno)); goto job_id_strdup_failed; } ref->job_contact_path = strdup(request->job_contact_path); if (ref->job_contact_path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.job_id.register.end " "level=ERROR " "gramid=%s " "jobid=%s " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", job_id, request->job_contact_path, -rc, "Malloc failed", errno, strerror(errno)); goto job_contact_path_strdup_failed; } rc = globus_hashtable_insert( &manager->job_id_hash, ref->job_id, ref); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.job_id.register.end " "level=ERROR " "gramid=%s " "jobid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", job_id, request->job_contact_path, -rc, "Hashtable insert failed", globus_gram_protocol_error_string(rc)); goto hash_insert_failed; } } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.job_id.register.end " "level=TRACE " "gramid=%s " "jobid=%s " "status=%d " "\n", job_id, request->job_contact_path, 0); if (rc != GLOBUS_SUCCESS) { hash_insert_failed: free(ref->job_contact_path); job_contact_path_strdup_failed: free(ref->job_id); job_id_strdup_failed: free(ref); } ref_malloc_failed: old_ref_exists: if (!prelocked) { GlobusGramJobManagerUnlock(manager); } globus_list_destroy_all(subjobs, free); insert_dup_failed: dup_job_id_failed: split_job_id_failed: return rc; } /* globus_gram_job_manager_register_job_id() */ /** * Unregister a mapping between a LRM job ID and job request's unique job_contact_path * * @param manager * Job manager state * @param job_id * Job identifier * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. */ int globus_gram_job_manager_unregister_job_id( globus_gram_job_manager_t * manager, char * job_id) { int rc = GLOBUS_SUCCESS; globus_gram_job_id_ref_t * ref; if (job_id == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; goto null_job_id; } GlobusGramJobManagerLock(manager); ref = globus_hashtable_remove(&manager->job_id_hash, (void *) job_id); if (!ref) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; goto no_such_job; } free(ref->job_contact_path); free(ref->job_id); free(ref); no_such_job: GlobusGramJobManagerUnlock(manager); null_job_id: return rc; } /* globus_gram_job_manager_unregister_job_id() */ /** * Resolve a local job id to a request, adding a reference to it. This * is called with the manager locked. * * @param manager * Job manager state. Must have its mutex locked. * @param jobid * individual lrm job id string. * @param request * pointer to be set to the corresponding job request if found in the * table. may be null if the caller already has a reference and wants to * add one. * * @retval globus_success * success. * @retval globus_gram_protocol_error_job_contact_not_found * job contact not found. */ int globus_gram_job_manager_add_reference_by_jobid( globus_gram_job_manager_t * manager, const char * jobid, const char * reason, globus_gram_jobmanager_request_t ** request) { int rc = GLOBUS_SUCCESS; globus_result_t result; globus_gram_job_id_ref_t * jobref; globus_list_t * pending_restart_ref; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.add_reference_by_jobid.start " "level=TRACE " "jobid=\"%s\" " "reason=\"%s\" " "\n", jobid, reason); if (request) { *request = NULL; } if (manager->stop) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.add_reference_by_jobid.end " "level=WARN " "jobid=\"%s\" " "status=%d " "reason=\"%s\" " "\n", jobid, -rc, globus_gram_protocol_error_string(rc)); goto stop; } jobref = globus_hashtable_lookup(&manager->job_id_hash, (void *) jobid); if (!jobref) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.add_reference_by_jobid.end " "level=DEBUG " "jobid=\"%s\" " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", jobid, -rc, "Unknown job ID", globus_gram_protocol_error_string(rc)); goto no_such_job; } rc = globus_l_gram_add_reference_locked( manager, jobref->job_contact_path, reason, request); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.add_reference_by_jobid.end " "level=ERROR " "jobid=\"%s\" " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", jobid, -rc, "Adding reference failed", globus_gram_protocol_error_string(rc)); goto failed_add; } /* GRAM-128: Scalable reloading of requests at job manager restart. * * This code handles the case where a job in the pending_restart list * is being reloaded by a SEG event. In this case, we'll do the following: * - Remove the contact from the pending_restarts list * - If it is a waiting-for-job-change state, pause the seg * - Add another reference to the job for the state machine and register * the state machine callback */ if ((*request) != NULL && (pending_restart_ref = globus_list_search_pred(manager->pending_restarts, globus_hashtable_string_keyeq, (*request)->job_contact_path)) != NULL) { globus_list_remove(&manager->pending_restarts, pending_restart_ref); rc = globus_l_gram_add_reference_locked( manager, jobref->job_contact_path, "state machine", request); if (rc != GLOBUS_SUCCESS) { goto remove_reference; } if ((*request)->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1 || (*request)->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2 || (*request)->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1 || (*request)->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2) { globus_gram_job_manager_seg_pause(manager); } result = globus_callback_register_oneshot( &(*request)->poll_timer, NULL, globus_gram_job_manager_state_machine_callback, *request); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_l_gram_job_manager_remove_reference_locked( manager, jobref->job_contact_path, "state machine"); } } remove_reference: if (rc != GLOBUS_SUCCESS) { globus_l_gram_job_manager_remove_reference_locked( manager, jobref->job_contact_path, reason); } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.add_reference_by_jobid.end " "level=TRACE " "jobid=\"%s\" " "status=%d " "\n", jobid, 0); } failed_add: no_such_job: stop: return rc; } /* globus_gram_job_manager_add_reference_by_jobid() */ /** * Store the job state in the manager so that the request can be swapped out * * @param manager * Job manager state * @param key * Job request key * @param state * Job state * @param failure_code * Job failure code * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND * Job contact not found */ int globus_gram_job_manager_set_status( globus_gram_job_manager_t * manager, const char * key, globus_gram_protocol_job_state_t state, int failure_code, int exit_code) { globus_gram_job_manager_ref_t * ref; int rc = GLOBUS_SUCCESS; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.set_job_status.start " "level=TRACE " "gramid=%s " "state=%d " "failure_code=%d " "\n", key, state, failure_code); GlobusGramJobManagerLock(manager); ref = globus_hashtable_lookup( &manager->request_hash, (void *) key); if (ref == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; goto not_found; } ref->job_state = state; ref->failure_code = failure_code; ref->exit_code = exit_code; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.set_job_status.end " "level=TRACE " "gramid=%s " "state=%d " "failure_code=%d " "status=%d " "\n", key, state, failure_code, 0); not_found: GlobusGramJobManagerUnlock(manager); return rc; } /* globus_gram_job_manager_set_status() */ /** * Look up the job state for a request without reloading the request * * @param manager * Job manager state * @param key * Job request key * @param state * Pointer to set to the value of the job state * @param failure_code * Pointer to set to the value of the failure code * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND * Job contact not found */ int globus_gram_job_manager_get_status( globus_gram_job_manager_t * manager, const char * key, globus_gram_protocol_job_state_t * state, int * failure_code, int * exit_code) { int rc = GLOBUS_SUCCESS; globus_gram_job_manager_ref_t * ref; GlobusGramJobManagerLock(manager); ref = globus_hashtable_lookup( &manager->request_hash, (void *) key); if (ref == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; goto not_found; } ref->status_count++; *state = ref->job_state; *failure_code = ref->failure_code; *exit_code = ref->exit_code; not_found: GlobusGramJobManagerUnlock(manager); return rc; } /* globus_gram_job_manager_get_status() */ int globus_gram_job_manager_get_job_id_list( globus_gram_job_manager_t * manager, globus_list_t ** job_id_list) { char * job_id; globus_gram_job_id_ref_t * ref; int rc = GLOBUS_SUCCESS; *job_id_list = NULL; GlobusGramJobManagerLock(manager); for (ref = globus_hashtable_first(&manager->job_id_hash); ref != NULL; ref = globus_hashtable_next(&manager->job_id_hash)) { job_id = strdup(ref->job_id); if (job_id == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto job_id_strdup_failed; } rc = globus_list_insert(job_id_list, job_id); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto job_id_insert_failed; } } if (rc != GLOBUS_SUCCESS) { job_id_insert_failed: free(job_id); job_id_strdup_failed: globus_list_destroy_all(*job_id_list, free); *job_id_list = NULL; } GlobusGramJobManagerUnlock(manager); return rc; } /* globus_gram_job_manager_get_job_id_list() */ globus_bool_t globus_gram_job_manager_request_exists( globus_gram_job_manager_t * manager, const char * key) { globus_bool_t result; globus_gram_job_manager_ref_t * ref; GlobusGramJobManagerLock(manager); ref = globus_hashtable_lookup(&manager->request_hash, (void *) key); result = (ref != NULL && ref->request != NULL); GlobusGramJobManagerUnlock(manager); return result; } /* globus_gram_job_manager_request_exists() */ void globus_gram_job_manager_set_grace_period_timer( globus_gram_job_manager_t * manager) { if (globus_hashtable_empty(&manager->request_hash)) { globus_reltime_t delay; globus_result_t result; GlobusTimeReltimeSet(delay, globus_l_gram_grace_period_delay, 0); result = globus_callback_register_oneshot( &manager->grace_period_timer, &delay, globus_l_gram_job_manager_grace_period_expired, manager); if (result != GLOBUS_SUCCESS) { manager->done = GLOBUS_TRUE; globus_cond_signal(&manager->cond); } } } /* globus_gram_job_manager_set_grace_period_timer() */ /** * Fake a two-phase commit for jobs that are in a done state, but are older * than their expiration time. * * @param arg * Pointer to the job manager structure for this job. * @return void */ void globus_gram_job_manager_expire_old_jobs( void * arg) { globus_gram_job_manager_t * manager = arg; globus_gram_job_manager_ref_t * ref; globus_gram_jobmanager_request_t * request; int rc; time_t now; int expired = 0; now = time(NULL); GlobusGramJobManagerLock(manager); for (ref = globus_hashtable_first(&manager->request_hash); ref != NULL; ref = globus_hashtable_next(&manager->request_hash)) { if (ref->reference_count == 0 && ref->expiration_time != 0 && now > ref->expiration_time) { rc = globus_l_gram_add_reference_locked( manager, ref->key, "expire", &request); if (rc != GLOBUS_SUCCESS) { continue; } ref->expiration_time = 0; if (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END || request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE) { /* Fake the commit */ globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.expire_jobs.info " "level=DEBUG " "gramid=%s " "\n", ref->key); request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED; rc = globus_l_gram_add_reference_locked( manager, ref->key, "state machine", NULL); if (request->poll_timer == GLOBUS_NULL_HANDLE) { globus_result_t result; result = globus_callback_register_oneshot( &request->poll_timer, &globus_i_reltime_zero, globus_gram_job_manager_state_machine_callback, request); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto oneshot_failed; } } expired++; } oneshot_failed: rc = globus_l_gram_job_manager_remove_reference_locked( manager, ref->key, "expire"); if (rc != GLOBUS_SUCCESS) { } } } GlobusGramJobManagerUnlock(manager); if (expired > 0) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.expire_jobs.end " "expired_count=%d " "\n", expired); } } /* globus_gram_job_manager_expire_old_jobs() */ void globus_gram_job_manager_stop_all_jobs( globus_gram_job_manager_t * manager) { globus_list_t * job_refs = NULL; globus_list_t * tmp = NULL; globus_gram_job_manager_ref_t * ref; globus_gram_jobmanager_request_t * request; int rc; GlobusGramJobManagerLock(manager); manager->stop = GLOBUS_TRUE; rc = globus_hashtable_to_list( &manager->request_hash, &job_refs); if (rc != GLOBUS_SUCCESS) { GlobusGramJobManagerUnlock(manager); return; } tmp = job_refs; while (!globus_list_empty(tmp)) { ref = globus_list_first(tmp); tmp = globus_list_rest(tmp); /* Force request into memory if it isn't yet. */ rc = globus_l_gram_add_reference_locked( manager, ref->key, "stop all jobs", NULL); assert(rc == GLOBUS_SUCCESS); } GlobusGramJobManagerUnlock(manager); tmp = job_refs; while (!globus_list_empty(tmp)) { ref = globus_list_first(tmp); tmp = globus_list_rest(tmp); request = ref->request; GlobusGramJobManagerRequestLock(request); request->stop_reason = GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_EXPIRED; request->restart_state = request->jobmanager_state; switch (request->jobmanager_state) { case GLOBUS_GRAM_JOB_MANAGER_STATE_START: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; request->unsent_status_change = GLOBUS_TRUE; globus_gram_job_manager_state_machine_register( request->manager, request, NULL); break; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN: case GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; request->unsent_status_change = GLOBUS_TRUE; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_FILE_CLEAN_UP: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_SCRATCH_CLEAN_UP: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_CACHE_CLEAN_UP: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_DONE: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_FILE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CACHE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE: case GLOBUS_GRAM_JOB_MANAGER_STATE_STOP: break; } if (request->poll_timer) { globus_reltime_t delay; GlobusTimeReltimeSet(delay, 0, 0); globus_callback_adjust_oneshot( request->poll_timer, &delay); } GlobusGramJobManagerRequestUnlock(request); globus_gram_job_manager_remove_reference( manager, ref->key, "stop all jobs"); } globus_list_free(job_refs); } /* globus_gram_job_manager_stop_all_jobs() */ /** * Scan the job state directory for jobs to restart * * The globus_gram_job_manager_request_load_all() function scans the * job state directory named in the job manager configuration and then * attempts to reload each job found in that directory. If the job is in * a state where it will be immediately swapped out (waiting for SEG events) * then the job is registered for processing * * @param manager * Job Manager */ int globus_gram_job_manager_request_load_all( globus_gram_job_manager_t * manager) { int rc = GLOBUS_SUCCESS; char * state_file_pattern = NULL; GlobusGramJobManagerLock(manager); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.reload_requests.start " "level=DEBUG " "\n"); state_file_pattern = globus_common_create_string( "job.%s.%%"PRIu64".%%"PRIu64"%%n", manager->config->hostname); if (state_file_pattern == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.reload_requests.end " "level=ERROR " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", -rc, "Malloc failed", errno, strerror(errno)); goto state_file_pattern_alloc_failed; } globus_l_gram_job_manager_request_load_all_from_dir( manager, manager->config->job_state_file_dir, state_file_pattern); free(state_file_pattern); state_file_pattern = NULL; { char * hashed_job_dir; state_file_pattern = globus_common_create_string( "job.%%"PRIu64".%%"PRIu64"%%n"); if (state_file_pattern == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto state_file_pattern_alloc_failed; } hashed_job_dir = globus_common_create_string( "%s/%s/%s/%s", manager->config->job_state_file_dir, manager->config->logname, manager->config->service_tag, manager->config->jobmanager_type); if (hashed_job_dir == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto hashed_job_dir_alloc_failed; } globus_l_gram_job_manager_request_load_all_from_dir( manager, hashed_job_dir, state_file_pattern); free(hashed_job_dir); } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.reload_requests.end " "level=DEBUG " "statedir=\"%s\" " "status=%d " "requests=%d " "\n", manager->config->job_state_file_dir, 0, (int) globus_list_size(manager->pending_restarts)); hashed_job_dir_alloc_failed: if (state_file_pattern) { free(state_file_pattern); } state_file_pattern_alloc_failed: GlobusGramJobManagerUnlock(manager); return rc; } /* globus_gram_job_manager_request_load_all() */ static int globus_l_gram_job_manager_request_load_all_from_dir( globus_gram_job_manager_t * manager, const char * state_file_dir, const char * state_file_pattern) { int rc; DIR * dir; int lock; struct dirent * entry; uint64_t uniq1, uniq2; globus_gram_jobmanager_request_t * request; globus_gram_job_manager_ref_t * ref; struct stat st; char * full_path; uid_t uid = getuid(); dir = globus_libc_opendir(state_file_dir); if (dir == NULL && strcmp(state_file_dir, manager->config->job_state_file_dir) == 0) { int save_errno = errno; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.reload_requests.end " "level=ERROR " "statedir=\"%s\" " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", state_file_dir, "opendir failed", errno, strerror(errno)); rc = GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED; if (manager->gt3_failure_message == NULL) { manager->gt3_failure_message = globus_common_create_string( "the job manager failed to open the job state file directory \"%s\": %s", state_file_dir, strerror(save_errno)); } goto opendir_failed; } else if (dir == NULL) { rc = GLOBUS_SUCCESS; goto opendir_failed; } while ((rc = globus_libc_readdir_r(dir, &entry)) == 0 && entry != NULL) { if ((sscanf( entry->d_name, state_file_pattern, &uniq1, &uniq2, &lock) == 2) && (strlen(entry->d_name + lock) == 0)) { /* Found candidate job state file. */ char * key = globus_common_create_string( "/%"PRIu64"/%"PRIu64"/", uniq1, uniq2); if (key == NULL) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.reload_requests.info " "level=WARN " "statedir=\"%s\" " "file=\"%s\" " "msg=\"%s\" " "gramid=/%"PRIu64"/%"PRIu64"/ " "errno=%d " "reason=\"%s\"\n", state_file_dir, entry->d_name, "Error constructing filename, ignoring state file", uniq1, uniq2, errno, strerror(errno)); free(entry); continue; } full_path = globus_common_create_string("%s/%s", state_file_dir, entry->d_name); if (full_path == NULL) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.reload_requests.info " "level=WARN " "statedir=\"%s\" " "file=\"%s\" " "msg=\"%s\" " "gramid=/%"PRIu64"/%"PRIu64"/ " "errno=%d " "reason=\"%s\"\n", state_file_dir, entry->d_name, "Error constructing filename, ignoring state file", uniq1, uniq2, errno, strerror(errno)); free(key); key = NULL; free(entry); entry = NULL; continue; } rc = stat(full_path, &st); free(full_path); full_path = NULL; if (rc < 0) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.reload_requests.info " "level=TRACE " "statedir=\"%s\" " "file=\"%s\" " "msg=\"%s\" " "gramid=/%"PRIu64"/%"PRIu64"/ " "errno=%d " "reason=\"%s\"\n", state_file_dir, entry->d_name, "Error checking state file ownership, ignoring state file", uniq1, uniq2, errno, strerror(errno)); free(key); key = NULL; free(entry); entry = NULL; continue; } if (st.st_uid != uid) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.reload_requests.info " "level=TRACE " "statedir=\"%s\" " "statefile=\"%s\" " "msg=\"Ignoring state file\" " "reason=\"File UID is %d, my UID is %d\"\n", state_file_dir, entry->d_name, (int) st.st_uid, (int) uid); free(key); key = NULL; free(entry); entry = NULL; continue; } rc = globus_l_gram_restart_job( manager, &request, key+1); free(entry); if (rc != GLOBUS_SUCCESS) { if (rc != GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.reload_requests.info " "level=WARN " "statedir=\"%s\" " "msg=\"%s\" " "gramid=/%"PRIu64"/%"PRIu64"/ " "status=%d " "reason=\"%s\"\n", state_file_dir, "Error restarting job", uniq1, uniq2, -rc, globus_gram_protocol_error_string(rc)); } free(key); continue; } /* Set the SEG timestamp to be the earliest value in any of the * jobs we will manage. */ if (manager->seg_last_timestamp == 0 || manager->seg_last_timestamp > request->seg_last_timestamp) { manager->seg_last_timestamp = request->seg_last_timestamp; } /* Optimize the (hopefully) common case. The job is pending * or active in the queue and we will want to wait for * job state changes. In this case, we add the reference to * the job's LRM job id */ if ((request->config->seg_module != NULL || strcmp(request->config->jobmanager_type, "fork") == 0 || strcmp(request->config->jobmanager_type, "condor") == 0) && (request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1 || request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2 || request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1 || request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2)) { rc = globus_gram_job_manager_register_job_id( request->manager, request->job_id_string, request, GLOBUS_TRUE); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.reload_requests.info " "level=WARN " "statedir=\"%s\" " "msg=\"%s\" " "gramid=/%"PRIu64"/%"PRIu64"/ " "status=%d " "reason=\"%s\" " "\n", state_file_dir, "Error registering job id", uniq1, uniq2, -rc, globus_gram_protocol_error_string(rc)); } request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2; } /* Add a stub in the job manager's request_hash for this job. The * Reference count will be left at 0, and we will null out the * ref->request pointer below. This allows queries, SEG events, and * the restart code to look up the job ID without the entire * request remaining in memory. */ rc = globus_l_gram_job_manager_add_ref_stub( request->manager, request->job_contact_path, request, &ref); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.reload_requests.info " "level=WARN " "statedir=\"%s\" " "msg=\"%s\" " "gramid=%"PRIu64"/%"PRIu64" " "status=%d " "reason=\"%s\" " "\n", state_file_dir, "Error registering job id", uniq1, uniq2, -rc, globus_gram_protocol_error_string(rc)); } if (ref != NULL) { /* We don't want to keep this reference active. We want it * to look like the job was swapped out */ ref->request = NULL; } if (request && request->jobmanager_state != GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2) { rc = globus_list_insert( &manager->pending_restarts, key); key = NULL; } /* Indicate that it will need some special handling when its * first reference is added */ ref->loaded_only = GLOBUS_TRUE; if (request) { globus_gram_job_manager_request_free(request); free(request); request = NULL; } if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.reload_requests.info " "level=WARN " "statedir=\"%s\" " "msg=\"%s\" " "gramid=%"PRIu64"/%"PRIu64" " "errno=%d " "reason=\"%s\"\n", state_file_dir, "Error inserting job into request list", uniq1, uniq2, globus_gram_protocol_error_string(rc)); } if (key) { free(key); key = NULL; } } else { free(entry); } } rc = 0; globus_libc_closedir(dir); opendir_failed: return rc; } /* globus_l_gram_job_manager_request_load_all_from_dir() */ int globus_i_gram_mkdir( char * path) { char * tmp; int rc; struct stat statbuf; if ((rc = stat(path, &statbuf)) < 0) { tmp = path; while (tmp != NULL) { tmp = strchr(tmp+1, '/'); if (tmp != path) { if (tmp != NULL) { *tmp = '\0'; } if ((rc = stat(path, &statbuf)) < 0) { mkdir(path, S_IRWXU); } if ((rc = stat(path, &statbuf)) < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_ARG_FILE_CREATION_FAILED; goto error_exit; } if (tmp != NULL) { *tmp = '/'; } } } } rc = GLOBUS_SUCCESS; error_exit: if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_ARG_FILE_CREATION_FAILED; } return rc; } /* globus_i_gram_mkdir() */ static void globus_l_gram_job_manager_grace_period_expired( void * arg) { globus_gram_job_manager_t * manager; manager = arg; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.grace_period_expired.start " "level=TRACE " "\n"); GlobusGramJobManagerLock(manager); if (manager->grace_period_timer != GLOBUS_NULL_HANDLE) { (void) globus_callback_unregister( manager->grace_period_timer, NULL, NULL, NULL); if (globus_hashtable_empty(&manager->request_hash)) { manager->done = GLOBUS_TRUE; globus_cond_signal(&manager->cond); } manager->grace_period_timer = GLOBUS_NULL_HANDLE; } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.grace_period_expired.end " "level=TRACE " "status=%d " "terminating=%s " "\n", 0, manager->done ? "true" : "false"); GlobusGramJobManagerUnlock(manager); } /* globus_l_gram_job_manager_grace_period_expired() */ static void globus_l_gram_ref_swap_out( void * arg) { globus_result_t result; globus_gram_job_manager_ref_t * ref = arg; globus_gram_jobmanager_request_t * request; int rc; globus_gram_job_manager_log( ref->manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.job_ref_swap_out.start " "level=TRACE " "gramid=%s\n", ref->key); GlobusGramJobManagerLock(ref->manager); if (ref->cleanup_timer != GLOBUS_NULL_HANDLE) { result = globus_callback_unregister( ref->cleanup_timer, NULL, NULL, NULL); ref->cleanup_timer = GLOBUS_NULL_HANDLE; if (result != GLOBUS_SUCCESS) { char * errstr; char * errstr_escaped; errstr = globus_error_print_friendly( globus_error_peek(result)); errstr_escaped = globus_gram_prepare_log_string(errstr); globus_gram_job_manager_log( ref->manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.job_ref_swap_out.info " "level=WARN " "gramid=%s " "msg=\"%s\" " "reason=\"%s\" " "\n", ref->key, "Error cancelling callback", errstr_escaped ? errstr_escaped : ""); if (errstr) { free(errstr); } if (errstr_escaped) { free(errstr_escaped); } } } else { globus_gram_job_manager_log( ref->manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.job_ref_swap_out.end " "level=TRACE " "gramid=%s " "msg=\"%s\" " "\n", ref->key, "This job was reactivated before the callback, not freeing"); goto unregistered; } if (ref->reference_count == 0) { request = ref->request; request->manager->usagetracker->count_current_jobs--; if (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP && request->stop_reason == GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT) { int expire = -1; globus_gram_job_manager_rsl_attribute_get_int_value( request->rsl, GLOBUS_GRAM_JOB_MANAGER_EXPIRATION_ATTR, &expire); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.job_ref_swap_out.info " "level=DEBUG " "gramid=%s " "expire=%d " "\n", ref->key, expire); if (expire != -1) { ref->expiration_time = time(NULL) + (time_t) expire; } } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.job_ref_swap_out.info " "level=WARN " "gramid=%s " "msg=\"%s\" " "\n", ref->key, "No new references to job, writing state and freeing data"); /* Is this needed? */ rc = globus_gram_job_manager_state_file_write(ref->request); globus_gram_job_manager_request_free(ref->request); free(ref->request); ref->request = NULL; } else { globus_gram_job_manager_log( ref->manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.job_ref_swap_out.info " "level=TRACE " "gramid=%s " "msg=\"%s\" " "\n", ref->key, "New references to job, not freeing"); } unregistered: GlobusGramJobManagerUnlock(ref->manager); } /* globus_l_gram_ref_swap_out() */ static int globus_l_gram_add_reference_locked( globus_gram_job_manager_t * manager, const char * key, const char * reason, globus_gram_jobmanager_request_t ** request) { int rc = GLOBUS_SUCCESS; globus_result_t result; globus_gram_job_manager_ref_t * ref; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.add_reference.start " "level=TRACE " "gramid=%s " "ref_reason=\"%s\"\n", key, reason); ref = globus_hashtable_lookup(&manager->request_hash, (void *) key); if (ref) { ref->reference_count++; if (ref->cleanup_timer != GLOBUS_NULL_HANDLE) { result = globus_callback_unregister( ref->cleanup_timer, NULL, NULL, NULL); ref->cleanup_timer = GLOBUS_NULL_HANDLE; } if (ref->request == NULL) { rc = globus_l_gram_restart_job( manager, &ref->request, key+1); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; ref->reference_count--; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.add_reference.end " "level=WARN " "gramid=%s " "ref_reason=\"%s\" " "status=%d " "reason=\"%s\" " "\n", key, reason, -rc, globus_gram_protocol_error_string(rc)); goto request_init_failed; } if (ref->request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1 || ref->request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2 || ref->request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1 || ref->request->restart_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2) { ref->request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2; } else if (!ref->loaded_only) { ref->request->jobmanager_state = ref->request->restart_state; } ref->loaded_only = GLOBUS_FALSE; ref->request->job_stats.status_count += ref->status_count; ref->status_count = 0; } if (request) { *request = ref->request; } } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; if (request) { *request = NULL; } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.add_reference.end " "level=WARN " "gramid=%s " "status=%d " "reason=\"%s\" " "ref_reason=\"%s\"\n", key, -rc, globus_gram_protocol_error_string(rc), reason); goto not_found; } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.add_reference.end " "level=TRACE " "gramid=%s " "status=%d " "ref_reason=\"%s\"\n", key, 0, reason); not_found: request_init_failed: return rc; } /* globus_l_gram_add_reference_locked() */ static int globus_l_gram_restart_job( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t ** request, const char * job_contact_path) { char * restart_rsl; int rc; /* Reload request state */ restart_rsl = globus_common_create_string( "&(restart = '%s%s')(restartcontacts = yes)", manager->url_base, job_contact_path); if (restart_rsl == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_restart_rsl_failed; } rc = globus_gram_job_manager_request_init( request, manager, restart_rsl, GSS_C_NO_CREDENTIAL, GSS_C_NO_CONTEXT, NULL, GLOBUS_TRUE, NULL, NULL, NULL); free(restart_rsl); malloc_restart_rsl_failed: return rc; } /* globus_l_gram_restart_job() */ static int globus_l_gram_read_job_manager_cred( globus_gram_job_manager_t * manager, const char * cred_path, gss_cred_id_t * cred) { int rc; FILE * fp; struct stat stat; gss_buffer_desc buffer; OM_uint32 major_status; OM_uint32 minor_status; fp = fopen(manager->cred_path, "r"); if (fp == NULL) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.read_cred.end cred=%s errno=%d reason=\"%s\"\n", manager->cred_path, errno, strerror(errno)); rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; goto fopen_failed; } if (fstat(fileno(fp), &stat) != 0) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.read_cred.end level=ERROR cred=%s errno=%d " "reason=\"%s\"\n", manager->cred_path, errno, strerror(errno)); rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; goto fstat_failed; } if (stat.st_uid != getuid() || (stat.st_mode & (S_IRWXG|S_IRWXO))) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.read_cred.end level=ERROR cred=%s error=%d " "reason=\"%s\"\n", manager->cred_path, GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY, "Invalid file ownership or permissions"); rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; goto perm_check_failed; } buffer.length = (size_t) stat.st_size; buffer.value = malloc(buffer.length+1); if (buffer.value == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto buffer_malloc_failed; } rc = fread(buffer.value, 1, buffer.length, fp); ((char *)buffer.value)[buffer.length] = 0; if (rc != buffer.length) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; goto fread_failed; } major_status = gss_import_cred( &minor_status, cred, GSS_C_NO_OID, 0, &buffer, 0, NULL); if (GSS_ERROR(major_status)) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.read_cred.end level=ERROR cred=%s major_status=%d " "reason=\"%s\"\n", manager->cred_path, major_status, "import cred failed"); goto import_failed; } rc = GLOBUS_SUCCESS; import_failed: free(buffer.value); fread_failed: buffer_malloc_failed: perm_check_failed: fstat_failed: fclose(fp); fopen_failed: return rc; } /* globus_l_gram_read_job_manager_cred() */ static int globus_l_gram_script_attr_init( globus_gram_job_manager_t * manager) { globus_result_t result; int rc = GLOBUS_SUCCESS; char * pipe_cmd[6]; char * env[8]; int i; result = globus_eval_path( "${libexecdir}/globus-job-manager-script.pl", &pipe_cmd[0]); if (result != GLOBUS_SUCCESS || pipe_cmd[0] == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto script_path_malloc_failed; } globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.script.start " "level=DEBUG\n"); pipe_cmd[1] = "-m"; pipe_cmd[2] = manager->config->jobmanager_type; pipe_cmd[3] = "-c"; pipe_cmd[4] = "interactive"; pipe_cmd[5] = NULL; memset(env, 0, sizeof(env)); i = 0; if (manager->config->globus_location) { env[i++] = globus_common_create_string( "GLOBUS_LOCATION=%s", manager->config->globus_location); } env[i++] = globus_common_create_string( "GLOBUS_SPOOL_DIR=%s", manager->config->job_state_file_dir); env[i++] = globus_common_create_string( "HOME=%s", manager->config->home); env[i++] = globus_common_create_string( "LOGNAME=%s", manager->config->logname); /* PATH is set in main, so we know it'll be non-null */ env[i++] = globus_common_create_string( "PATH=%s", getenv("PATH")); if (manager->config->x509_cert_dir) { env[i++] = globus_common_create_string( "X509_CERT_DIR=%s", manager->config->x509_cert_dir); } if (manager->config->tcp_port_range) { env[i++] = globus_common_create_string( "GLOBUS_TCP_PORT_RANGE=%s", manager->config->tcp_port_range); } env[i] = NULL; for (--i; i >= 0; i--) { if (!env[i]) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto env_strings_failed; } } result = globus_xio_attr_init(&manager->script_attr); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_JOBMANAGER_SCRIPT; goto attr_init_failed; } result = globus_xio_attr_cntl( manager->script_attr, globus_i_gram_job_manager_popen_driver, GLOBUS_XIO_POPEN_SET_PROGRAM, pipe_cmd); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_JOBMANAGER_SCRIPT; goto attr_cntl_program_failed; } result = globus_xio_attr_cntl( manager->script_attr, globus_i_gram_job_manager_popen_driver, GLOBUS_XIO_POPEN_SET_CHILD_ENV, env); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_JOBMANAGER_SCRIPT; goto attr_cntl_env_failed; } result = globus_xio_attr_cntl( manager->script_attr, globus_i_gram_job_manager_popen_driver, GLOBUS_XIO_POPEN_SET_BLOCKING_IO, 1); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_JOBMANAGER_SCRIPT; attr_cntl_env_failed: attr_cntl_program_failed: globus_xio_attr_destroy(manager->script_attr); } attr_init_failed: env_strings_failed: for (i = 0; i < 8; i++) { if (env[i] != NULL) { free(env[i]); } } free(pipe_cmd[0]); script_path_malloc_failed: return rc; } /* globus_l_gram_script_attr_init() */ int globus_gram_split_subjobs( const char * job_id, globus_list_t ** subjobs) { char * tok_end = NULL; char * job_id_string; char * job_id_string_copy; int rc = GLOBUS_SUCCESS; job_id_string_copy = strdup(job_id); if (job_id_string_copy == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto job_id_copy_failed; } for (tok_end = NULL, job_id_string = strtok_r(job_id_string_copy, ",", &tok_end); job_id_string != NULL; job_id_string = strtok_r(NULL, ",", &tok_end)) { char * subjob_id = NULL; subjob_id = strdup(job_id_string); if (subjob_id == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto strdup_failed; } rc = globus_list_insert(subjobs, subjob_id); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; free(subjob_id); goto insert_failed; } } if (rc != GLOBUS_SUCCESS) { insert_failed: strdup_failed: globus_list_destroy_all(*subjobs, free); *subjobs = NULL; } free(job_id_string_copy); job_id_copy_failed: return rc; } /* globus_gram_split_subjobs() */ globus_gram_job_manager-13.53/globus_gram_job_manager_state.c0000666000076400007640000022502311754777371021527 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_gram_job_manager_state.c Job Manager State Machine * * CVS Information: * * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_job_manager_state.c,v $ * $Date: 2012/05/16 19:24:41 $ * $Revision: 1.55.2.7 $ * $Author: bester $ */ #include "globus_gram_job_manager.h" #include "globus_rsl_assist.h" #include "globus_gsi_system_config.h" #include "globus_gsi_system_config_constants.h" #include "version.h" #include /* Module Specific Prototypes */ const char * globus_i_gram_job_manager_state_strings[] = { "GLOBUS_GRAM_JOB_MANAGER_STATE_START", "GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE", "GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED", "GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN", "GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT", "GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1", "GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2", "GLOBUS_GRAM_JOB_MANAGER_STATE_CLOSE_OUTPUT", "GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT", "GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END", "GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED", "GLOBUS_GRAM_JOB_MANAGER_STATE_FILE_CLEAN_UP", "GLOBUS_GRAM_JOB_MANAGER_STATE_SCRATCH_CLEAN_UP", "GLOBUS_GRAM_JOB_MANAGER_STATE_CACHE_CLEAN_UP", "GLOBUS_GRAM_JOB_MANAGER_STATE_DONE", "GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED", "GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT", "GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE", "GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED", "GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_FILE_CLEAN_UP", "GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP", "GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CACHE_CLEAN_UP", "GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE", "GLOBUS_GRAM_JOB_MANAGER_STATE_STOP", "GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1", "GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2", NULL, /*"GLOBUS_GRAM_JOB_MANAGER_STATE_PROXY_REFRESH ,*/ "GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT", "GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1", "GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2", NULL /*"GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_PROXY_REFRESH" */ }; static globus_bool_t globus_l_gram_job_manager_set_restart_state( globus_gram_jobmanager_request_t * request); static int globus_l_gram_job_manager_add_cache_info( globus_gram_jobmanager_request_t * request); static void globus_l_gram_job_manager_cancel_queries( globus_gram_jobmanager_request_t * request); static int globus_l_gram_gss_send_fd( void * arg, void * buffer, size_t length); static void globus_l_gram_file_cleanup( globus_gram_jobmanager_request_t * request); static globus_bool_t globus_l_gram_job_manager_state_machine( globus_gram_jobmanager_request_t * request); #endif /* * Callback to enter the state machine from a timeout. Used to * handle two-phase commit timeouts, and delays between calls to the * poll script. */ void globus_gram_job_manager_state_machine_callback( void * user_arg) { globus_gram_jobmanager_request_t * request; globus_bool_t event_registered; int rc; request = user_arg; GlobusGramJobManagerRequestLock(request); /* * If nobody tried to cancel this callback, then we need to unregister * it to free memory in the callback code. */ if(request->poll_timer != GLOBUS_HANDLE_TABLE_NO_HANDLE) { globus_callback_unregister(request->poll_timer, NULL, NULL, NULL); request->poll_timer = GLOBUS_HANDLE_TABLE_NO_HANDLE; } do { event_registered = globus_l_gram_job_manager_state_machine(request); } while(!event_registered); GlobusGramJobManagerRequestUnlock(request); rc = globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "state machine"); assert(rc == GLOBUS_SUCCESS); } /* globus_gram_job_manager_state_machine_callback() */ /* * Job Manager state machine. */ static globus_bool_t globus_l_gram_job_manager_state_machine( globus_gram_jobmanager_request_t * request) { globus_bool_t event_registered = GLOBUS_FALSE; globus_reltime_t delay_time; int rc = 0; int save_status; int save_jobmanager_state; globus_gram_job_manager_query_t * query; globus_bool_t first_poll = GLOBUS_FALSE; globus_gram_jobmanager_state_t next_state; char exit_code_string[] = "unknown"; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.state_machine.start " "level=TRACE " "gramid=%s " "jmstate=%s " "job_state=%d " "\n", request->job_contact_path, globus_i_gram_job_manager_state_strings[request->jobmanager_state], request->status); switch(request->jobmanager_state) { case GLOBUS_GRAM_JOB_MANAGER_STATE_START: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE; /* * To do a two-phase commit, we need to send an error * message (WAITING_FOR_COMMIT) in the initial reply; otherwise, * we just return the current status code. * * When doing a dry run, we don't send the reply until we would * submit the job (no state callbacks with a dry-run.) */ if(!request->dry_run) { if(request->two_phase_commit != 0 && rc == GLOBUS_SUCCESS) { GlobusTimeReltimeSet(delay_time, request->two_phase_commit, 0); rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay_time); if (rc == GLOBUS_SUCCESS) { event_registered = GLOBUS_TRUE; } } } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE: if(request->two_phase_commit != 0 && request->commit_extend != 0) { GlobusTimeReltimeSet(delay_time, request->commit_extend, 0); request->commit_extend = 0; rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay_time); if (rc == GLOBUS_SUCCESS) { event_registered = GLOBUS_TRUE; } } else if(request->two_phase_commit == 0) { /* Nothing to do here if we are not doing the two-phase * commit protocol */ request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED; } else if(request->jm_restart) { /* * commit didn't happen, but this was a restart of a job manager * so we'll just stop and leave the job manager state. */ request->poll_timer = GLOBUS_HANDLE_TABLE_NO_HANDLE; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; request->stop_reason = GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT; } else { request->poll_timer = GLOBUS_HANDLE_TABLE_NO_HANDLE; /* Send failed message later */ request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT; request->unsent_status_change = GLOBUS_TRUE; } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED: if(request->jm_restart) { if(globus_l_gram_job_manager_set_restart_state(request)) { break; } } request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN; if(globus_gram_job_manager_rsl_need_stage_in(request)) { globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_IN); if(!request->dry_run) { globus_gram_job_manager_contact_state_callback( request, GLOBUS_FALSE); } rc = globus_gram_job_manager_script_stage_in(request); if(rc != GLOBUS_SUCCESS) { request->failure_code = rc; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; } else { event_registered = GLOBUS_TRUE; } } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN: if((!globus_list_empty(request->stage_in_todo)) || (!globus_list_empty(request->stage_in_shared_todo))) { /* Didn't successfully stage in everything. */ request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; if(request->failure_code == GLOBUS_SUCCESS) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_STAGE_IN_FAILED; } break; } request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT; if(request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED && request->dry_run) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED; break; } else if(request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; break; } /* write submit state, so that condor job id recovery can work */ request->restart_state = GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT; globus_gram_job_manager_state_file_write(request); globus_gram_job_manager_seg_pause(request->manager); /* * GRAM-145: GRAM5 Job Manager fails to save SEG timestamps in job * state files * * The request state file needs to contain of the earliest time a SEG * event occurred for this job. The default value of seg_last_timestamp * is 0 which means that the job doesn't care about how far back * in time the SEG looks. We set it to the time the job is submitted so * that if a restart occurs, the job manager will be able to go back * as far as necessary for any of the jobs which are reloaded. */ request->seg_last_timestamp = time(NULL); rc = globus_gram_job_manager_script_submit(request); if(rc != GLOBUS_SUCCESS) { request->failure_code = rc; globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); if(!request->dry_run) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; request->unsent_status_change = GLOBUS_TRUE; } globus_gram_job_manager_seg_resume(request->manager); } else { event_registered = GLOBUS_TRUE; } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT: if(request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED && request->dry_run) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED; globus_gram_job_manager_seg_resume(request->manager); break; } else if(request->job_id_string == NULL) { /* submission failed to generate a job id */ if(request->failure_code == GLOBUS_SUCCESS) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_SUBMIT_UNKNOWN; } globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->unsent_status_change = GLOBUS_TRUE; globus_gram_job_manager_seg_resume(request->manager); } else { rc = globus_gram_job_manager_register_job_id( request->manager, request->job_id_string, request, GLOBUS_FALSE); if (rc != GLOBUS_SUCCESS) { request->failure_code = rc; globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->unsent_status_change = GLOBUS_TRUE; } globus_l_gram_job_manager_add_cache_info(request); globus_gram_job_manager_seg_resume(request->manager); } request->queued_time = time(NULL); globus_gram_job_manager_history_file_create(request); request->job_history_status = request->status; request->restart_state = request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1; globus_gram_job_manager_state_file_write(request); first_poll = GLOBUS_TRUE; /* FALLSTHROUGH so we can act on a job state change returned from * the submit script. */ case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1: if (! globus_fifo_empty(&request->seg_event_queue)) { /* A SEG event occurred recently. Let's update our job state */ globus_gram_job_manager_seg_handle_event(request); } if(request->unsent_status_change) { request->restart_state = request->jobmanager_state; globus_gram_job_manager_state_file_write(request); } /* The request->job_history_status is used to save the last job status * that is stored in history file. If it is different with * request->status, we have to write history file. */ if(request->unsent_status_change && (request->job_history_status != request->status)) { globus_gram_job_manager_history_file_create(request); request->job_history_status = request->status; } if (request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; } else if (request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE || request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT) { /* Job finished! start finalizing */ request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT; break; } else { /* Send job state callbacks if necessary */ if(request->unsent_status_change) { globus_gram_job_manager_contact_state_callback(request, GLOBUS_FALSE); request->unsent_status_change = GLOBUS_FALSE; } if(!globus_fifo_empty(&request->pending_queries)) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1; break; } request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2; if (!first_poll && !request->manager->seg_started) { /* Register next poll of job state */ GlobusTimeReltimeSet( delay_time, request->poll_frequency, 0); rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay_time); if (rc == GLOBUS_SUCCESS) { event_registered = GLOBUS_TRUE; } } else if (request->manager->seg_started) { /* SEG has been started. If there is an event pending, * we should jump to POLL1 state and not set * event_registered, so that we can process it. * * Otherwise, we'll set event_registered and the next * query or SEG event will move the state machine. */ if (! globus_fifo_empty(&request->seg_event_queue)) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1; } else { event_registered = GLOBUS_TRUE; } } } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2: /* timer expired since last poll. start polling again. */ request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1; if (request->config->seg_module == NULL && strcmp(request->config->jobmanager_type, "fork") != 0 && strcmp(request->config->jobmanager_type, "condor") != 0) { rc = globus_gram_job_manager_script_poll(request); } else if (!globus_fifo_empty(&request->seg_event_queue)) { /* We don't want to set event_registered in this case, because * we want to immediately process the event in the queue. */ break; } else { /* Nothing in the SEG queue. We need to stay in this state to * get SEG code to reregister the state machine */ request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2; } if(rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.state_machine.info " "level=WARN " "gramid=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, "Poll failed", -rc, globus_gram_protocol_error_string(rc)); } else { event_registered = GLOBUS_TRUE; } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1: if (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1) { next_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2; } else { next_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2; } /* * timer cancelled since last poll, because we may have some * queries to process */ query = globus_fifo_peek(&request->pending_queries); if (query->type == GLOBUS_GRAM_JOB_MANAGER_SIGNAL) { rc = globus_gram_job_manager_script_signal( request, query); } else if(query->type == GLOBUS_GRAM_JOB_MANAGER_CANCEL) { rc = globus_gram_job_manager_script_cancel( request, query); } if(rc == GLOBUS_SUCCESS) { request->jobmanager_state = next_state; event_registered = GLOBUS_TRUE; } else { globus_fifo_dequeue(&request->pending_queries); query->failure_code = rc; globus_gram_job_manager_query_reply(request, query); if(globus_fifo_empty(&request->pending_queries)) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2; } } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY2: query = globus_fifo_dequeue(&request->pending_queries); /* Frees the query */ globus_gram_job_manager_query_reply( request, query); if(globus_fifo_empty(&request->pending_queries)) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE; GlobusTimeReltimeSet(delay_time, request->two_phase_commit, 0); rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay_time); if (rc == GLOBUS_SUCCESS) { event_registered = GLOBUS_TRUE; } } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_QUERY1; } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2: query = globus_fifo_dequeue(&request->pending_queries); /* Frees the query */ globus_gram_job_manager_query_reply( request, query); if(globus_fifo_empty(&request->pending_queries) && (request->unsent_status_change || !globus_fifo_empty(&request->seg_event_queue))) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1; } else if(globus_fifo_empty(&request->pending_queries)) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2; } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1; } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED: if(request->unsent_status_change) { request->restart_state = request->jobmanager_state; globus_gram_job_manager_state_file_write(request); if (request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT) { globus_gram_job_manager_contact_state_callback( request, GLOBUS_FALSE); request->unsent_status_change = GLOBUS_FALSE; } } if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_CLOSE_OUTPUT; } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT; } save_status = request->status; save_jobmanager_state = request->jobmanager_state; /* Reply to any outstanding queries */ while (!globus_fifo_empty(&request->pending_queries)) { query = globus_fifo_dequeue(&request->pending_queries); query->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; /* Frees the query */ globus_gram_job_manager_query_reply( request, query); } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE: if (request->two_phase_commit != 0 && request->commit_extend != 0 && request->failure_code != GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT) { GlobusTimeReltimeSet(delay_time, request->commit_extend, 0); request->commit_extend = 0; rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay_time); if (rc == GLOBUS_SUCCESS) { event_registered = GLOBUS_TRUE; } } else if (request->two_phase_commit == 0 || !request->client_contacts || request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT) { /* Nothing to do here if we are not doing the two-phase * commit protocol or if we have no client callbacks or this is * clean up from a failed two-phase commit */ if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED; } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED; } } else { request->restart_state = request->jobmanager_state; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STOP; request->stop_reason = GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT; event_registered = GLOBUS_TRUE; } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE_COMMITTED: if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FILE_CLEAN_UP; } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_FILE_CLEAN_UP; } if(globus_gram_job_manager_rsl_need_file_cleanup(request) || strcmp(request->config->jobmanager_type, "condor") == 0) { globus_l_gram_file_cleanup(request); } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_FILE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_FILE_CLEAN_UP: if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FILE_CLEAN_UP) { if(request->status != GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_SCRATCH_CLEAN_UP; } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP; } } else if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_FILE_CLEAN_UP) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP; } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP; } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_SCRATCH_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_SCRATCH_CLEAN_UP: if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_SCRATCH_CLEAN_UP) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_CACHE_CLEAN_UP; } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CACHE_CLEAN_UP; } /* Cache cleanup script cleaned gass cache and jobdir */ globus_gram_job_manager_destroy_directory( request, request->job_dir); globus_gass_cache_cleanup_tag_all( request->cache_handle, request->cache_tag); break; case GLOBUS_GRAM_JOB_MANAGER_STATE_CACHE_CLEAN_UP: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CACHE_CLEAN_UP: if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_CACHE_CLEAN_UP) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_DONE; } else { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE; } if(request->job_state_file) { remove(request->job_state_file); } globus_l_gram_job_manager_cancel_queries(request); break; case GLOBUS_GRAM_JOB_MANAGER_STATE_STOP: /* This state is reached when the job manager decides to stop * between the time the job request reply is sent and the * job manager has noticed stop or failed */ globus_gram_job_manager_contact_state_callback(request, GLOBUS_FALSE); globus_gram_job_manager_state_file_write(request); event_registered = GLOBUS_TRUE; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE: if(request->job_state_file) { remove(request->job_state_file); } globus_l_gram_job_manager_cancel_queries(request); /* Write auditing file if job is DONE or FAILED */ if (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_DONE || request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_DONE) { request->restart_state = request->jobmanager_state; globus_gram_job_manager_auditing_file_write(request); } /* Don't allow any new SEG events to enter the queue */ (void) globus_gram_job_manager_unregister_job_id( request->manager, request->job_id_string); /* Clear any existing SEG events */ while (! globus_fifo_empty(&request->seg_event_queue)) { /* A SEG event occurred recently. Let's update our job state */ globus_gram_job_manager_seg_handle_event(request); } globus_i_gram_send_job_stats(request); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.job.end " "level=ERROR " "gramid=%s " "job_status=%d " "status=%d " "reason=\"%s\"\n", request->job_contact_path, request->status, -request->failure_code, globus_gram_protocol_error_string(request->failure_code)); event_registered = GLOBUS_TRUE; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_DONE: globus_l_gram_job_manager_cancel_queries(request); request->restart_state = request->jobmanager_state; globus_gram_job_manager_auditing_file_write(request); event_registered = GLOBUS_TRUE; /* Don't allow any new SEG events to enter the queue */ (void) globus_gram_job_manager_unregister_job_id( request->manager, request->job_id_string); /* Clear any existing SEG events */ while (! globus_fifo_empty(&request->seg_event_queue)) { /* A SEG event occurred recently. Let's update our job state */ globus_gram_job_manager_seg_handle_event(request); } if (request->config->seg_module && request->manager->seg_started) { snprintf( exit_code_string, sizeof(exit_code_string), "%d", (int) request->exit_code & 0xffff); } globus_i_gram_send_job_stats(request); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_INFO, "event=gram.job.end " "level=INFO " "gramid=%s " "job_status=%d " "exit_code=%s " "status=%d " "msg=\"%s\" " "\n", request->job_contact_path, request->status, exit_code_string, 0, "Job complete"); break; case GLOBUS_GRAM_JOB_MANAGER_STATE_CLOSE_OUTPUT: if (request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED && request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_STAGE_OUT_FAILED) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT; break; } request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT; if ((!globus_list_empty(request->stage_stream_todo)) || (!globus_list_empty(request->stage_out_todo))) { rc = globus_gram_job_manager_script_stage_out(request); if(rc != GLOBUS_SUCCESS) { request->failure_code = rc; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; } else { event_registered = GLOBUS_TRUE; request->unsent_status_change = GLOBUS_TRUE; } } else { request->unsent_status_change = GLOBUS_TRUE; } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT: if(!globus_list_empty(request->stage_stream_todo)) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT; if(request->failure_code == GLOBUS_SUCCESS || request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_STAGE_OUT_FAILED) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDOUT; } } else if(!globus_list_empty(request->stage_out_todo)) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT; if(request->failure_code == GLOBUS_SUCCESS) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_STAGE_OUT_FAILED; } } /* FALLSTHROUGH */ case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT: if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END; globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE); } else if(request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_CLOSE_OUTPUT) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE; globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); } if(request->unsent_status_change) { if(request->job_history_status != request->status) { globus_gram_job_manager_history_file_create(request); request->job_history_status = request->status; } /* * If we are doing two-phase_commit, then we will have the * state machine restarted after the job state callback message * is done being processed. */ globus_gram_job_manager_contact_state_callback( request, (request->two_phase_commit != 0)); request->unsent_status_change = GLOBUS_FALSE; if (request->two_phase_commit != 0) { event_registered = GLOBUS_TRUE; } } break; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.state_machine.end " "level=TRACE " "gramid=%s " "jmstate=%s " "job_state=%d " "event_registered=%s " "\n", request->job_contact_path, globus_i_gram_job_manager_state_strings[request->jobmanager_state], request->status, event_registered ? "true" : "false"); return event_registered; } /* globus_gram_job_manager_state_machine() */ /** * Send the response to the initial job request to the GRAM client * * @param request * Job request * @param response_code * GLOBUS_SUCCESS, or a GRAM protocol failure code. * @param job_contact * Job contact * @param response_fd * Descriptor to send response to * @param response_context * GSSAPI context to use to wrap the response message * @param gt3_failure_message * Error information to include in a GRAM extension */ int globus_gram_job_manager_reply( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_t * manager, int response_code, const char * job_contact, int response_fd, gss_ctx_id_t response_context, const char * gt3_failure_message) { int rc; globus_byte_t * reply = NULL; globus_size_t replysize; globus_byte_t * sendbuf; globus_size_t sendsize; OM_uint32 major_status; OM_uint32 minor_status; int token_status; globus_hashtable_t extensions = NULL; globus_gram_protocol_extension_t * extension = NULL; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.reply.start " "level=DEBUG " "gramid=%s " "job_contact=\"%s\" " "response_code=%d " "\n", request ? request->job_contact_path : "", job_contact ? job_contact : "", response_code); rc = globus_hashtable_init( &extensions, 3, globus_hashtable_string_hash, globus_hashtable_string_keyeq); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto hashtable_init_failed; } if (manager != NULL) { extension = globus_gram_protocol_create_extension( "toolkit-version", "%s", manager->config->globus_version); if (extension == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, extension->attribute, extension); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_insert_failed; } extension = NULL; } extension = globus_gram_protocol_create_extension( "version", "%d.%d (%d-%d)", local_version.major, local_version.minor, local_version.timestamp, local_version.branch_id); if (extension == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_create_failed; } rc = globus_hashtable_insert(&extensions, extension->attribute, extension); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_insert_failed; } extension = NULL; if (gt3_failure_message != NULL) { extension = globus_gram_protocol_create_extension( "gt3-failure-message", "%s", gt3_failure_message); if (extension == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_create_failed; } rc = globus_hashtable_insert( &extensions, extension->attribute, extension); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto extension_insert_failed; } extension = NULL; } /* Response to initial job request. */ rc = globus_gram_protocol_pack_job_request_reply_with_extensions( response_code, job_contact, &extensions, &reply, &replysize); if(rc == GLOBUS_SUCCESS) { rc = globus_gram_protocol_frame_reply( 200, reply, replysize, &sendbuf, &sendsize); } else { rc = globus_gram_protocol_frame_reply( 400, NULL, 0, &sendbuf, &sendsize); } if(reply) { free(reply); } if (! response_context) { /* * No response context, the gatekeeper will supply HTTP response line, * so we skip the first line of the framed reply */ reply = strstr(sendbuf, "\r\n"); reply += 2; sendsize -= (reply - sendbuf); memmove(sendbuf, reply, sendsize); } if(rc == GLOBUS_SUCCESS) { if (response_context != GSS_C_NO_CONTEXT) { major_status = globus_gss_assist_wrap_send( &minor_status, response_context, (void *) sendbuf, sendsize, &token_status, globus_l_gram_gss_send_fd, (void *) (intptr_t) response_fd, NULL); if (GSS_ERROR(major_status)) { char * error_string = NULL; char * escaped_error_string; globus_gss_assist_display_status_str( &error_string, "", major_status, minor_status, 0); escaped_error_string = globus_gram_prepare_log_string(error_string); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.reply.end " "level=ERROR " "gramid=%s " "status=%d " "major_status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, -GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED, major_status, "Error sending wrapped response", escaped_error_string ? escaped_error_string : ""); if (error_string) { free(error_string); } if (escaped_error_string) { free(escaped_error_string); } } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.reply.end " "level=DEBUG " "gramid=%s " "status=%d " "\n", request ? request->job_contact_path : "", 0); } if ((!request) || (request && request->response_context != response_context)) { /* In the case of a job restart via RSL, the response context * will not be the same as the request context, but still must * be freed */ gss_delete_sec_context( &minor_status, &response_context, GSS_C_NO_BUFFER); } if (request && !manager->config->enable_callout) { /* Save a some memory by freeing this while the job runs */ gss_delete_sec_context( &minor_status, &request->response_context, GSS_C_NO_BUFFER); request->response_context = GSS_C_NO_CONTEXT; } } else { ssize_t written = 0, rc = 0; do { errno = 0; rc = write(response_fd, sendbuf + written, sendsize - written); if (rc < 0 && errno != EINTR) { break; } written += rc; } while (written < sendsize); major_status = GSS_S_COMPLETE; } free(sendbuf); if (request && major_status != GSS_S_COMPLETE) { globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; } } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.reply.end " "level=ERROR " "gramid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, -rc, major_status, "Error preparing response", globus_gram_protocol_error_string(rc)); globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED; } if (request && rc != GLOBUS_SUCCESS) { request->failure_code = rc; } extension_insert_failed: globus_gram_protocol_hash_destroy(&extensions); extension_create_failed: if (extension) { free(extension->attribute); free(extension->value); free(extension); } hashtable_init_failed: return rc; } /* globus_gram_job_manager_reply() */ int globus_gram_job_manager_read_request( globus_gram_job_manager_t * manager, int fd, size_t content_length, char ** rsl, char ** client_contact, int * job_state_mask, globus_bool_t * version_only) { int rc; globus_hashtable_t extensions; globus_gram_protocol_extension_t * entry; size_t amt_read = 0; globus_byte_t buffer[ GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE]; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.read_request.start " "level=TRACE " "fd=%d\n", fd); *rsl = NULL; *client_contact = NULL; *job_state_mask = 0; *version_only = GLOBUS_FALSE; if (content_length > GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.read_request.end " "level=ERROR " "status=%d " "reason=\"%s\" " "\n", -rc, "RSL too large"); return rc; } do { errno = 0; rc = read(fd, buffer + amt_read, content_length - amt_read); if (rc < 0 && (errno == EINTR || errno == EAGAIN)) { sleep(1); continue; } else if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.read_request.end " "level=ERROR " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", -rc, "Error reading rsl", errno, strerror(errno)); return rc; } else { amt_read += rc; } } while (amt_read < content_length); if (manager->config->log_levels & GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE) { char * message; message = globus_gram_prepare_log_string((char *) buffer); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.read_request.info " "level=TRACE " "request_string=\"%s\" " "\n", message ? message : ""); if (message != NULL) { free(message); } } rc = globus_gram_protocol_unpack_job_request( buffer, content_length, job_state_mask, client_contact, rsl); if(rc == GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED) { rc = globus_gram_protocol_unpack_message( (const char *) buffer, content_length, &extensions); if (rc == GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.read_request.info " "level=TRACE " "msg=\"%s\" ", "Message is not a job request, checking for version " "request"); entry = globus_hashtable_lookup( &extensions, "command"); if (entry != NULL && strcmp(entry->value, "version") == 0) { *version_only = GLOBUS_TRUE; } else { char * buffer_escaped; buffer_escaped = globus_gram_prepare_log_string( (const char *) buffer); rc = GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.read_request.end " "level=ERROR " "status=%d" "request=\"%s\" " "msg=\"%s\" " "reason=\"%s\"\n", -rc, buffer_escaped ? buffer_escaped : "", "Message is not a job or version request", globus_gram_protocol_error_string(rc)); } globus_gram_protocol_hash_destroy(&extensions); } } else if (rc != GLOBUS_SUCCESS) { char * buffer_escaped; buffer_escaped = globus_gram_prepare_log_string( (const char *) buffer); rc = GLOBUS_GRAM_PROTOCOL_ERROR_HTTP_UNPACK_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.read_request.end level=ERROR status=%d" "request=\"%s\" " "msg=\"%s\" reason=\"%s\"\n", -rc, buffer_escaped ? buffer_escaped : "", "Error unpacking message", globus_gram_protocol_error_string(rc)); return rc; } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.read_request.end " "level=TRACE " "status=%d " "\n", 0); return rc; } /* globus_gram_job_manager_read_request() */ /** * Do the state transition for handling a job manager restart. * * @param request * The request to changes states. * * @return * Returns GLOBUS_TRUE if if the job manager's state was * changed as a result of this call; GLOBUS_FALSE otherwise. * * @note This case statement MUST cover all cases where the * state file can be written (where * globus_gram_job_manager_state_file_write() * is called). */ static globus_bool_t globus_l_gram_job_manager_set_restart_state( globus_gram_jobmanager_request_t * request) { globus_bool_t changed = GLOBUS_FALSE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.set_restart_state.start " "level=TRACE " "gramid=%s " "jmstate=%s " "restart_state=%s " "\n", request->job_contact_path, globus_i_gram_job_manager_state_strings[request->jobmanager_state], globus_i_gram_job_manager_state_strings[request->restart_state]); switch(request->restart_state) { case GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT: if (strcmp(request->config->jobmanager_type, "condor") == 0) { int rc; /* * Check if the condor submit happened prior to writing the * job state. if so, we'll have a log we can bootstrap the * job from without resubmitting */ rc = globus_gram_job_manager_seg_parse_condor_id( request, &request->original_job_id_string); if (rc == GLOBUS_SUCCESS && request->original_job_id_string != NULL) { request->job_id_string = strdup( request->original_job_id_string ); globus_gram_job_manager_seg_pause(request->manager); request->status = GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT; changed = GLOBUS_TRUE; } } break; case GLOBUS_GRAM_JOB_MANAGER_STATE_START: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED: case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_IN: break; case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL_QUERY2: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1: case GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2: request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_SUBMIT; changed = GLOBUS_TRUE; break; case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED: case GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE: if (request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_STAGE_OUT_FAILED || request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDOUT || request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDERR) { /* These failure types can be (possibly) remedied in the restart * RSL changing stdout or stderr destinations, so these will * be non-fatal. We'll clear the job status and procede. */ request->failure_code = GLOBUS_SUCCESS; globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT); request->unsent_status_change = GLOBUS_TRUE; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1; changed = GLOBUS_TRUE; break; } else if (request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_STAGING_EXECUTABLE || request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_STAGING_STDIN || request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_STAGE_IN_FAILED) { /* These failure types can be (possibly) remedied in the restart * RSL changing stdin, staging, or executable destinations, so * these will be non-fatal. We'll clear the job status and procede. */ request->failure_code = GLOBUS_SUCCESS; globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_UNSUBMITTED); request->unsent_status_change = GLOBUS_TRUE; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED; changed = GLOBUS_TRUE; break; } else { /* These types of failures can't be helped by a change in stdio, * destination so we continue with the failure */ globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->unsent_status_change = GLOBUS_TRUE; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1; break; } case GLOBUS_GRAM_JOB_MANAGER_STATE_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_PRE_CLOSE_OUTPUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_STAGE_OUT: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END: case GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END_COMMITTED: globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE); request->unsent_status_change = GLOBUS_TRUE; request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1; changed = GLOBUS_TRUE; break; } /*request->restart_state = GLOBUS_GRAM_JOB_MANAGER_STATE_START;*/ globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.set_restart_state.end " "level=TRACE " "gramid=%s " "jmstate=%s " "restart_state=%s " "changed=%s " "\n", request->job_contact_path, globus_i_gram_job_manager_state_strings[request->jobmanager_state], globus_i_gram_job_manager_state_strings[request->restart_state], changed ? "true" : "false"); return changed; } /* globus_l_gram_job_manager_set_restart_state() */ static void globus_l_gram_job_manager_cancel_queries( globus_gram_jobmanager_request_t * request) { globus_gram_job_manager_query_t * query; while(!globus_fifo_empty(&request->pending_queries)) { query = globus_fifo_dequeue(&request->pending_queries); query->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_QUERY_DENIAL; /* Frees the query */ globus_gram_job_manager_query_reply( request, query); } } /* globus_l_gram_job_manager_cancel_queries() */ /** * Validate that the job manager is running as the username specified in the * RSL if it is present. * * @param request * Request which contains information about the job. We'll only look at * the RSL in the request to check for presence of the username attribute. * * @retval GLOBUS_SUCCESS * Either the username RSL attribute was not present, or it was present * and its value matched the account this process is running as. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Some system call failed when we tried to look up the user id. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_USER_NAME * This process is not running as the desired user. */ int globus_gram_job_manager_validate_username( globus_gram_jobmanager_request_t * request) { char * tmp_str = NULL; char * buffer = NULL; struct passwd pwd; struct passwd * pwd_result = NULL; int rc = GLOBUS_SUCCESS; uid_t uid; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.validate_user.start " "level=TRACE " "gramid=%s " "\n", request->job_contact_path); /* Validate username RSL attribute if present */ rc = globus_gram_job_manager_rsl_eval_one_attribute( request, GLOBUS_GRAM_PROTOCOL_USER_NAME, &tmp_str); if (rc != 0) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_user.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "attribute=%s " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, "Error evaluating attribute", GLOBUS_GRAM_PROTOCOL_USER_NAME, -rc, globus_gram_protocol_error_string(rc)); return rc; } if (tmp_str != NULL) { buffer = malloc(1024); if (buffer == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_user.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\"\n", request->job_contact_path, "Malloc failed", -rc, errno, strerror(errno)); goto free_tmp_str_exit; } rc = globus_libc_getpwnam_r( tmp_str, &pwd, buffer, 1024, &pwd_result); if (rc != 0 || pwd_result == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_user.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, "getpwnam_r failed", -rc, errno, strerror(errno)); goto free_buffer_exit; } uid = getuid(); if (pwd.pw_uid != uid) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_USER_NAME; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.validate_user.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "uid=%u " "desired_uid=%u " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, "Job manager not running as desired user", uid, pwd.pw_uid, -rc, globus_gram_protocol_error_string(rc)); goto free_buffer_exit; } } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.validate_user.end " "level=TRACE " "gramid=%s " "status=%d " "\n", request->job_contact_path, 0); free_buffer_exit: if (buffer != NULL) { free(buffer); } free_tmp_str_exit: if (tmp_str != NULL) { free(tmp_str); } return rc; } /* globus_gram_job_manager_validate_username() */ static int globus_l_gram_job_manager_add_cache_info( globus_gram_jobmanager_request_t * request) { char * out_file; char * fname; unsigned long timestamp; FILE * file; char * gk_id; int rc; out_file = globus_common_create_string( "x-gass-cache://%s/%s/cache-info", request->config->hostname, request->uniq_id); rc = globus_gass_cache_add( request->cache_handle, out_file, request->cache_tag, GLOBUS_TRUE, ×tamp, &fname); if(rc != GLOBUS_GASS_CACHE_ADD_NEW && rc != GLOBUS_GASS_CACHE_ADD_EXISTS) { return GLOBUS_FAILURE; } file = fopen(fname,"w"); if (file != NULL) { gk_id = getenv("GATEKEEPER_JM_ID"); if (gk_id == NULL) { gk_id = "-"; } fprintf(file,"%s\n%s\n%s\n%s\n",request->uniq_id,request->job_id_string, request->config->jobmanager_type,gk_id); fclose(file); time((time_t *)×tamp); globus_gass_cache_add_done( request->cache_handle, out_file, request->cache_tag, timestamp); } else { globus_gass_cache_delete( request->cache_handle, out_file, request->cache_tag, timestamp, GLOBUS_TRUE); } free(fname); free(out_file); return 0; } /* globus_l_gram_job_manager_add_cache_info() */ int globus_i_gram_remote_io_url_update( globus_gram_jobmanager_request_t * request) { FILE * fp; int rc = GLOBUS_SUCCESS; fp = fopen(request->remote_io_url_file, "w"); if (fp == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_REMOTE_IO_URL; goto fopen_failed; } rc = fprintf(fp, "%s\n", request->remote_io_url); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_REMOTE_IO_URL; goto fprintf_failed; } fprintf_failed: rc = fclose(fp); if (rc == EOF) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_REMOTE_IO_URL; goto fclose_failed; } fclose_failed: fopen_failed: return rc; } /* globus_i_gram_remote_io_url_update() */ /** * Write a GSSAPI token to a file descriptor * * Unlike the functions in globus_gss_assist, this uses file descriptors, not * FILE * values for @a arg. Writes a 4-byte header for the same conditions * as the function in globus_gss_assist. * * @param arg * Void * cast of the file descriptor number * @param buffer * GSSAPI token buffer to send * @param length * Token length * */ static int globus_l_gram_gss_send_fd( void * arg, void * buffer, size_t length) { unsigned char lengthbuf[4]; unsigned char * header = buffer; int fd; int rc; ssize_t written = 0; fd = (int) (intptr_t) arg; lengthbuf[0] = length >> 24; lengthbuf[1] = length >> 16; lengthbuf[2] = length >> 8; lengthbuf[3] = length; if (!(length > 5 && header[0] <= 26 && header[0] >= 20 && ((header[1] == 3) || (header[1] == 2 && header[2] == 0)))) { written = 0; do { rc = write((int) fd, lengthbuf + written, (size_t) (4 - written)); if (rc < 0) { if (errno == EINTR) { rc = 0; } else { return GLOBUS_GSS_ASSIST_TOKEN_EOF; } } written += rc; } while (written < 4); } written = 0; do { rc = write((int) fd, header + written, (size_t) (length - written)); if (rc < 0) { if (errno == EINTR) { rc = 0; } else { return GLOBUS_GSS_ASSIST_TOKEN_EOF; } } written += rc; } while (written < length); return 0; } /* globus_l_gram_gss_send_fd() */ static void globus_l_gram_file_cleanup( globus_gram_jobmanager_request_t * request) { globus_rsl_t * relation; globus_rsl_value_t * value_sequence; globus_list_t * value_list; globus_rsl_value_t * value; char * path; relation = globus_gram_job_manager_rsl_extract_relation( request->rsl, GLOBUS_GRAM_PROTOCOL_FILE_CLEANUP_PARAM); if (!relation) { goto not_found; } value_sequence = globus_rsl_relation_get_value_sequence(relation); if (!value_sequence) { goto no_sequence; } /* * GRAM-155: Leak in file_clean_up * Old code removed list elements and freed path in the loop, but * neglected to free value. Now all the data is freed in the * globus_rsl_free_recursive() call at the end. */ value_list = globus_rsl_value_sequence_get_value_list(value_sequence); while (!globus_list_empty(value_list)) { value = globus_list_first(value_list); value_list = globus_list_rest(value_list); path = globus_rsl_value_literal_get_string(value); if (path) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.file_cleanup.info " "level=TRACE " "gramid=%s " "path=\"%s\" " "msg=\"About to unlink\" " "\n", request->job_contact_path, path); remove(path); } } no_sequence: globus_rsl_free_recursive(relation); not_found: /* * GRAM-130: Individual Condor Logs per Job */ if (strcmp(request->config->jobmanager_type, "condor") == 0) { char * condor_log = globus_common_create_string( "%s/condor.%s", request->config->job_state_file_dir, request->uniq_id); remove(condor_log); free(condor_log); } return; } /* globus_l_gram_file_cleanup() */ /** * Register the state machine callback callback for this request * * @param manager * Job manager state * @param request * Locked jobmanager request structure. * @param delay * Oneshot delay */ int globus_gram_job_manager_state_machine_register( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, globus_reltime_t * delay) { int rc = GLOBUS_SUCCESS; globus_result_t result; globus_reltime_t nodelay; if (delay == NULL) { GlobusTimeReltimeSet(nodelay, 0, 0); delay = &nodelay; } /* GRAM-128: Scalable reloading of requests at job manager restart. * It's possible now that the job manager has put this job id in the * pending_restarts list. When we add the reference here, if it is in that * list, the state machine will be registered for this job automatically, * with another new reference. So, we'll check if * (request->poll_timer == GLOBUS_NULL_HANDLE) below. If that is true, * then it wasn't in that list and we can procede as we always had done; * otherwise, we'll need to remove the reference we just added. * * See also globus_l_gram_process_pending_restarts() for the other case * where we might expect to add a reference to a partially-reloaded job. */ rc = globus_gram_job_manager_add_reference( manager, request->job_contact_path, "state machine", NULL); if (rc != GLOBUS_SUCCESS) { goto failed_add_reference; } if (request->poll_timer == GLOBUS_NULL_HANDLE) { result = globus_callback_register_oneshot( &request->poll_timer, delay, globus_gram_job_manager_state_machine_callback, request); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto oneshot_failed; } } else { /* GRAM-128: Scalable reloading of requests at job manager restart. * If we get here, then the add_reference call added the state machine * callback already. We need to remove this duplicate reference to * avoid leaving the job in memory forever. */ globus_gram_job_manager_remove_reference( manager, request->job_contact_path, "state machine"); } if (rc != GLOBUS_SUCCESS) { /* Too bad, the state machine couldn't get registered. At least we * can drop the reference count to potentially free some memory. */ oneshot_failed: globus_gram_job_manager_remove_reference( manager, request->job_contact_path, "state machine"); failed_add_reference: ; } return rc; } /* globus_gram_job_manager_state_machine_register() */ globus_gram_job_manager-13.53/lock_test.c0000666000076400007640000000375011256741763015463 00000000000000#include "globus_common.h" #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { int fd; int rc; struct flock fl; pid_t pid; int child_status; if (argc != 2) { fprintf(stderr, "Usage: %s lock-file-path\n", argv[0]); rc = EXIT_FAILURE; goto arg_failed; } fd = open(argv[1], O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); if (fd < 0) { perror("open"); rc = EXIT_FAILURE; goto open_failed; } fl.l_start = 0; fl.l_len = 0; fl.l_pid = 0; fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; rc = fcntl(fd, F_SETLKW, &fl); if (rc < 0) { perror("fcntl"); rc = EXIT_FAILURE; goto fcntl_failed; } pid = fork(); if (pid < 0) { perror("fork"); rc = EXIT_FAILURE; goto fork_failed; } else if (pid == 0) { errno=0; fl.l_start = 0; fl.l_len = 0; fl.l_pid = 0; fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; rc = fcntl(fd,F_SETLK, &fl); if (rc == 0 || (errno != EACCES && errno != EAGAIN)) { perror("fcntl"); rc = EXIT_FAILURE; goto child_lock_failed; } else { rc = 0; rc = EXIT_SUCCESS; } } else { pid = wait(&child_status); if (pid < 0) { perror("wait"); rc = EXIT_FAILURE; goto wait_failed; } else { rc = EXIT_SUCCESS; } } wait_failed: child_lock_failed: fork_failed: fcntl_failed: close(fd); remove(argv[1]); open_failed: arg_failed: exit(rc); } globus_gram_job_manager-13.53/version.h.in0000666000076400007640000000021407457310066015557 00000000000000static globus_version_t local_version = { @GPT_MAJOR_VERSION@, @GPT_MINOR_VERSION@, @DIRT_TIMESTAMP@, @DIRT_BRANCH_ID@ }; globus_gram_job_manager-13.53/globus_gram_job_manager_rsl.dox0000664000076400007640000002622312145177163021542 00000000000000/* this page was automatically generated by ./scripts/create_rsl_documentation.pl */ /** @page globus_gram_job_manager_rsl RSL Attributes This page contains a list of all RSL attributes which are supported by the GRAM Job Manager. @anchor globus_gram_rsl_attribute_arguments @par arguments The command line arguments for the executable. Use quotes, if a space is required in a single argument. @anchor globus_gram_rsl_attribute_count @par count The number of executions of the executable. @anchor globus_gram_rsl_attribute_directory @par directory Specifies the path of the directory the jobmanager will use as the default directory for the requested job. @anchor globus_gram_rsl_attribute_dryrun @par dry_run If dryrun = yes then the jobmanager will not submit the job for execution and will return success. @anchor globus_gram_rsl_attribute_environment @par environment The environment variables that will be defined for the executable in addition to default set that is given to the job by the jobmanager. @anchor globus_gram_rsl_attribute_executable @par executable The name of the executable file to run on the remote machine. If the value is a GASS URL, the file is transferred to the remote gass cache before executing the job and removed after the job has terminated. @anchor globus_gram_rsl_attribute_expiration @par expiration Time (in seconds) after a a job fails to receive a two-phase commit end signal before it is cleaned up. @anchor globus_gram_rsl_attribute_filecleanup @par file_clean_up Specifies a list of files which will be removed after the job is completed. @anchor globus_gram_rsl_attribute_filestagein @par file_stage_in Specifies a list of ("remote URL" "local file") pairs which indicate files to be staged to the nodes which will run the job. @anchor globus_gram_rsl_attribute_filestageinshared @par file_stage_in_shared Specifies a list of ("remote URL" "local file") pairs which indicate files to be staged into the cache. A symlink from the cache to the "local file" path will be made. @anchor globus_gram_rsl_attribute_filestageout @par file_stage_out Specifies a list of ("local file" "remote URL") pairs which indicate files to be staged from the job to a GASS-compatible file server. @anchor globus_gram_rsl_attribute_gasscache @par gass_cache Specifies location to override the GASS cache location. @anchor globus_gram_rsl_attribute_grammyjob @par gram_my_job Obsolete and ignored. @anchor globus_gram_rsl_attribute_hostcount @par host_count Only applies to clusters of SMP computers, such as newer IBM SP systems. Defines the number of nodes ("pizza boxes") to distribute the "count" processes across. @anchor globus_gram_rsl_attribute_jobtype @par job_type This specifies how the jobmanager should start the job. Possible values are single (even if the count > 1, only start 1 process or thread), multiple (start count processes or threads), mpi (use the appropriate method (e.g. mpirun) to start a program compiled with a vendor-provided MPI library. Program is started with count nodes), and condor (starts condor jobs in the "condor" universe.) @anchor globus_gram_rsl_attribute_librarypath @par library_path Specifies a list of paths to be appended to the system-specific library path environment variables. @anchor globus_gram_rsl_attribute_loglevel @par loglevel Override the default log level for this job. The value of this attribute consists of a combination of the strings FATAL, ERROR, WARN, INFO, DEBUG, TRACE joined by the | character @anchor globus_gram_rsl_attribute_logpattern @par logpattern Override the default log path pattern for this job. The value of this attribute is a string (potentially containing RSL substitutions) that is evaluated to the path to write the log to. If the resulting string contains the string $(DATE) (or any other RSL substitution), it will be reevaluated at log time. @anchor globus_gram_rsl_attribute_maxcputime @par max_cpu_time Explicitly set the maximum cputime for a single execution of the executable. The units is in minutes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set cputime, then an error will be returned. @anchor globus_gram_rsl_attribute_maxmemory @par max_memory Explicitly set the maximum amount of memory for a single execution of the executable. The units is in Megabytes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set maxMemory, then an error will be returned. @anchor globus_gram_rsl_attribute_maxtime @par max_time The maximum walltime or cputime for a single execution of the executable. Walltime or cputime is selected by the GRAM scheduler being interfaced. The units is in minutes. The value will go through an atoi() conversion in order to get an integer. @anchor globus_gram_rsl_attribute_maxwalltime @par max_wall_time Explicitly set the maximum walltime for a single execution of the executable. The units is in minutes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set walltime, then an error will be returned. @anchor globus_gram_rsl_attribute_minmemory @par min_memory Explicitly set the minimum amount of memory for a single execution of the executable. The units is in Megabytes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set minMemory, then an error will be returned. @anchor globus_gram_rsl_attribute_project @par project Target the job to be allocated to a project account as defined by the scheduler at the defined (remote) resource. @anchor globus_gram_rsl_attribute_proxytimeout @par proxy_timeout Obsolete and ignored. Now a job-manager-wide setting. @anchor globus_gram_rsl_attribute_queue @par queue Target the job to a queue (class) name as defined by the scheduler at the defined (remote) resource. @anchor globus_gram_rsl_attribute_remoteiourl @par remote_io_url Writes the given value (a URL base string) to a file, and adds the path to that file to the environment throught the GLOBUS_REMOTE_IO_URL environment variable. If this is specified as part of a job restart RSL, the job manager will update the file's contents. This is intended for jobs that want to access files via GASS, but the URL of the GASS server has changed due to a GASS server restart. @anchor globus_gram_rsl_attribute_restart @par restart Start a new job manager, but instead of submitting a new job, start managing an existing job. The job manager will search for the job state file created by the original job manager. If it finds the file and successfully reads it, it will become the new manager of the job, sending callbacks on status and streaming stdout/err if appropriate. It will fail if it detects that the old jobmanager is still alive (via a timestamp in the state file). If stdout or stderr was being streamed over the network, new stdout and stderr attributes can be specified in the restart RSL and the jobmanager will stream to the new locations (useful when output is going to a GASS server started by the client that's listening on a dynamic port, and the client was restarted). The new job manager will return a new contact string that should be used to communicate with it. If a jobmanager is restarted multiple times, any of the previous contact strings can be given for the restart attribute. @anchor globus_gram_rsl_attribute_rslsubstitution @par rsl_substitution Specifies a list of values which can be substituted into other rsl attributes' values through the $(SUBSTITUTION) mechanism. @anchor globus_gram_rsl_attribute_savestate @par save_state Causes the jobmanager to save it's job state information to a persistent file on disk. If the job manager exits or is suspended, the client can later start up a new job manager which can continue monitoring the job. @anchor globus_gram_rsl_attribute_savejobdescription @par savejobdescription Save a copy of the job description to $HOME @anchor globus_gram_rsl_attribute_scratchdir @par scratch_dir Specifies the location to create a scratch subdirectory in. A SCRATCH_DIRECTORY RSL substitution will be filled with the name of the directory which is created. @anchor globus_gram_rsl_attribute_stderr @par stderr The name of the remote file to store the standard error from the job. If the value is a GASS URL, the standard error from the job is transferred dynamically during the execution of the job. There are two accepted forms of this value. It can consist of a single destination: stderr = URL, or a sequence of destinations: stderr = (DESTINATION) (DESTINATION). In the latter case, the DESTINATION may itself be a URL or a sequence of an x-gass-cache URL followed by a cache tag. @anchor globus_gram_rsl_attribute_stderrposition @par stderr_position Specifies where in the file remote standard error streaming should be restarted from. Must be 0. @anchor globus_gram_rsl_attribute_stdin @par stdin The name of the file to be used as standard input for the executable on the remote machine. If the value is a GASS URL, the file is transferred to the remote gass cache before executing the job and removed after the job has terminated. @anchor globus_gram_rsl_attribute_stdout @par stdout The name of the remote file to store the standard output from the job. If the value is a GASS URL, the standard output from the job is transferred dynamically during the execution of the job. There are two accepted forms of this value. It can consist of a single destination: stdout = URL, or a sequence of destinations: stdout = (DESTINATION) (DESTINATION). In the latter case, the DESTINATION may itself be a URL or a sequence of an x-gass-cache URL followed by a cache tag. @anchor globus_gram_rsl_attribute_stdoutposition @par stdout_position Specifies where in the file remote output streaming should be restarted from. Must be 0. @anchor globus_gram_rsl_attribute_twophase @par two_phase Use a two-phase commit for job submission and completion. The job manager will respond to the initial job request with a WAITING_FOR_COMMIT error. It will then wait for a signal from the client before doing the actual job submission. The integer supplied is the number of seconds the job manager should wait before timing out. If the job manager times out before receiving the commit signal, or if a client issues a cancel signal, the job manager will clean up the job's files and exit, sending a callback with the job status as GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED. After the job manager sends a DONE or FAILED callback, it will wait for a commit signal from the client. If it receives one, it cleans up and exits as usual. If it times out and save_state was enabled, it will leave all of the job's files in place and exit (assuming the client is down and will attempt a job restart later). The timeoutvalue can be extended via a signal. When one of the following errors occurs, the job manager does not delete the job state file when it exits: GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT, GLOBUS_GRAM_PROTOCOL_ERROR_TTL_EXPIRED, GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED, GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_EXPIRED. In these cases, it can not be restarted, so the job manager will not wait for the commit signal after sending the FAILED callback @anchor globus_gram_rsl_attribute_username @par username Verify that the job is running as this user. */ globus_gram_job_manager-13.53/globus-gram-job-manager.rvf0000666000076400007640000003367311714563237020452 00000000000000# RSL Validation Information for the base RSL supported by the job # manager Attribute: directory Description: "Specifies the path of the directory the jobmanager will use as the default directory for the requested job." Default: $(HOME) ValidWhen: GLOBUS_GRAM_JOB_SUBMIT DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: executable Description: "The name of the executable file to run on the remote machine. If the value is a GASS URL, the file is transferred to the remote gass cache before executing the job and removed after the job has terminated." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT RequiredWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: arguments Description: "The command line arguments for the executable. Use quotes, if a space is required in a single argument." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: stdin Description: "The name of the file to be used as standard input for the executable on the remote machine. If the value is a GASS URL, the file is transferred to the remote gass cache before executing the job and removed after the job has terminated." Default: "/dev/null" ValidWhen: GLOBUS_GRAM_JOB_SUBMIT DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: stdout Description: "The name of the remote file to store the standard output from the job. If the value is a GASS URL, the standard output from the job is transferred dynamically during the execution of the job. There are two accepted forms of this value. It can consist of a single destination: stdout = URL, or a sequence of destinations: stdout = (DESTINATION) (DESTINATION). In the latter case, the DESTINATION may itself be a URL or a sequence of an x-gass-cache URL followed by a cache tag." Default: "/dev/null" ValidWhen: GLOBUS_GRAM_JOB_SUBMIT GLOBUS_GRAM_JOB_MANAGER_RESTART GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: stderr Description: "The name of the remote file to store the standard error from the job. If the value is a GASS URL, the standard error from the job is transferred dynamically during the execution of the job. There are two accepted forms of this value. It can consist of a single destination: stderr = URL, or a sequence of destinations: stderr = (DESTINATION) (DESTINATION). In the latter case, the DESTINATION may itself be a URL or a sequence of an x-gass-cache URL followed by a cache tag." Default: "/dev/null" ValidWhen: GLOBUS_GRAM_JOB_SUBMIT GLOBUS_GRAM_JOB_MANAGER_RESTART GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: count Description: "The number of executions of the executable." Default: 1 ValidWhen: GLOBUS_GRAM_JOB_SUBMIT DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: environment Description: "The environment variables that will be defined for the executable in addition to default set that is given to the job by the jobmanager." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: max_time Description: "The maximum walltime or cputime for a single execution of the executable. Walltime or cputime is selected by the GRAM scheduler being interfaced. The units is in minutes. The value will go through an atoi() conversion in order to get an integer." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: max_wall_time Description: "Explicitly set the maximum walltime for a single execution of the executable. The units is in minutes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set walltime, then an error will be returned. " ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: max_cpu_time Description: "Explicitly set the maximum cputime for a single execution of the executable. The units is in minutes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set cputime, then an error will be returned." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: job_type Description: "This specifies how the jobmanager should start the job. Possible values are single (even if the count > 1, only start 1 process or thread), multiple (start count processes or threads), mpi (use the appropriate method (e.g. mpirun) to start a program compiled with a vendor-provided MPI library. Program is started with count nodes), and condor (starts condor jobs in the \"condor\" universe.)" Values: single multiple mpi condor Default: multiple ValidWhen: GLOBUS_GRAM_JOB_SUBMIT DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: gram_my_job Description: "Obsolete and ignored." Values: collective independent Default: collective ValidWhen: GLOBUS_GRAM_JOB_SUBMIT DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: queue Description: "Target the job to a queue (class) name as defined by the scheduler at the defined (remote) resource." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: project Description: "Target the job to be allocated to a project account as defined by the scheduler at the defined (remote) resource." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: host_count Description: "Only applies to clusters of SMP computers, such as newer IBM SP systems. Defines the number of nodes (\"pizza boxes\") to distribute the \"count\" processes across." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: dry_run Description: "If dryrun = yes then the jobmanager will not submit the job for execution and will return success." Default: no Values: yes no ValidWhen: GLOBUS_GRAM_JOB_SUBMIT DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: min_memory Description: "Explicitly set the minimum amount of memory for a single execution of the executable. The units is in Megabytes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set minMemory, then an error will be returned." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: max_memory Description: "Explicitly set the maximum amount of memory for a single execution of the executable. The units is in Megabytes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set maxMemory, then an error will be returned." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: save_state Description: "Causes the jobmanager to save it's job state information to a persistent file on disk. If the job manager exits or is suspended, the client can later start up a new job manager which can continue monitoring the job." Values: yes no ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: two_phase Description: "Use a two-phase commit for job submission and completion. The job manager will respond to the initial job request with a WAITING_FOR_COMMIT error. It will then wait for a signal from the client before doing the actual job submission. The integer supplied is the number of seconds the job manager should wait before timing out. If the job manager times out before receiving the commit signal, or if a client issues a cancel signal, the job manager will clean up the job's files and exit, sending a callback with the job status as GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED. After the job manager sends a DONE or FAILED callback, it will wait for a commit signal from the client. If it receives one, it cleans up and exits as usual. If it times out and save_state was enabled, it will leave all of the job's files in place and exit (assuming the client is down and will attempt a job restart later). The timeoutvalue can be extended via a signal. When one of the following errors occurs, the job manager does not delete the job state file when it exits: GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT, GLOBUS_GRAM_PROTOCOL_ERROR_TTL_EXPIRED, GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED, GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_EXPIRED. In these cases, it can not be restarted, so the job manager will not wait for the commit signal after sending the FAILED callback" ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: remote_io_url Description: "Writes the given value (a URL base string) to a file, and adds the path to that file to the environment throught the GLOBUS_REMOTE_IO_URL environment variable. If this is specified as part of a job restart RSL, the job manager will update the file's contents. This is intended for jobs that want to access files via GASS, but the URL of the GASS server has changed due to a GASS server restart." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT GLOBUS_GRAM_JOB_MANAGER_RESTART GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE Attribute: scratch_dir Description: "Specifies the location to create a scratch subdirectory in. A SCRATCH_DIRECTORY RSL substitution will be filled with the name of the directory which is created." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: rsl_substitution Description: "Specifies a list of values which can be substituted into other rsl attributes' values through the $(SUBSTITUTION) mechanism." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT GLOBUS_GRAM_JOB_MANAGER_RESTART Attribute: restart Description: "Start a new job manager, but instead of submitting a new job, start managing an existing job. The job manager will search for the job state file created by the original job manager. If it finds the file and successfully reads it, it will become the new manager of the job, sending callbacks on status and streaming stdout/err if appropriate. It will fail if it detects that the old jobmanager is still alive (via a timestamp in the state file). If stdout or stderr was being streamed over the network, new stdout and stderr attributes can be specified in the restart RSL and the jobmanager will stream to the new locations (useful when output is going to a GASS server started by the client that's listening on a dynamic port, and the client was restarted). The new job manager will return a new contact string that should be used to communicate with it. If a jobmanager is restarted multiple times, any of the previous contact strings can be given for the restart attribute." RequiredWhen: GLOBUS_GRAM_JOB_MANAGER_RESTART ValidWhen: GLOBUS_GRAM_JOB_MANAGER_RESTART Attribute: stdout_position Description: "Specifies where in the file remote output streaming should be restarted from. Must be 0." ValidWhen: GLOBUS_GRAM_JOB_MANAGER_RESTART GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE Values: 0 Attribute: stderr_position Description: "Specifies where in the file remote standard error streaming should be restarted from. Must be 0." ValidWhen: GLOBUS_GRAM_JOB_MANAGER_RESTART GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE Values: 0 Attribute: file_stage_in Description: "Specifies a list of (\"remote URL\" \"local file\") pairs which indicate files to be staged to the nodes which will run the job." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: file_stage_in_shared Description: "Specifies a list of (\"remote URL\" \"local file\") pairs which indicate files to be staged into the cache. A symlink from the cache to the \"local file\" path will be made." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: file_stage_out Description: "Specifies a list of (\"local file\" \"remote URL\") pairs which indicate files to be staged from the job to a GASS-compatible file server." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: file_clean_up Description: "Specifies a list of files which will be removed after the job is completed." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: gass_cache Description: Specifies location to override the GASS cache location. ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: proxy_timeout Description: "Obsolete and ignored. Now a job-manager-wide setting." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT GLOBUS_GRAM_JOB_MANAGER_RESTART Attribute: library_path Description: "Specifies a list of paths to be appended to the system-specific library path environment variables." Default: $(GLOBUS_LOCATION)/lib DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: username Description: Verify that the job is running as this user. ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: restartcontacts Description: "When restarting, use job state callback contacts from the original request. Internally generated." ValidWhen: GLOBUS_GRAM_JOB_MANAGER_RESTART Values: yes no Default: no DefaultWhen: GLOBUS_GRAM_JOB_MANAGER_RESTART Publish: false Attribute: savejobdescription Description: "Save a copy of the job description to $HOME" ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Values: yes no Default: no DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: loglevel Description: "Override the default log level for this job. The value of this attribute consists of a combination of the strings FATAL, ERROR, WARN, INFO, DEBUG, TRACE joined by the | character" ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Attribute: logpattern Description: "Override the default log path pattern for this job. The value of this attribute is a string (potentially containing RSL substitutions) that is evaluated to the path to write the log to. If the resulting string contains the string $(DATE) (or any other RSL substitution), it will be reevaluated at log time." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT # default value is 4 hours Attribute: expiration Description: "Time (in seconds) after a a job fails to receive a two-phase commit end signal before it is cleaned up." ValidWhen: GLOBUS_GRAM_JOB_SUBMIT Default: 14400 DefaultWhen: GLOBUS_GRAM_JOB_SUBMIT globus_gram_job_manager-13.53/globus_gram_job_manager_request.c0000666000076400007640000034124612040264633022062 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_gram_job_manager_request.c Globus Job Management Request * * CVS Information: * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_job_manager_request.c,v $ * $Date: 2012/10/19 14:54:19 $ * $Revision: 1.36.2.5 $ * $Author: bester $ */ /* * Include header files */ #include "globus_common.h" #include "globus_gram_protocol.h" #include "globus_gram_job_manager.h" #include "globus_rsl_assist.h" #include "globus_scheduler_event_generator_app.h" #include #include #include enum { GRAM_JOB_MANAGER_COMMIT_TIMEOUT=60 }; static int globus_l_gram_symboltable_add( globus_symboltable_t * symbol_table, const char * symbol, const char * value); static int globus_l_gram_generate_id( globus_gram_jobmanager_request_t * request, char ** jm_restart, uint64_t * uniq1p, uint64_t * uniq2p); static int globus_l_gram_init_cache( globus_gram_jobmanager_request_t * request, char ** cache_locationp, globus_gass_cache_t * cache_handlep); static int globus_l_gram_restart( globus_gram_jobmanager_request_t * request, globus_gram_jobmanager_request_t ** old_job_request); static int globus_l_gram_populate_environment( globus_gram_jobmanager_request_t * request); static int globus_l_gram_add_environment( globus_rsl_t * rsl, const char * variable, const char * value); static int globus_l_gram_init_scratchdir( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, const char * scratch_dir_base, char ** scratchdir); static int globus_l_gram_validate_rsl( globus_gram_jobmanager_request_t * request); static int globus_l_gram_remote_io_url_file_create( globus_gram_jobmanager_request_t * request, const char * remote_io_url, const char * job_dir, char ** remote_io_url_filep); static int globus_l_gram_export_cred( globus_gram_jobmanager_request_t * request, gss_cred_id_t cred, const char * job_directory, char ** proxy_filename); static int globus_l_gram_make_job_dir( globus_gram_jobmanager_request_t * request, char ** job_directory); static int globus_l_gram_check_position( globus_gram_jobmanager_request_t * request, globus_rsl_t * position_rsl); static void globus_l_gram_event_destroy(void *datum); #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ /** * Allocate and initialize a request. * * This function allocates a new request structure and clears all of the * values in the structure. It also creates a script argument file which * will be used when the job request is submitted. * * @param request * A pointer to a globus_gram_jobmanager_request_t pointer. This * will be modified to point to a freshly allocated request structure. * @param manager * Job manager state and configuration. * @param rsl * Job request or restart RSL string * @param delegated_credential * Credential delegated with the job request. * @param response_ctx * Security context to use for sending the job request response, may be * GSS_C_NO_CONTEXT if the job RSL came from the command-line. * @param reinit * Boolean value indicating whether this is an internally-generated * reinitialization of an existing job or a new job request from a * client or command-line. * @param old_job_contact * Pointer to a string to be set to the old job contact if * GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE. Set to NULL otherwise. * @param old_job_request * Pointer to a job request structure that will be set to an existing * one if the return value is GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE. Set * to NULL otherwise. If non-null, the caller must release a reference * when done processing this. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed * @retval GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL * Bad RSL * @retval GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED * RSL evaluation failed * @retval GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SCRATCH * Invalid scratchdir RSL attribute * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRATCH * Invalid scratchdir path * @retval GLOBUS_GRAM_PROTOCOL_ERROR_PARAMETER_NOT_SUPPORTED * RSL attribute not supported. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SUBMIT_ATTRIBUTE * Invalid submit RSL attribute. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_RESTART_ATTRIBUTE * Invalid restart RSL attribute. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDIO_UPDATE_ATTRIBUTE * Invalid stdio_update RSL attribute. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE * Old Job Manager is still alive. */ int globus_gram_job_manager_request_init( globus_gram_jobmanager_request_t ** request, globus_gram_job_manager_t * manager, char * rsl, gss_cred_id_t delegated_credential, gss_ctx_id_t response_ctx, globus_gsi_cred_handle_t peer_cred, globus_bool_t reinit, char ** old_job_contact, globus_gram_jobmanager_request_t ** old_job_request, char ** gt3_failure_message) { globus_gram_jobmanager_request_t * r; uint64_t uniq1, uniq2; int rc; const char * tmp_string; int count; int proxy_timeout; if (old_job_contact) { *old_job_contact = NULL; } if (old_job_request) { *old_job_request = NULL; } r = calloc(1, sizeof(globus_gram_jobmanager_request_t)); if (r == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto request_malloc_failed; } r->job_log_level = -1; r->config = manager->config; r->manager = manager; GlobusTimeAbstimeGetCurrent(r->job_stats.unsubmitted_timestamp); r->status = GLOBUS_GRAM_PROTOCOL_JOB_STATE_UNSUBMITTED; r->status_update_time = 0; r->failure_code = 0; r->exit_code = 0; r->stop_reason = 0; /* Won't be set until job has been submitted to the LRM */ r->job_id_string = NULL; r->original_job_id_string = NULL; r->poll_frequency = 10; r->commit_extend = 0; r->scratchdir = NULL; r->creation_time = time(NULL); r->queued_time = time(NULL); r->cache_tag = NULL; r->gateway_user = NULL; r->expected_terminal_state = GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE; r->gt3_failure_type = NULL; r->gt3_failure_message = NULL; r->gt3_failure_source = NULL; r->gt3_failure_destination = NULL; r->seg_last_timestamp = 0; rc = globus_symboltable_init( &r->symbol_table, globus_hashtable_string_hash, globus_hashtable_string_keyeq); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto symboltable_init_failed; } rc = globus_symboltable_create_scope(&r->symbol_table); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto symboltable_create_scope_failed; } rc = globus_i_gram_symbol_table_populate( r->config, &r->symbol_table); if (rc != GLOBUS_SUCCESS) { goto symboltable_populate_failed; } r->rsl = globus_rsl_parse(rsl); if (r->rsl == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto rsl_parse_failed; } rc = globus_rsl_assist_attributes_canonicalize(r->rsl); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto rsl_canonicalize_failed; } r->rsl_spec = globus_rsl_unparse(r->rsl); if (r->rsl_spec == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto rsl_unparse_failed; } /* If this is a restart job, the id will come from the restart RSL * value; otherwise, it will be generated from current pid and time */ rc = globus_l_gram_generate_id( r, &r->jm_restart, &uniq1, &uniq2); if (rc != GLOBUS_SUCCESS) { goto failed_generate_id; } /* Unique ID is used to have a handle to a job that has its state saved * and then the job is later restarted */ r->uniq_id = globus_common_create_string( "%"PRIu64".%"PRIu64, uniq1, uniq2); if (r->uniq_id == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_set_uniq_id; } /* The job contact is how the client is able to send signals or cancel this * job. */ r->job_contact = globus_common_create_string( "%s%"PRIu64"/%"PRIu64"/", r->manager->url_base, uniq1, uniq2); if (r->job_contact == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_set_job_contact; } rc = globus_l_gram_symboltable_add( &r->symbol_table, "GLOBUS_GRAM_JOB_CONTACT", r->job_contact); if (rc != GLOBUS_SUCCESS) { goto failed_add_contact_to_symboltable; } rc = globus_l_gram_symboltable_add( &r->symbol_table, "GLOBUS_GRAM_JOB_ID", r->uniq_id); if (rc != GLOBUS_SUCCESS) { goto failed_add_contact_to_symboltable; } r->job_contact_path = globus_common_create_string( "/%"PRIu64"/%"PRIu64"/", uniq1, uniq2); if (r->job_contact_path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_set_job_contact_path; } rc = globus_l_gram_make_job_dir(r, &r->job_dir); if (rc != GLOBUS_SUCCESS) { goto failed_make_job_dir; } r->cached_stdout = globus_common_create_string( "%s/%s", r->job_dir, "stdout"); if (r->cached_stdout == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto cached_stdout_malloc_failed; } rc = globus_symboltable_insert( &r->symbol_table, "GLOBUS_CACHED_STDOUT", r->cached_stdout); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto cached_stdout_symboltable_failed; } r->cached_stderr = globus_common_create_string( "%s/%s", r->job_dir, "stderr"); if (r->cached_stderr == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto cached_stderr_malloc_failed; } rc = globus_symboltable_insert( &r->symbol_table, "GLOBUS_CACHED_STDERR", r->cached_stderr); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto cached_stderr_symboltable_failed; } rc = globus_gram_job_manager_state_file_set( r, &r->job_state_file); if (rc != GLOBUS_SUCCESS) { goto failed_state_file_set; } r->client_contacts = NULL; r->stage_in_todo = NULL; r->stage_in_shared_todo = NULL; r->stage_out_todo = NULL; r->stage_stream_todo = NULL; if (r->jm_restart) { rc = globus_l_gram_restart(r, old_job_request); if (rc != GLOBUS_SUCCESS) { goto failed_restart; } manager->usagetracker->count_restarted++; } else { r->cache_tag = strdup(r->job_contact); if (r->cache_tag == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto cache_tag_alloc_failed; } rc = globus_i_gram_get_tg_gateway_user( response_ctx, peer_cred, &r->gateway_user); if(rc != GLOBUS_SUCCESS) { goto get_gateway_user_failed; } } rc = globus_gram_job_manager_rsl_eval_string( &r->symbol_table, r->config->scratch_dir_base, &r->scratch_dir_base); if(rc != GLOBUS_SUCCESS) { goto failed_eval_scratch_dir_base; } rc = globus_l_gram_init_scratchdir( r, r->rsl, r->scratch_dir_base, &r->scratchdir); if(rc != GLOBUS_SUCCESS) { goto init_scratchdir_failed; } rc = globus_l_gram_init_cache( r, &r->cache_location, &r->cache_handle); if (rc != GLOBUS_SUCCESS) { goto init_cache_failed; } /* At this point, all of the RSL substitutions have been populated, * including those based on runtime values, so we can validate the RSL */ rc = globus_l_gram_validate_rsl(r); if(rc != GLOBUS_SUCCESS) { goto validate_rsl_failed; } rc = globus_gram_job_manager_rsl_attribute_get_int_value( r->rsl, GLOBUS_GRAM_PROTOCOL_COUNT_PARAM, &count); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_COUNT; goto invalid_count; } rc = globus_gram_job_manager_rsl_attribute_get_boolean_value( r->rsl, GLOBUS_GRAM_PROTOCOL_DRY_RUN_PARAM, &r->dry_run); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_DRYRUN; goto get_dry_run_failed; } /* Some clients send (two_phase_commit = yes), others send * (two_phase_commit = timeout) */ rc = globus_gram_job_manager_rsl_attribute_get_int_value( r->rsl, GLOBUS_GRAM_PROTOCOL_TWO_PHASE_COMMIT_PARAM, &r->two_phase_commit); if (rc == GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE) { r->two_phase_commit = 0; } else if (rc != GLOBUS_SUCCESS) { globus_bool_t tmp_bool; rc = globus_gram_job_manager_rsl_attribute_get_boolean_value( r->rsl, GLOBUS_GRAM_PROTOCOL_TWO_PHASE_COMMIT_PARAM, &tmp_bool); if (rc == GLOBUS_SUCCESS) { r->two_phase_commit = tmp_bool ? GRAM_JOB_MANAGER_COMMIT_TIMEOUT : 0; } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_TWO_PHASE_COMMIT; goto get_two_phase_commit_failed; } globus_gram_job_manager_rsl_remove_attribute( r->rsl, GLOBUS_GRAM_PROTOCOL_TWO_PHASE_COMMIT_PARAM); } rc = globus_gram_job_manager_rsl_attribute_get_string_value( r->rsl, GLOBUS_GRAM_PROTOCOL_REMOTE_IO_URL_PARAM, &tmp_string); switch (rc) { case GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE: r->remote_io_url = NULL; r->remote_io_url_file = NULL; break; case GLOBUS_SUCCESS: if (tmp_string != NULL) { r->remote_io_url = strdup(tmp_string); if (r->remote_io_url == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto get_remote_io_url_failed; } } else { default: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_REMOTE_IO_URL; goto get_remote_io_url_failed; } } rc = globus_l_gram_remote_io_url_file_create( r, r->remote_io_url, r->job_dir, &r->remote_io_url_file); if (rc != GLOBUS_SUCCESS) { goto make_remote_io_url_file_failed; } /* TODO: Check that stdout and stderr, if a local files, can be written * to */ rc = globus_gram_job_manager_rsl_attribute_get_int_value( r->rsl, GLOBUS_GRAM_PROTOCOL_PROXY_TIMEOUT_PARAM, &proxy_timeout); if (rc == GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE) { rc = GLOBUS_SUCCESS; } else if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_PROXY_TIMEOUT; goto bad_proxy_timeout; } rc = globus_gram_job_manager_rsl_attribute_get_string_value( r->rsl, "loglevel", &tmp_string); switch (rc) { case GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE: r->job_log_level = r->config->log_levels; break; case GLOBUS_SUCCESS: if (tmp_string != NULL) { rc = globus_i_gram_parse_log_levels( tmp_string, &r->job_log_level, &r->gt3_failure_message); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_ATTR; goto get_job_log_levels_failed; } } else { default: rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_ATTR; goto get_job_log_levels_failed; } } rc = globus_gram_job_manager_rsl_attribute_get_string_value( r->rsl, "logpattern", &tmp_string); switch (rc) { case GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE: r->log_pattern = NULL; break; case GLOBUS_SUCCESS: if (tmp_string != NULL) { r->log_pattern = strdup(tmp_string); } else { default: rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_ATTR; goto get_job_log_pattern_failed; } } rc = globus_mutex_init(&r->mutex, NULL); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto mutex_init_failed; } rc = globus_cond_init(&r->cond, NULL); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto cond_init_failed; } rc = globus_gram_job_manager_staging_create_list(r); if(rc != GLOBUS_SUCCESS) { goto staging_list_create_failed; } if (reinit && r->jm_restart) { r->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_COMMITTED; } else { r->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_START; } if (r->jm_restart == NULL) { r->restart_state = GLOBUS_GRAM_JOB_MANAGER_STATE_START; } r->unsent_status_change = GLOBUS_FALSE; r->poll_timer = GLOBUS_NULL_HANDLE; rc = globus_fifo_init(&r->pending_queries); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto pending_queries_init_failed; } rc = globus_l_gram_export_cred( r, delegated_credential, r->job_dir, &r->x509_user_proxy); if (rc != GLOBUS_SUCCESS) { goto failed_export_cred; } rc = globus_l_gram_populate_environment(r); if (rc != GLOBUS_SUCCESS) { goto failed_populate_environment; } r->streaming_requested = GLOBUS_FALSE; rc = globus_gram_job_manager_history_file_set(r); if (rc != GLOBUS_SUCCESS) { goto history_file_set_failed; } r->job_history_status = GLOBUS_GRAM_PROTOCOL_JOB_STATE_UNSUBMITTED; r->response_context = response_ctx; rc = globus_fifo_init(&r->seg_event_queue); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto seg_event_queue_init_failed; } if (r->jm_restart == NULL) { rc = globus_gram_job_manager_state_file_write(r); } if (rc != GLOBUS_SUCCESS) { globus_fifo_destroy(&r->seg_event_queue); seg_event_queue_init_failed: if (r->job_history_file) { free(r->job_history_file); r->job_history_file = NULL; } history_file_set_failed: failed_populate_environment: if (r->x509_user_proxy) { free(r->x509_user_proxy); r->x509_user_proxy = NULL; } failed_export_cred: pending_queries_init_failed: staging_list_create_failed: globus_cond_destroy(&r->cond); cond_init_failed: globus_mutex_destroy(&r->mutex); mutex_init_failed: if (r->log_pattern) { free(r->log_pattern); } get_job_log_pattern_failed: get_job_log_levels_failed: bad_proxy_timeout: if (r->remote_io_url_file) { remove(r->remote_io_url_file); free(r->remote_io_url_file); } make_remote_io_url_file_failed: if (r->remote_io_url) { free(r->remote_io_url); } get_remote_io_url_failed: get_two_phase_commit_failed: get_dry_run_failed: invalid_count: validate_rsl_failed: globus_gass_cache_close(&r->cache_handle); free(r->cache_location); init_cache_failed: if (r->scratchdir) { globus_gram_job_manager_destroy_directory(r, r->scratchdir); free(r->scratchdir); r->scratchdir = NULL; } init_scratchdir_failed: if (r->scratch_dir_base) { free(r->scratch_dir_base); } failed_eval_scratch_dir_base: if (r->gateway_user) { free(r->gateway_user); } get_gateway_user_failed: free(r->cache_tag); cache_tag_alloc_failed: failed_restart: free(r->job_state_file); failed_state_file_set: cached_stderr_symboltable_failed: free(r->cached_stderr); cached_stderr_malloc_failed: cached_stdout_symboltable_failed: free(r->cached_stdout); cached_stdout_malloc_failed: if (rc != GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE) { globus_gram_job_manager_destroy_directory(r, r->job_dir); } free(r->job_dir); failed_make_job_dir: free(r->job_contact_path); failed_set_job_contact_path: failed_add_contact_to_symboltable: if (r->job_contact) { free(r->job_contact); } failed_set_job_contact: free(r->uniq_id); failed_set_uniq_id: if (r->jm_restart) { free(r->jm_restart); } failed_generate_id: free(r->rsl_spec); rsl_unparse_failed: rsl_canonicalize_failed: globus_rsl_free_recursive(r->rsl); rsl_parse_failed: symboltable_populate_failed: symboltable_create_scope_failed: globus_symboltable_destroy(&r->symbol_table); if (r->gt3_failure_message) { if (gt3_failure_message != NULL) { *gt3_failure_message = r->gt3_failure_message; } else { free(r->gt3_failure_message); } } if (r->gt3_failure_type) { free(r->gt3_failure_type); } if (r->gt3_failure_source) { free(r->gt3_failure_source); } if (r->gt3_failure_destination) { free(r->gt3_failure_destination); } symboltable_init_failed: free(r); r = NULL; } request_malloc_failed: *request = r; return rc; } /* globus_gram_job_manager_request_init() */ /** * Load request and security context, initialize structures, and send reply. * * @param manager * Job manager state * @param http_body_fd * File descriptor of the HTTP body file * @param context_fd * File descriptor pointing to the GSSAPI security context to use for the * response. * @param request * Pointer to be set to the new job request * @param context * Pointer to be set to the security context of the initial job request * @param contact * Pointer to be set to the job contact of the client to send job state * change notifications to. * @param job_state_mask * Pointer to be set to the job state mask for which job state changes * the client is interested in. * @param old_job_contact * Pointer to a string to be set to the old job contact if * GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE. Set to NULL otherwise. * @param old_job_request * Pointer to a job request structure that will be set to an existing * one if the return value is GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE. Set * to NULL otherwise. If non-null, the caller must release a reference * when done processing this. * @param gt3_failure_message * Pointer to be set to an extended failure message to explain why the * initialization failed. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED * Unable to import security context * @retval GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED * Unable to read job request from http_body_fd * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed * @retval GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL * Bad RSL * @retval GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED * RSL evaluation failed * @retval GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SCRATCH * Invalid scratchdir RSL attribute * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRATCH * Invalid scratchdir path * @retval GLOBUS_GRAM_PROTOCOL_ERROR_PARAMETER_NOT_SUPPORTED * RSL attribute not supported. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SUBMIT_ATTRIBUTE * Invalid submit RSL attribute. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_RESTART_ATTRIBUTE * Invalid restart RSL attribute. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDIO_UPDATE_ATTRIBUTE * Invalid stdio_update RSL attribute. * * @note Even if this function returns a failure code, the @a context * may still be initialized to the security context. If it points to a * value other than GSS_C_NO_CONTEXT then it can be used by the caller * to send the failure response. */ int globus_gram_job_manager_request_load( globus_gram_job_manager_t * manager, int http_body_fd, int context_fd, gss_cred_id_t cred, const char * peer_address, globus_gsi_cred_handle_t peer_cred, size_t content_length, globus_gram_jobmanager_request_t ** request, gss_ctx_id_t * context, char ** contact, int * job_state_mask, char ** old_job_contact, globus_gram_jobmanager_request_t ** old_job_request, globus_bool_t * version_only, char ** gt3_failure_message) { int rc; char * rsl; *request = NULL; *context = GSS_C_NO_CONTEXT; *contact = NULL; *job_state_mask = 0; *version_only = GLOBUS_FALSE; if (context_fd != -1) { rc = globus_gram_job_manager_import_sec_context( manager, context_fd, context); if (rc != GLOBUS_SUCCESS) { goto import_context_failed; } } rc = globus_gram_job_manager_read_request( manager, http_body_fd, content_length, &rsl, contact, job_state_mask, version_only); if (rc != GLOBUS_SUCCESS) { goto read_request_failed; } if (! (*version_only)) { rc = globus_gram_job_manager_request_init( request, manager, rsl, cred, *context, peer_cred, GLOBUS_FALSE, old_job_contact, old_job_request, gt3_failure_message); } if (rc != GLOBUS_SUCCESS) { goto request_init_failed; } request_init_failed: if (rsl) { free(rsl); } read_request_failed: import_context_failed: return rc; } /* globus_gram_job_manager_request_load() */ /** Verify that the job request is authorized, send a reply, and start the state machine for this request * * @param manager * Job manager state * @param request * Job request to start * @param response_fd * Descriptor to write the response to * @param client_contact * Client to send job state changes to (may be NULL) * @param job_state_mask * Job state mask for sending state changes to the client */ int globus_gram_job_manager_request_start( globus_gram_job_manager_t * manager, globus_gram_jobmanager_request_t * request, int response_fd, const char * client_contact, int job_state_mask) { int rc; int rc2; int response_code; char * job_contact; if (request == NULL) { /* Reply to a bad request */ rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_REQUEST; goto bad_request; } rc = globus_gram_job_manager_add_request( manager, request->job_contact_path, request); GlobusGramJobManagerRequestLock(request); if (rc != GLOBUS_SUCCESS) { goto add_request_failed; } rc = globus_gram_job_manager_call_authz_callout( request->config, request->response_context, request->response_context, request->uniq_id, request->rsl, "start"); if (rc != GLOBUS_SUCCESS) { goto authz_denied; } rc = globus_gram_job_manager_validate_username(request); if (rc != 0) { goto username_denied; } if (client_contact != NULL) { rc = globus_gram_job_manager_contact_add( request, client_contact, job_state_mask); if (rc != GLOBUS_SUCCESS) { goto contact_add_failed; } } if (request->dry_run) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_DRYRUN; rc = globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); manager->usagetracker->count_dryrun++; } contact_add_failed: username_denied: authz_denied: add_request_failed: bad_request: /* Reply to request with unsubmitted (and optionally * two-phase-commit needed) */ switch (request->failure_code) { case GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE: response_code = request->failure_code; job_contact = request->old_job_contact; break; case GLOBUS_SUCCESS: if (request->two_phase_commit) { response_code = GLOBUS_GRAM_PROTOCOL_ERROR_WAITING_FOR_COMMIT; } else { response_code = GLOBUS_SUCCESS; } job_contact = request->job_contact; break; default: response_code = request->failure_code; job_contact = NULL; break; } rc2 = globus_gram_job_manager_reply( request, request->manager, response_code, job_contact, response_fd, request->response_context, NULL); if (rc == GLOBUS_SUCCESS && rc2 == GLOBUS_SUCCESS) { globus_reltime_t delay; GlobusTimeReltimeSet(delay, 0, 0); rc = globus_gram_job_manager_state_machine_register( manager, request, &delay); } else if (rc == GLOBUS_SUCCESS && rc2 != GLOBUS_SUCCESS) { rc = rc2; } GlobusGramJobManagerRequestUnlock(request); return rc; } /* globus_gram_job_manager_request_start() */ /** * Deallocate memory related to a request. * * This function frees the data within the request, also destroying * files associated with the request. * The caller must not access the request after this function has returned. * * @param request * Job request to destroy. * * @return GLOBUS_SUCCESS */ void globus_gram_job_manager_request_destroy( globus_gram_jobmanager_request_t * request) { if (!request) { return; } if (request->scratchdir) { globus_gram_job_manager_destroy_directory( request, request->scratchdir); } globus_gram_job_manager_request_free(request); } /* globus_gram_job_manager_request_destroy() */ /** * Deallocate memory related to a request. * * This function frees the data within the request. * * @param request * Job request to destroy. * * @return GLOBUS_SUCCESS */ void globus_gram_job_manager_request_free( globus_gram_jobmanager_request_t * request) { if (!request) { return; } if (request->job_id_string) { free(request->job_id_string); } if (request->original_job_id_string) { free(request->original_job_id_string); } if (request->uniq_id) { free(request->uniq_id); } if (request->cached_stdout) { free(request->cached_stdout); } if (request->cached_stderr) { free(request->cached_stderr); } if (request->jm_restart) { free(request->jm_restart); } if (request->scratch_dir_base) { free(request->scratch_dir_base); } if (request->scratchdir) { free(request->scratchdir); } if (request->cache_tag) { free(request->cache_tag); } if (request->symbol_table != NULL) { globus_symboltable_destroy(&request->symbol_table); } if (request->rsl_spec) { free(request->rsl_spec); } if (request->rsl) { globus_rsl_free_recursive(request->rsl); } if (request->remote_io_url) { free(request->remote_io_url); } if (request->remote_io_url_file) { free(request->remote_io_url_file); } if (request->x509_user_proxy) { free(request->x509_user_proxy); } if (request->job_state_file) { free(request->job_state_file); } if (request->gt3_failure_type) { free(request->gt3_failure_type); } if (request->gt3_failure_message) { free(request->gt3_failure_message); } if (request->gt3_failure_source) { free(request->gt3_failure_source); } if (request->gt3_failure_destination) { free(request->gt3_failure_destination); } globus_mutex_destroy(&request->mutex); globus_cond_destroy(&request->cond); globus_gram_job_manager_contact_list_free(request); globus_gram_job_manager_staging_free_all(request); globus_assert(request->poll_timer == GLOBUS_NULL_HANDLE); if (request->job_contact) { free(request->job_contact); } if (request->job_contact_path) { free(request->job_contact_path); } if (request->pending_queries) { globus_fifo_destroy(&request->pending_queries); } if (request->job_history_file) { free(request->job_history_file); } if (request->job_dir) { free(request->job_dir); } if (request->cache_location) { free(request->cache_location); } if (request->gateway_user) { free(request->gateway_user); } if (request->cache_handle) { globus_gass_cache_close(&request->cache_handle); } if (request->response_context != GSS_C_NO_CONTEXT) { OM_uint32 minor_status; gss_delete_sec_context(&minor_status, &request->response_context, NULL); } if (request->seg_event_queue) { globus_fifo_destroy_all( &request->seg_event_queue, globus_l_gram_event_destroy); } if (request->job_stats.client_address != NULL) { free(request->job_stats.client_address); } if (request->job_stats.user_dn != NULL) { free(request->job_stats.user_dn); } } /* globus_gram_job_manager_request_free() */ /** * Change the status associated with a job request * * Changes the status associated with a job request. * There is now additional tracking data associated with the * status that must be updated when the status is. This function * handles managing it. It is NOT recommended that you directly * change the status. * * @param request * Job request to change status of. * @param status * Status to set the job request to. * * @return GLOBUS_SUCCESS assuming valid input. * If the request is null, returns GLOBUS_FAILURE. */ int globus_gram_job_manager_request_set_status( globus_gram_jobmanager_request_t * request, globus_gram_protocol_job_state_t status) { switch (status) { case GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING: GlobusTimeAbstimeGetCurrent(request->job_stats.pending_timestamp); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE: GlobusTimeAbstimeGetCurrent(request->job_stats.active_timestamp); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED: GlobusTimeAbstimeGetCurrent(request->job_stats.failed_timestamp); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE: GlobusTimeAbstimeGetCurrent(request->job_stats.done_timestamp); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_UNSUBMITTED: GlobusTimeAbstimeGetCurrent(request->job_stats.unsubmitted_timestamp); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_IN: GlobusTimeAbstimeGetCurrent(request->job_stats.file_stage_in_timestamp); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT: GlobusTimeAbstimeGetCurrent(request->job_stats.file_stage_out_timestamp); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_SUSPENDED: case GLOBUS_GRAM_PROTOCOL_JOB_STATE_ALL: break; } return globus_gram_job_manager_request_set_status_time( request, status, time(0)); } /* globus_gram_job_manager_request_set_status() */ /** * Change the status associated with a job request * * Changes the status associated with a job request. * There is now additional tracking data associated with the * status that must be updated when the status is. This function * handles managing it. It is NOT recommended that you directly * change the status. * * @param request * Job request to change status of. * @param status * Status to set the job request to. * @param valid_time * The status is known good as of this time (seconds since epoch) * * @return GLOBUS_SUCCESS assuming valid input. * If the request is null, returns GLOBUS_FAILURE. */ int globus_gram_job_manager_request_set_status_time( globus_gram_jobmanager_request_t * request, globus_gram_protocol_job_state_t status, time_t valid_time) { if( ! request ) return GLOBUS_FAILURE; request->status = status; request->status_update_time = valid_time; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.job.info " "level=DEBUG " "gramid=%s " "job_status=%d " "\n", request->job_contact_path, status); if (request->manager != NULL) { globus_gram_job_manager_set_status( request->manager, request->job_contact_path, request->status, request->failure_code, request->exit_code); } return GLOBUS_SUCCESS; } /* globus_gram_job_manager_request_set_status() */ /** * Write data to the job manager log file * * This function writes data to the passed file, using a printf format * string. Data is prefixed with a timestamp when written. * * @param log_fp * Log file to write to. * @param format * Printf-style format string to be written. * @param ... * Parameters substituted into the format string, if needed. * * @return This function returns the value returned by vfprintf. */ void globus_gram_job_manager_request_log( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_log_level_t level, const char * format, ... ) { va_list ap; int stdio_level = level; /* Allow logging code to determine this thread's current job request to handle * per-job log configuration */ globus_thread_setspecific( globus_i_gram_request_key, request); /* job_log_level is initialized to the global log level, but can be modified via * the log_level RSL attribute. If it masks the requested log level to zero, don't bother * calling the logging functions */ if (request != NULL && request->job_log_level != -1) { stdio_level = level & request->job_log_level; if (stdio_level == 0) { goto skip_stdio; } /* * If we have a request-specific log level that differs from the global * config, we need to make sure the log level matches the global type * mask so that it won't get discarded by globus_logging_vwrite */ if (request->config) { stdio_level = request->config->log_levels; } } va_start(ap, format); globus_logging_vwrite( globus_i_gram_job_manager_log_stdio, stdio_level, format, ap); va_end(ap); skip_stdio: if (globus_i_gram_job_manager_log_sys != NULL) { va_start(ap, format); globus_logging_vwrite( globus_i_gram_job_manager_log_sys, level, format, ap); va_end(ap); } globus_thread_setspecific( globus_i_gram_request_key, NULL); } /* globus_gram_job_manager_request_log() */ /** * Write data to the job manager accounting file. * Also use syslog() to allow for easy central collection. * * This function writes data to the passed file descriptor, if any, * using a printf format string. * Data is prefixed with a timestamp when written. * * @param format * Printf-style format string to be written. * @param ... * Parameters substituted into the format string, if needed. * * @return This function returns the value returned by write(). */ int globus_gram_job_manager_request_acct( globus_gram_jobmanager_request_t * request, const char * format, ... ) { static const char *jm_syslog_id = "gridinfo"; static int jm_syslog_fac = LOG_DAEMON; static int jm_syslog_lvl = LOG_NOTICE; static int jm_syslog_init; struct tm *curr_tm; time_t curr_time; va_list ap; int rc = -1; int fd; const char * gk_acct_fd_var = "GATEKEEPER_ACCT_FD"; const char * gk_acct_fd; int n; int t; char buf[1024 * 128]; time( &curr_time ); curr_tm = localtime( &curr_time ); n = t = sprintf( buf, "JMA %04d/%02d/%02d %02d:%02d:%02d ", curr_tm->tm_year + 1900, curr_tm->tm_mon + 1, curr_tm->tm_mday, curr_tm->tm_hour, curr_tm->tm_min, curr_tm->tm_sec ); va_start( ap, format ); /* * FIXME: we should use vsnprintf() here... */ n += vsprintf( buf + t, format, ap ); if (!jm_syslog_init) { const char *s; if ((s = globus_libc_getenv( "JOBMANAGER_SYSLOG_ID" )) != 0) { jm_syslog_id = *s ? s : 0; } if ((s = globus_libc_getenv( "JOBMANAGER_SYSLOG_FAC" )) != 0) { if (sscanf( s, "%u", &jm_syslog_fac ) != 1) { jm_syslog_id = 0; } } if ((s = globus_libc_getenv( "JOBMANAGER_SYSLOG_LVL" )) != 0) { if (sscanf( s, "%u", &jm_syslog_lvl ) != 1) { jm_syslog_id = 0; } } if (jm_syslog_id) { openlog( jm_syslog_id, LOG_PID, jm_syslog_fac ); } jm_syslog_init = 1; } if (jm_syslog_id) { char *p, *q = buf; while ((p = q) < buf + n) { char c; while ((c = *q) != 0 && c != '\n') { q++; } *q = 0; syslog( jm_syslog_lvl, "%s", p ); *q++ = c; } } if (!(gk_acct_fd = globus_libc_getenv( gk_acct_fd_var ))) { return -1; } if (sscanf( gk_acct_fd, "%d", &fd ) != 1) { return -1; } fcntl( fd, F_SETFD, FD_CLOEXEC ); if ((rc = write( fd, buf, n )) != n) { rc = -1; } return rc; } /* globus_gram_job_manager_request_acct() */ #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * Populate the request symbol table with values from the job manager config * * @param request * Request to update the symbol table of * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed */ int globus_i_gram_symbol_table_populate( globus_gram_job_manager_config_t * config, globus_symboltable_t * symbol_table) { int rc = GLOBUS_SUCCESS; int i; struct { char * symbol; char *value; } symbols[] = { { "HOME", config->home }, { "LOGNAME", config->logname }, { "GLOBUS_ID", config->subject }, { "GLOBUS_HOST_MANUFACTURER",config->globus_host_manufacturer}, { "GLOBUS_HOST_CPUTYPE",config->globus_host_cputype}, { "GLOBUS_HOST_OSNAME",config->globus_host_osname}, { "GLOBUS_HOST_OSVERSION",config->globus_host_osversion}, { "GLOBUS_GATEKEEPER_HOST",config->globus_gatekeeper_host}, { "GLOBUS_GATEKEEPER_PORT",config->globus_gatekeeper_port}, { "GLOBUS_GATEKEEPER_SUBJECT",config->globus_gatekeeper_subject}, { "GLOBUS_LOCATION", config->target_globus_location }, { "GLOBUS_CONDOR_OS", config->condor_os } /* Deprecated */, { "GLOBUS_CONDOR_ARCH", config->condor_arch } /* Deprecated */, /* Others are job dependent values inserted after they are computed: * - GLOBUS_GRAM_JOB_CONTACT * - GLOBUS_CACHED_STDOUT * - GLOBUS_CACHED_STDERR * - SCRATCH_DIRECTORY */ { NULL, NULL } }; for (i = 0; symbols[i].symbol != NULL; i++) { if (symbols[i].value != NULL) { rc = globus_l_gram_symboltable_add( symbol_table, symbols[i].symbol, symbols[i].value); if (rc != GLOBUS_SUCCESS) { goto failed_insert_symbol; } } } if (rc != GLOBUS_SUCCESS) { failed_insert_symbol: for (--i; i >=0; i--) { globus_symboltable_remove( symbol_table, symbols[i].symbol); } } return rc; } /* globus_gram_symbol_table_populate() */ /** * Insert a symbol into the RSL evaluation symbol table * * Also checks that the value is non-NULL and transforms the return * value to a GRAM error code. * * @param symboltable * Symbol table to insert the value to. * @param symbol * Symbol name to add to the table. * @pram value * Symbol value to add to the table. If NULL nothing is inserted. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed */ static int globus_l_gram_symboltable_add( globus_symboltable_t * symbol_table, const char * symbol, const char * value) { int rc = GLOBUS_SUCCESS; if (value != NULL) { rc = globus_symboltable_insert( symbol_table, (void *) symbol, (void *) value); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; } } return rc; } /* globus_l_gram_symboltable_add() */ static int globus_l_gram_generate_id( globus_gram_jobmanager_request_t * request, char ** jm_restart, uint64_t * uniq1p, uint64_t * uniq2p) { int rc = GLOBUS_SUCCESS; *jm_restart = NULL; if(globus_gram_job_manager_rsl_need_restart(request)) { /* Need to do this before unique id is set */ rc = globus_gram_job_manager_rsl_eval_one_attribute( request, GLOBUS_GRAM_PROTOCOL_RESTART_PARAM, jm_restart); if (rc == GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_RESTART; goto failed_jm_restart_eval; } else if (rc != GLOBUS_SUCCESS) { goto failed_jm_restart_eval; } else if (*jm_restart == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_RESTART; goto failed_jm_restart_eval; } rc = sscanf( request->jm_restart, "https://%*[^:]:%*d/%"PRIu64"/%"PRIu64, uniq1p, uniq2p); if (rc < 2) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_RESTART; goto failed_jm_restart_scan; } rc = GLOBUS_SUCCESS; } else { globus_uuid_t uuid; rc = globus_uuid_create(&uuid); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; } request->jm_restart = NULL; memcpy(uniq1p, uuid.binary.bytes, 8); memcpy(uniq2p, uuid.binary.bytes+8, 8); } if (rc != GLOBUS_SUCCESS) { failed_jm_restart_scan: if (request->jm_restart != NULL) { free(request->jm_restart); } } failed_jm_restart_eval: return rc; } /* globus_l_gram_generate_id() */ /** * Determine the cache location to use for this job * * If the gass_cache RSL attribute is present, it is evaluated and used. * Otherwise, if -cache-location was in the configuration, it used. Otherwise, * the GASS cache library default is used. * * @param request * Request to use to find which value to use. * @param cache_locationp * Pointer to set to the job-specific cache location. * @param cache_handlep * Pointer to the GASS cache handle to initialize for this job * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_RSL_CACHE * Invalid gass_cache RSL parameter. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_CACHE * Invalid cache path. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE * Error opening cache. */ static int globus_l_gram_init_cache( globus_gram_jobmanager_request_t * request, char ** cache_locationp, globus_gass_cache_t * cache_handlep) { int rc = GLOBUS_SUCCESS; int gassrc = GLOBUS_SUCCESS; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.gass_cache_init.start " "level=TRACE " "gramid=%s " "\n", request->job_contact_path); if (globus_gram_job_manager_rsl_attribute_exists( request->rsl, GLOBUS_GRAM_PROTOCOL_GASS_CACHE_PARAM)) { /* If gass_cache is in RSL, we'll evaluate that and use it. */ rc = globus_gram_job_manager_rsl_eval_one_attribute( request, GLOBUS_GRAM_PROTOCOL_GASS_CACHE_PARAM, cache_locationp); if (rc != GLOBUS_SUCCESS) { if (rc == GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_CACHE; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.gass_cache_init.end " "level=ERROR " "gramid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, -rc, "Error evaluating cache RSL attribute", globus_gram_protocol_error_string(rc)); goto failed_cache_eval; } /* cache location in rsl, but not a literal after eval */ if ((*cache_locationp) == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_CACHE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.gass_cache_init.end " "level=ERROR " "gramid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, -rc, "Error evaluating cache RSL attribute", globus_gram_protocol_error_string(rc)); goto failed_cache_eval; } } else if (request->config->cache_location != NULL) { /* If -cache-location was on command-line or config file, then * eval and use it */ rc = globus_gram_job_manager_rsl_eval_string( &request->symbol_table, request->config->cache_location, cache_locationp); if(rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.gass_cache_init.end " "level=ERROR " "gramid=%s " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, -rc, globus_gram_protocol_error_string(rc)); goto failed_cache_eval; } } else { /* I'd like to use GASS-default location for the cache for this, * but we can't rely on being able to set the environment and having * it remain valid if multiple jobs are being processed. Instead, we'll * force it to what the library would do anyway. */ *cache_locationp = globus_common_create_string( "%s/.globus/.gass_cache", request->config->home); } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.gass_cache_init.info " "level=TRACE " "gramid=%s " "path=%s\n", request->job_contact_path, *(cache_locationp)); memset(cache_handlep, 0, sizeof(globus_gass_cache_t)); gassrc = rc = globus_gass_cache_open(*cache_locationp, cache_handlep); if(rc != GLOBUS_SUCCESS) { if (*cache_locationp) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_CACHE; } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.gass_cache_init.end " "level=ERROR " "gramid=%s " "status=%d " "path=%s " "msg=\"%s\" " "gasserror=%d " "reason=\"%s\"\n", request->job_contact_path, -rc, *(cache_locationp), "Error opening GASS cache", gassrc, globus_gass_cache_error_string(gassrc)); if (*cache_locationp) { free(*cache_locationp); *cache_locationp = NULL; } } else { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.gass_cache_init.end " "level=TRACE " "gramid=%s " "status=%d " "path=%s\n", request->job_contact_path, 0, *(cache_locationp)); } failed_cache_eval: return rc; } /* globus_l_gram_init_cache() */ static int globus_l_gram_restart( globus_gram_jobmanager_request_t * request, globus_gram_jobmanager_request_t ** old_job_request) { int rc; globus_rsl_t * stdout_position; globus_rsl_t * stderr_position; globus_rsl_t * restart_rsl; globus_rsl_t * original_rsl; globus_rsl_t * restartcontacts; globus_bool_t restart_contacts = GLOBUS_FALSE; /* Evaluate the restart RSL, so that we can merge it with the original * job RSL */ rc = globus_rsl_eval(request->rsl, &request->symbol_table); if(rc != GLOBUS_SUCCESS) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED; goto rsl_eval_failed; } rc = globus_gram_job_manager_validate_rsl( request, request->rsl, GLOBUS_GRAM_VALIDATE_JOB_MANAGER_RESTART); if(rc != GLOBUS_SUCCESS) { goto rsl_validate_failed; } /* * Eval after validating, as validation may insert * RSL substitions when processing default values of * RSL attributes */ rc = globus_rsl_eval(request->rsl, &request->symbol_table); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED; goto post_validate_eval_failed; } /* Free the restart RSL spec. Make room for the job * request RSL which we'll read from the state file */ free(request->rsl_spec); request->rsl_spec = NULL; /* Remove the restart parameter from the RSL spec. */ globus_gram_job_manager_rsl_remove_attribute( request->rsl, GLOBUS_GRAM_PROTOCOL_RESTART_PARAM); if (globus_gram_job_manager_request_exists( request->manager, request->job_contact_path)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; } else { /* Read the job state file. This has all sorts of side-effects on * the request structure */ rc = globus_gram_job_manager_state_file_read(request); } if (rc == GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE) { /* Something is handling this request already. We'll check if it is * this process. If so, we'll merge the RSLs (as if we had done a * stdio update. */ rc = globus_gram_job_manager_add_reference( request->manager, request->job_contact_path, "restart", old_job_request); if (rc != GLOBUS_SUCCESS) { /* OK. It's alive, but not our job. Let it be */ rc = GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; goto state_file_read_failed; } rc = globus_i_gram_request_stdio_update( (*old_job_request), request->rsl); if (rc == GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; } else { /* Likely, we return GLOBUS_SUCCESS in this case, the wrong error value */ rc = globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "restart"); *old_job_request = NULL; } goto old_jm_alive; } else if(rc != GLOBUS_SUCCESS) { goto state_file_read_failed; } original_rsl = globus_rsl_parse(request->rsl_spec); if (!original_rsl) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto parse_original_rsl_failed; } restart_rsl = request->rsl; request->rsl = NULL; rc = globus_gram_job_manager_rsl_attribute_get_boolean_value( restart_rsl, "restartcontacts", &restart_contacts); if (rc != GLOBUS_SUCCESS || !restart_contacts) { globus_gram_job_manager_contact_list_free(request); rc = GLOBUS_SUCCESS; } restartcontacts = globus_gram_job_manager_rsl_extract_relation( restart_rsl, "restartcontacts"); if (restartcontacts != NULL) { globus_rsl_free_recursive(restartcontacts); } /* * Remove stdout_position and stderr_position. We don't do streaming * any more, so we will reject any restart where the positions * aren't 0 (validation file checks those). */ stdout_position = globus_gram_job_manager_rsl_extract_relation( restart_rsl, GLOBUS_GRAM_PROTOCOL_STDOUT_POSITION_PARAM); if (stdout_position != NULL) { globus_rsl_free_recursive(stdout_position); } stderr_position = globus_gram_job_manager_rsl_extract_relation( restart_rsl, GLOBUS_GRAM_PROTOCOL_STDERR_POSITION_PARAM); if (stderr_position != NULL) { globus_rsl_free_recursive(stderr_position); } request->rsl = globus_gram_job_manager_rsl_merge( original_rsl, restart_rsl); if(request->rsl == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; } request->job_stats.restart_count++; if (original_rsl) { globus_rsl_free_recursive(original_rsl); } if (restart_rsl) { globus_rsl_free_recursive(restart_rsl); } parse_original_rsl_failed: old_jm_alive: state_file_read_failed: post_validate_eval_failed: rsl_validate_failed: rsl_eval_failed: return rc; } /* globus_l_gram_restart() */ int globus_i_gram_request_stdio_update( globus_gram_jobmanager_request_t * request, globus_rsl_t * update_rsl) { int rc = GLOBUS_SUCCESS; const char * tmp_string; globus_rsl_t * tmp_rsl; globus_rsl_t * stdout_position; globus_rsl_t * stderr_position; globus_rsl_t * original_rsl; /* TODO: We should almost certainly validate RSL here rc = globus_gram_job_manager_validate_rsl( request, tmp_rsl, GLOBUS_GRAM_VALIDATE_STDIO_UPDATE); if(rc != GLOBUS_SUCCESS) { goto parse_original_rsl_failed; } */ /* * Remove stdout_position and stderr_position. We don't do streaming * any more, so we will reject any restart where the positions * aren't 0. */ stdout_position = globus_gram_job_manager_rsl_extract_relation( update_rsl, GLOBUS_GRAM_PROTOCOL_STDOUT_POSITION_PARAM); if (stdout_position != NULL) { globus_rsl_free_recursive(stdout_position); } stderr_position = globus_gram_job_manager_rsl_extract_relation( update_rsl, GLOBUS_GRAM_PROTOCOL_STDERR_POSITION_PARAM); if (stderr_position != NULL) { globus_rsl_free_recursive(stderr_position); } original_rsl = globus_rsl_parse(request->rsl_spec); if (!original_rsl) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto parse_original_rsl_failed; } /* TODO: it appears tmp_rsl leaks if a failure occurs */ tmp_rsl = globus_gram_job_manager_rsl_merge( original_rsl, update_rsl); if (tmp_rsl == GLOBUS_NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto failed_rsl_merge; } /* The update_rsl, for job restarts, contains a "restartcontacts" * attribute. This must be removed from the merged RSL prior to * saving it to disk; otherwise, it will cause submits to choke. * TODO: There should be a smarter way to do this with RSL validation. */ if (globus_gram_job_manager_rsl_remove_attribute(tmp_rsl, "restartcontacts")) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto failed_rsl_merge; } char * tmp_rsl_spec; if (!(tmp_rsl_spec = globus_rsl_unparse(tmp_rsl))) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto failed_rsl_merge; } rc = globus_rsl_eval(tmp_rsl, &request->symbol_table); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED; goto failed_rsl_merge; } rc = globus_gram_job_manager_validate_rsl( request, tmp_rsl, GLOBUS_GRAM_VALIDATE_JOB_SUBMIT); if(rc != GLOBUS_SUCCESS) { goto failed_rsl_merge; } rc = globus_rsl_eval(tmp_rsl, &request->symbol_table); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED; goto failed_rsl_merge; } globus_rsl_free_recursive(request->rsl); request->rsl = tmp_rsl; free(request->rsl_spec); request->rsl_spec = tmp_rsl_spec; rc = globus_gram_job_manager_streaming_list_replace(request); if (rc != GLOBUS_SUCCESS) { goto staging_list_replace_failed; } rc = globus_gram_job_manager_rsl_attribute_get_string_value( request->rsl, GLOBUS_GRAM_PROTOCOL_REMOTE_IO_URL_PARAM, &tmp_string); switch (rc) { case GLOBUS_GRAM_PROTOCOL_ERROR_UNDEFINED_ATTRIBUTE: rc = GLOBUS_SUCCESS; break; case GLOBUS_SUCCESS: if (tmp_string != NULL) { if (request->remote_io_url) { free(request->remote_io_url); } request->remote_io_url = strdup(tmp_string); if (request->remote_io_url == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto get_remote_io_url_failed; } } else { default: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_REMOTE_IO_URL; goto get_remote_io_url_failed; } } if (request->remote_io_url) { rc = globus_i_gram_remote_io_url_update(request); } /* Now that we've recreated the stdio, redo the staging list. */ globus_gram_job_manager_staging_free_all(request); /* globus_gram_jobmanager_request_t * request) request->stage_in_todo = NULL; request->stage_in_shared_todo = NULL; request->stage_out_todo = NULL; request->stage_stream_todo = NULL; */ rc = globus_gram_job_manager_staging_create_list(request); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.restart.info " "level=ERROR " "gramid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, -rc, "Unable to recreate staging list", globus_gram_protocol_error_string(rc)); goto staging_list_replace_failed; } globus_gram_job_manager_state_file_write(request); get_remote_io_url_failed: staging_list_replace_failed: failed_rsl_merge: if (original_rsl) { globus_rsl_free_recursive(original_rsl); } parse_original_rsl_failed: return rc; } /* globus_i_gram_request_stdio_update() */ /** * Add default environment variables to the job environment * * Adds GLOBUS_GASS_CACHE_DEFAULT, LOGNAME, HOME, and anything that * is defined from the -extra-envar command-line option. * * @param request * Request to modify * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; * Malloc failed. */ static int globus_l_gram_populate_environment( globus_gram_jobmanager_request_t * request) { int rc; rc = globus_l_gram_add_environment( request->rsl, "GLOBUS_GASS_CACHE_DEFAULT", request->cache_location); if (rc != GLOBUS_SUCCESS) { goto add_cache_default_failed; } rc = globus_l_gram_add_environment( request->rsl, "LOGNAME", request->config->logname); if (rc != GLOBUS_SUCCESS) { goto add_logname_failed; } rc = globus_l_gram_add_environment( request->rsl, "HOME", request->config->home); if (rc != GLOBUS_SUCCESS) { goto add_home_failed; } if (request->config->x509_cert_dir) { rc = globus_l_gram_add_environment( request->rsl, "X509_CERT_DIR", request->config->x509_cert_dir); if (rc != GLOBUS_SUCCESS) { goto add_x509_cert_dir_failed; } } rc = globus_l_gram_add_environment( request->rsl, "GLOBUS_GRAM_JOB_CONTACT", request->job_contact); if (rc != GLOBUS_SUCCESS) { goto add_gram_job_contact_failed; } if (request->config->target_globus_location) { rc = globus_l_gram_add_environment( request->rsl, "GLOBUS_LOCATION", request->config->target_globus_location); if (rc != GLOBUS_SUCCESS) { goto add_globus_location_failed; } } if (request->config->tcp_port_range) { rc = globus_l_gram_add_environment( request->rsl, "GLOBUS_TCP_PORT_RANGE", request->config->tcp_port_range); if (rc != GLOBUS_SUCCESS) { goto add_tcp_port_range_failed; } } if (request->config->tcp_source_range) { rc = globus_l_gram_add_environment( request->rsl, "GLOBUS_TCP_SOURCE_RANGE", request->config->tcp_source_range); if (rc != GLOBUS_SUCCESS) { goto add_tcp_source_range_failed; } } if (request->remote_io_url_file) { rc = globus_l_gram_add_environment( request->rsl, "GLOBUS_REMOTE_IO_URL", request->remote_io_url_file); if (rc != GLOBUS_SUCCESS) { goto add_remote_io_url_file; } } if (request->x509_user_proxy) { rc = globus_l_gram_add_environment( request->rsl, "X509_USER_PROXY", request->x509_user_proxy); if (rc != GLOBUS_SUCCESS) { goto add_x509_user_proxy_failed; } } if (request->config->extra_envvars) { globus_list_t *l = request->config->extra_envvars; while (l) { char *p = globus_list_first(l); char *q; char *var, *val; l = globus_list_rest(l); if ((q = strchr(p, '=')) != NULL) { var = globus_common_create_string("%.*s", (int) (q-p), p); val = q+1; } else { var = strdup(p); val = getenv(var); } if (var && val) { rc = globus_l_gram_add_environment( request->rsl, var, val); if (rc != GLOBUS_SUCCESS) { free(var); goto add_extra_envvar_failed; } } if (var) { free(var); } } } add_extra_envvar_failed: add_x509_user_proxy_failed: add_remote_io_url_file: add_tcp_port_range_failed: add_tcp_source_range_failed: add_globus_location_failed: add_gram_job_contact_failed: add_x509_cert_dir_failed: add_home_failed: add_logname_failed: add_cache_default_failed: return rc; } /* globus_l_gram_populate_environment() */ /** * Add an environment variable to the job environment * * @param rsl * RSL to modify * @param variable * Environment variable name * @param value * Environment variable value. If NULL, this variable is ignored. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; * Malloc failed. */ static int globus_l_gram_add_environment( globus_rsl_t * rsl, const char * variable, const char * value) { int rc = GLOBUS_SUCCESS; if (value != NULL) { rc = globus_gram_job_manager_rsl_env_add( rsl, variable, value); if (rc != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; } } return rc; } /* globus_l_gram_add_environment() */ /** * Initialize the scratchdir member of the job request if needed * * As a side effect, the path named by scratchdir will be created and * variable SCRATCH_DIRECTORY will be added to both the symbol table and * the job environment. * * @param request * Request to act on. * @param rsl * RSL to check for "scratchdir" attribute * @param scratch_dir_base * Job-specific scratch_dir_base * @param scratchdir * Pointer to set to the new scratchdir * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SCRATCH * Invalid scratchdir RSL attribute * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRATCH * Invalid scratchdir path */ static int globus_l_gram_init_scratchdir( globus_gram_jobmanager_request_t * request, globus_rsl_t * rsl, const char * scratch_dir_base, char ** scratchdir) { int rc = GLOBUS_SUCCESS; char * dir = NULL; char * template = NULL; int i; int created = 0; enum { GLOBUS_GRAM_MKDIR_TRIES = 100 }; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.init_scratchdir.start " "level=DEBUG " "gramid=%s " "base=\"%s\" " "\n", request->job_contact_path, scratch_dir_base); /* In the case of a restart, this might have already been done */ if (request->jm_restart && request->scratchdir != NULL) { goto skip_mkdir; } if (! globus_gram_job_manager_rsl_attribute_exists( rsl, GLOBUS_GRAM_PROTOCOL_SCRATCHDIR_PARAM)) { *scratchdir = NULL; goto no_scratch; } rc = globus_gram_job_manager_rsl_eval_one_attribute( request, GLOBUS_GRAM_PROTOCOL_SCRATCHDIR_PARAM, &dir); if(rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.init_scratchdir.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "attribute=%s " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, "RSL evaluation failed", GLOBUS_GRAM_PROTOCOL_SCRATCHDIR_PARAM, -rc, globus_gram_protocol_error_string(rc)); if (rc == GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SCRATCH; } goto eval_scratchdir_failed; } else if (dir == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_SCRATCH; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.init_scratchdir.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "attribute=%s " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, "RSL evaluation didn't yield a string", GLOBUS_GRAM_PROTOCOL_SCRATCHDIR_PARAM, -rc, globus_gram_protocol_error_string(rc)); goto eval_scratchdir_failed; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.init_scratchdir.info " "level=TRACE " "gramid=%s " "dir=\"%s\" " "\n", request->job_contact_path, dir); if (dir[0] == '/') { template = globus_common_create_string( "%s/gram_scratch_XXXXXX", dir); } else { template = globus_common_create_string( "%s/%s/gram_scratch_XXXXXX", scratch_dir_base, dir); } if (template == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.init_scratchdir.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\"\n", request->job_contact_path, "Directory template allocation failed", -rc, errno, strerror(errno)); goto template_malloc_failed; } for (i = 0, created = 0; i < GLOBUS_GRAM_MKDIR_TRIES && !created; i++) { char * scratchname; scratchname = strdup(template); if (scratchname == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.init_scratchdir.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, "Directory template allocation failed", -rc, errno, strerror(errno)); goto scratchname_strdup_failed; } *scratchdir = mktemp(scratchname); if (mkdir(*scratchdir, S_IRWXU) != 0) { if (errno != EEXIST && errno != EINTR) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRATCH; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.init_scratchdir.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, "Error creating directory", -rc, errno, strerror(errno)); goto fatal_mkdir_err; } else { free(*scratchdir); *scratchdir = NULL; } } else { created = 1; } } if (*scratchdir == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRATCH; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.init_scratchdir.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "\n", request->job_contact_path, "Error creating directory", -rc); goto fatal_mkdir_err; } skip_mkdir: rc = globus_symboltable_insert( &request->symbol_table, "SCRATCH_DIRECTORY", *scratchdir); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.init_scratchdir.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "\n", request->job_contact_path, "Error inserting scratch directory into RSL symbol table", -rc); goto insert_symbol_failed; } rc = globus_l_gram_add_environment( request->rsl, "SCRATCH_DIRECTORY", *scratchdir); if (rc != GLOBUS_SUCCESS) { globus_symboltable_remove( &request->symbol_table, "SCRATCH_DIRECTORY"); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.init_scratchdir.end " "level=ERROR " "gramid=%s " "msg=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, "Error inserting scratch directory into job environment", -rc, globus_gram_protocol_error_string(rc)); insert_symbol_failed: rmdir(*scratchdir); fatal_mkdir_err: free(*scratchdir); *scratchdir = NULL; } else scratchname_strdup_failed: if (template) { free(template); } template_malloc_failed: if (dir) { free(dir); } eval_scratchdir_failed: no_scratch: if (rc == GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.init_scratchdir.end " "level=DEBUG " "gramid=%s " "status=%d " "%s=\"%s\" " "\n", request->job_contact_path, 0, *scratchdir ? "path" : "reason", *scratchdir ? *scratchdir : "scratch_dir not in RSL"); } return rc; } /* globus_l_gram_init_scratchdir() */ /** * Remove a directory and all of its contents * * @param request * Request related to this directory. * @param directory * Directory to remove. */ void globus_gram_job_manager_destroy_directory( globus_gram_jobmanager_request_t * request, const char * directory) { int rc; char * path; char * new_path; DIR * dir; struct dirent * entry; struct stat st; globus_list_t * unchecked_dir_list = NULL; globus_list_t * dir_list = NULL; int failures = 0; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.directory_destroy.start " "level=TRACE " "gramid=%s " "path=\"%s\" " "\n", request->job_contact_path, directory); path = strdup(directory); if (path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.end " "level=WARN " "gramid=%s " "path=\"%s\" " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, directory, -rc, globus_gram_protocol_error_string(rc)); goto path_strdup_failed; } rc = globus_list_insert(&unchecked_dir_list, path); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.end " "level=WARN " "gramid=%s " "path=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, directory, -rc, errno, strerror(errno)); free(path); goto unchecked_dir_insert_failed; } while (!globus_list_empty(unchecked_dir_list)) { /* We walk the directory structure once, removing all non-directory * entries. We store the directories in a list for a second pass. * * Note, we don't do much error handling here. If we fail, we'll leave * a dropping and note it in the log, but there's not much we can do. */ path = globus_list_remove(&unchecked_dir_list, unchecked_dir_list); if (path == NULL) { continue; } rc = globus_list_insert(&dir_list, path); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.info " "level=WARN " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, path, "List insert failed", -rc, errno, strerror(errno)); failures++; continue; } dir = opendir(path); if (dir == NULL) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.info " "level=WARN " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\"\n", request->job_contact_path, path, "opendir failed", -1, errno, strerror(errno)); failures++; continue; } while (globus_libc_readdir_r(dir, &entry) == 0 && entry != NULL) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { free(entry); continue; } new_path = globus_common_create_string( "%s/%s", path, entry->d_name); if (new_path == NULL) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.info " "level=WARN " "gramid=%s " "path=\"%s\" " "file=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, path, entry->d_name, "Malloc failed", -1, errno, strerror(errno)); failures++; free(entry); continue; } rc = lstat(new_path, &st); if (rc < 0) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.info " "level=WARN " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, new_path, "lstat failed", -1, errno, strerror(errno)); failures++; free(entry); continue; } if (st.st_mode & S_IFDIR) { rc = globus_list_insert(&unchecked_dir_list, new_path); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.info " "level=WARN " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, new_path, "List insert failed", -1, errno, strerror(errno)); free(new_path); failures++; free(entry); continue; } } else { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.directory_destroy.info " "level=TRACE " "gramid=%s " "path=\"%s\" " "msg=\"About to unlink\" " "\n", request->job_contact_path, new_path); rc = unlink(new_path); if (rc < 0) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.info " "level=WARN " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, new_path, "Unlink failed", -1, errno, strerror(errno)); failures++; } free(new_path); new_path = NULL; free(entry); } } closedir(dir); } while (!globus_list_empty(dir_list)) { /* Second pass removes (should be empty) subdirectories */ path = globus_list_remove(&dir_list, dir_list); rc = rmdir(path); if (rc < 0) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.directory_destroy.info " "level=WARN " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, path, "rmdir failed", -1, errno, strerror(errno)); failures++; } free(path); } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.directory_destroy.end " "level=DEBUG " "gramid=%s " "path=\"%s\" " "failures=%d " "status=%d " "\n", request->job_contact_path, directory, failures, failures == 0 ? 0 : -1); unchecked_dir_insert_failed: path_strdup_failed: return; } /* globus_gram_job_manager_destroy_directory() */ /** * Evaluate and validate the job RSL * * * @param request * Job request to validate * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED * RSL evaluation failed. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL * Invalid RSL. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_PARAMETER_NOT_SUPPORTED * RSL attribute not supported. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SUBMIT_ATTRIBUTE * Invalid submit RSL attribute. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_RESTART_ATTRIBUTE; * Invalid restart RSL attribute. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDIO_UPDATE_ATTRIBUTE; * Invalid stdio_update RSL attribute. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; * Malloc failed. */ static int globus_l_gram_validate_rsl( globus_gram_jobmanager_request_t * request) { int rc = GLOBUS_SUCCESS; rc = globus_rsl_eval(request->rsl, &request->symbol_table); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED; goto rsl_eval_failed; } rc = globus_gram_job_manager_validate_rsl( request, request->rsl, GLOBUS_GRAM_VALIDATE_JOB_SUBMIT); if(rc != GLOBUS_SUCCESS) { goto validate_rsl_failed; } rc = globus_rsl_eval(request->rsl, &request->symbol_table); if(rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_EVALUATION_FAILED; goto rsl_eval_failed2; } rsl_eval_failed2: validate_rsl_failed: rsl_eval_failed: return rc; } /* globus_l_gram_validate_rsl() */ /** * Create remote_io_url file in the job directory * * @param request * Request to log messages for * @param remote_io_url * Value to write to the remote_io_url file * @param remote_io_url_filep * Pointer to be set to the remote_io_url_file path upon success. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_RSL_REMOTE_IO_URL * Unable to create remote_io_url file. */ static int globus_l_gram_remote_io_url_file_create( globus_gram_jobmanager_request_t * request, const char * remote_io_url, const char * job_dir, char ** remote_io_url_filep) { int rc = GLOBUS_SUCCESS; FILE * fp; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.remote_io_url_file_create.start " "level=TRACE " "gramid=%s " "url=\"%s\" " "\n", request->job_contact_path, remote_io_url ? remote_io_url : ""); if (!remote_io_url) { *remote_io_url_filep = NULL; goto out; } *remote_io_url_filep = globus_common_create_string( "%s/remote_io_file", job_dir); if (remote_io_url_filep == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.remote_io_url_file_create.end " "level=ERROR " "gramid=%s " "url=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", request->job_contact_path, remote_io_url, -rc, "Error allocating path string", errno, strerror(errno)); goto set_remote_io_url_file_failed; } fp = fopen(*remote_io_url_filep, "r"); if (fp != NULL) { char * tmp; globus_bool_t skip_it = GLOBUS_FALSE; rc = fseek(fp, 0, SEEK_END); if (rc < 0) { goto close_readfp; } rc = ftell(fp); tmp = malloc(rc+1); if (tmp == NULL) { goto close_readfp; } if (fseek(fp, 0, SEEK_SET) < 0) { goto free_tmp; } tmp[rc] = 0; if (fgets(tmp, rc, fp) == NULL) { goto free_tmp; } /* trim trailing \n */ rc = strlen(tmp)-1; if (tmp[rc] == '\n') { tmp[rc] = 0; } if (strcmp(tmp, remote_io_url) == 0) { skip_it = GLOBUS_TRUE; } free_tmp: free(tmp); close_readfp: fclose(fp); fp = NULL; rc = GLOBUS_SUCCESS; if (skip_it) { goto out; } } fp = fopen(*remote_io_url_filep, "w"); if (fp == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_REMOTE_IO_URL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.remote_io_url_file_create.end " "level=ERROR " "gramid=%s " "url=\"%s\" " "path=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, remote_io_url, *remote_io_url_filep, -rc, "Error opening file", errno, strerror(errno)); goto fopen_failed; } rc = fprintf(fp, "%s\n", remote_io_url); if (rc < (1+strlen(remote_io_url))) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_REMOTE_IO_URL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.remote_io_url_file_create.end " "level=ERROR " "gramid=%s " "url=\"%s\" " "path=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, remote_io_url, *remote_io_url_filep, -rc, "Error writing remote_io file", errno, strerror(errno)); goto write_failed; } rc = GLOBUS_SUCCESS; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.remote_io_url_file_create.end " "level=TRACE " "gramid=%s " "url=\"%s\" " "path=\"%s\" " "status=0 " "\n", request->job_contact_path, remote_io_url, *remote_io_url_filep); write_failed: fclose(fp); if (rc != GLOBUS_SUCCESS) { fopen_failed: free(*remote_io_url_filep); *remote_io_url_filep = NULL; } set_remote_io_url_file_failed: out: return rc; } /* globus_l_gram_remote_io_url_file_create() */ static int globus_l_gram_export_cred( globus_gram_jobmanager_request_t * request, gss_cred_id_t cred, const char * job_directory, char ** proxy_filename) { OM_uint32 major_status, minor_status; char * filename = NULL; int file; gss_buffer_desc buffer; int rc = GLOBUS_SUCCESS; char * gt3_failure_message = NULL; int save_errno; int written; if (cred == GSS_C_NO_CREDENTIAL && !request->jm_restart) { goto no_cred; } if (cred != GSS_C_NO_CREDENTIAL) { major_status = gss_export_cred( &minor_status, cred, GSS_C_NO_OID, 0, &buffer); if (GSS_ERROR(major_status)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE_USER_PROXY; (void) globus_gss_assist_display_status_str( >3_failure_message, "Export proxy failed", major_status, minor_status, 0); goto export_cred_failed; } } filename = globus_common_create_string( "%s/x509_user_proxy", job_directory); if (filename == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_filename_failed; } if (cred == GSS_C_NO_CREDENTIAL && request->jm_restart) { goto jm_restart_done; } file = open( filename, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); if (file < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE_USER_PROXY; save_errno = errno; gt3_failure_message = globus_common_create_string( "Error opening proxy file for writing: %s: %s (%d)", filename, strerror(save_errno), save_errno); goto fopen_failed; } written = 0; do { rc = write( file, ((char *) buffer.value) + written, buffer.length - written); if (rc < 0) { save_errno = errno; rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE_USER_PROXY; gt3_failure_message = globus_common_create_string( "Error writing proxy file: %s: %s (%d)", filename, strerror(save_errno), save_errno); goto fwrite_failed; } else if (rc == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE_USER_PROXY; gt3_failure_message = globus_common_create_string( "Error writing proxy file: %s: %s", filename, "short write"); goto fwrite_failed; } else { written += rc; } } while (written < buffer.length); rc = GLOBUS_SUCCESS; fwrite_failed: rc = close(file); if (rc != 0) { save_errno = errno; rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_CACHE_USER_PROXY; gt3_failure_message = globus_common_create_string( "Error writing proxy file: %s: %s (%d)", filename, strerror(save_errno), save_errno); } fopen_failed: if (rc != GLOBUS_SUCCESS) { free(filename); filename = NULL; } malloc_filename_failed: gss_release_buffer(&minor_status, &buffer); jm_restart_done: export_cred_failed: if (request->gt3_failure_message == NULL) { request->gt3_failure_message = gt3_failure_message; } else { free(gt3_failure_message); } no_cred: *proxy_filename = filename; return rc; } /* globus_l_gram_export_cred() */ /** * Create job directory * * The job directory is used internally by the Job Manager to store various * pieces of job-specific data: stdout, stderr, proxy, and job scripts. * * @param request * Request to process * @param job_directory * Pointer to be set to the new value of the job directory. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_ARG_FILE_CREATION_FAILED * Error creating directory. */ static int globus_l_gram_make_job_dir( globus_gram_jobmanager_request_t * request, char ** job_directory) { char * out_file = NULL; char * tmp; int rc; struct stat statbuf; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.make_job_dir.start " "level=TRACE " "gramid=%s " "\n", request->job_contact_path); out_file = globus_common_create_string( "%s/.globus/job/%s/%s", request->config->home, request->config->short_hostname, request->uniq_id); if (out_file == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.make_job_dir.end " "level=ERROR " "gramid=%s " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, -rc, "Error allocating path string", errno, strerror(errno)); goto out; } if ((rc = stat(out_file, &statbuf)) < 0) { tmp = out_file; while (tmp != NULL) { tmp = strchr(tmp+1, '/'); if (tmp != out_file) { if (tmp != NULL) { *tmp = '\0'; } if ((rc = stat(out_file, &statbuf)) < 0) { /* Path component does not exist, try to make it */ errno = 0; rc = mkdir(out_file, S_IRWXU); if (rc == -1 && errno != EEXIST) { /* Error creating directory */ if (request->gt3_failure_message == NULL) { request->gt3_failure_message = globus_common_create_string( "mkdir failed: %s: %s", out_file, strerror(errno)); } } } if ((rc = stat(out_file, &statbuf)) < 0) { int save_errno = errno; rc = GLOBUS_GRAM_PROTOCOL_ERROR_ARG_FILE_CREATION_FAILED; if (request->gt3_failure_message == NULL) { request->gt3_failure_message = globus_common_create_string( "stat failed: %s: %s", out_file, strerror(save_errno)); } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.make_job_dir.end " "level=ERROR " "gramid=%s " "status=%d " "path=%s " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, -rc, out_file, "Error creating directory", save_errno, strerror(save_errno)); goto error_exit; } if (tmp != NULL) { *tmp = '/'; } } } } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.make_job_dir.end " "level=TRACE " "gramid=%s " "status=0 " "path=%s " "\n", request->job_contact_path, out_file); error_exit: if (rc != GLOBUS_SUCCESS) { free(out_file); out_file = NULL; } out: *job_directory = out_file; return rc; } /* globus_l_gram_make_job_dir() */ /** * Check that all stdout_position or stderr_values are 0 * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDOUT_POSITION * Invalid stdout_position * @retval GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDERR_POSITION * Invalid stderr_position */ static int globus_l_gram_check_position( globus_gram_jobmanager_request_t * request, globus_rsl_t * position_rsl) { int rc = GLOBUS_SUCCESS; globus_rsl_value_t * value_seq; globus_list_t * values; const char * value_string; long longval; char charval; value_seq = globus_rsl_relation_get_value_sequence(position_rsl); if (value_seq == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto non_sequence; } values = globus_rsl_value_sequence_get_value_list(value_seq); while (!globus_list_empty(values)) { value_string = globus_rsl_value_literal_get_string( globus_list_first(values)); values = globus_list_rest(values); if (value_string == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto non_literal; } errno = 0; if (scanf("%ld%c", &longval, &charval) != 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; goto non_zero; } } non_zero: non_literal: non_sequence: if (rc != GLOBUS_SUCCESS) { if (strcmp( globus_rsl_relation_get_attribute(position_rsl), "stdoutposition") == 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDOUT_POSITION; } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_STDERR_POSITION; } } return rc; } /* globus_l_gram_check_position() */ static void globus_l_gram_event_destroy(void *datum) { globus_scheduler_event_destroy(datum); } /* globus_l_gram_event_destroy() */ #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ globus_gram_job_manager-13.53/missing0000755000076400007640000002540612145177132014714 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_gram_job_manager-13.53/globus_gram_job_manager_script_tutorial.dox0000666000076400007640000006374111620260406024167 00000000000000/** @page globus_gram_job_manager_interface_tutorial GRAM Job Manager Scheduler Tutorial This tutorial describes the steps needed to build a GRAM Job Manager Scheduler interface package. The audience for this tutorial is a person interested in adding support for a new scheduler interface to GRAM. This tutorial will assume some familiarty with GTP, autoconf, automake, and Perl. As a reference point, this tutorial will refer to the code in the LSF Job Manager package. @section job_manager_tutorial_service_writing Writing a Scheduler Interface This section deals with writing the perl module which implements the interface between the GRAM job manager and the local scheduler. Consult the @ref globus_gram_job_manager_script_interface section of this manual for a more detailed reference on the Perl modules which are used here. The scheduler interface is implemented as a Perl module which is a subclass of the Globus::GRAM::JobManager module. Its name must match the scheduler type string used when the service is installed. For the LSF scheduler, the name is lsf, so the module name is Globus::GRAM::JobManager::lsf and it is stored in the file lsf.pm. Though there are several methods in the JobManager interface, they only ones which absolutely need to be implemented in a scheduler module are submit, poll, cancel. We'll begin by looking at the start of the lsf source module, lsf.in (the transformation to lsf.pm happens when the setup script is run. To begin the script, we import the GRAM support modules into the scheduler module's namespace, declare the module's namespace, and declare this module as a subclass of the Globus::GRAM::JobManager module. All scheduler packages will need to do this, substituting the name of the scheduler type being implemented where we see lsf below. @code use Globus::GRAM::Error; use Globus::GRAM::JobState; use Globus::GRAM::JobManager; use Globus::Core::Paths; ... package Globus::GRAM::JobManager::lsf; @ISA = qw(Globus::GRAM::JobManager); @endcode Next, we declare any system-specifc values which will be substituted when the setup package scripts are run. In the LSF case, we need the know the paths to a few programs which interact with the scheduler: @code my ($mpirun, $bsub, $bjobs, $bkill); BEGIN { $mpirun = '@MPIRUN@'; $bsub = '@BSUB@'; $bjobs = '@BJOBS@'; $bkill = '@BKILL@'; } @endcode The values surrounded by the at-sign (such as \@MPIRUN\@) will be replaced by with the path to the named programs by the find-lsf-tools script described @ref system_specific_configuration "below". @subsection gram_tut_constructor Writing a constructor For scheduler interfaces which need to setup some data before calling their other methods, they can overload the new method which acts as a constructor. Scheduler scripts which don't need any per-instance initialization will not need to provide a constructor, the Globus::GRAM::JobManager constructor will do the job. If you do need to overloaded this method, be sure to call the JobManager module's constructor to allow it to do its initialization, as in this example: @code sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); ## Insert scheduler-specific startup code here return $self; } @endcode The job interface methods are called with only one argument, the scheduler object itself. That object contains the a Globus::GRAM::JobDescription object ($self->{JobDescription}) which includes the values from the RSL string associated with the request, as well as a few extra values:
job_id
The string returned as the value of JOB_ID in the return hash from submit. This won't be present for methods called before the job is submitted.
uniq_id
A string associated with this job request by the job manager program. It will be unique for all jobs on a host for all time.
cache_tag
The GASS cache tag related to this job submission. Files in the cache with this tag will be cleaned by the cleanup_cache() method.
Now, let's look at the methods which will interface to the scheduler. @subsection gram_tut_submitting_jobs Submitting Jobs All scheduler modules must implement the submit method. This method is called when the job manager wishes to submit the job to the scheduler. The information in the original job request RSL string is available to the scheduler interface through the JobDescription data member of it's hash. For most schedulers, this is the longest method to be implemented, as it must decide what to do with the job description, and convert them to something which the scheduler can understand. We'll look at some of the steps in the LSF manager code to see how the scheduler interface is implemented. In the beginning of the submit method, we'll get our parameters and look up the job description in the manager-specific object: @code sub submit { my $self = shift; my $description = $self->{JobDescription}; @endcode Then we will check for values of the job parameters that we will be handling. For example, this is how we check for a valid job type in the LSF scheduler interface: @code if(defined($description->jobtype()) { if($description->jobtype !~ /^(mpi|single|multiple)$/) { return Globus::GRAM::Error::JOBTYPE_NOT_SUPPORTED; } elsif($description->jobtype() eq 'mpi' && $mpirun eq "no") { return Globus::GRAM::Error::JOBTYPE_NOT_SUPPORTED; } } @endcode The lsf module supports most of the core RSL attributes, so it does more processing to determine what to do with the values in the job description. Once we've inspected the JobDescription we'll know what we need to tell the scheduler about so that it'll start the job properly. For LSF, we will construct a job description script and pass that to the bsub command. This script is a bourne shell script with some special comments which LSF uses to decide what constraints to use when scheduling the job. First, we'll open the new file, and write the file header: @code $lsf_job_script = new IO::File($lsf_job_script_name, '>'); $lsf_job_script->print<print("#BSUB -q $queue\n"); } if(defined($description->project())) { $lsf_job_script->print("#BSUB -P " . $description->project() . "\n"); } @endcode Before we start the executable in the LSF job description script, we will quote and escape the job's arguments so that they will be passed to the application as they were in the job submission RSL string: At the end of the job description script, we actually run the executable named in the JobDescription. For LSF, we support a few different job types which require different startup commands. Here, we will quote and escape the strings in the argument list so that the values of the arguments will be identical to those in the initial job request string. For this Bourne-shell syntax script, we will double-quote each argument, and escaping the backslash (\), dollar-sign ($), double-quote ("), and single-quote (') characters. We will use this new string later in the script. @code @arguments = $description->arguments(); foreach(@arguments) { if(ref($_)) { return Globus::GRAM::Error::RSL_ARGUMENTS; } } if($arguments[0]) { foreach(@arguments) { $_ =~ s/\\/\\\\/g; $_ =~ s/\$/\\\$/g; $_ =~ s/"/\\\"/g; $_ =~ s/`/\\\`/g; $args .= '"' . $_ . '" '; } } else { $args = ""; } @endcode To end the LSF job description script, we will write the command line of the executable to the script. Depending on the job type of this submission, we will need to start either one or more instances of the executable, or the mpirun program which will start the job with the executable count in the JobDescription: @code if($description->jobtype() eq "mpi") { $lsf_job_script->print("$mpirun -np " . $description->count() . " "); $lsf_job_script->print($description->executable() . " $args \n"); } elsif($description->jobtype() eq 'multiple') { for(my $i = 0; $i < $description->count(); $i++) { $lsf_job_script->print($description->executable() . " $args &\n"); } $lsf_job_script->print("wait\n"); } else { $lsf_job_script->print($description->executable() . " $args\n"); } @endcode Next, we submit the job to the scheduler. Be sure to close the script file before trying to redirect it into the submit command, or some of the script file may be buffered and things will fail in strange ways! When the submission command returns, we check its output for the scheduler-specific job identifier. We will use this value to be able to poll or cancel the job. The return value of the script should be either a GRAM error object or a reference to a hash of values. The Globus::GRAM::JobManager documentation lists the valid keys to that hash. For the submit method, we'll return the job identifier as the value of JOB_ID in the hash. If the scheduler returned a job status result, we could return that as well. LSF does not, so we'll just check for the job ID and return it, or if the job fails, we'll return an error object: @code $lsf_job_script->close(); $job_id = (grep(/is submitted/, split(/\n/, `$bsub < $lsf_job_script_name`)))[0]; if($? == 0) { $job_id =~ m/<([^>]*)>/; $job_id = $1; return { JOB_ID => $job_id }; } return Globus::GRAM::Error::INVALID_SCRIPT_REPLY; } @endcode That finishes the submit method. Most of the functionality for the scheduler interface is now written. We just have a few more (much shorter) methods to implement. @subsection gram_tut_polling Polling Jobs All scheduler modules must also implement the poll method. The purpose of this method is to check for updates of a job's status, for example, to see if a job has finished. When this method is called, we'll get the job ID (which we returned from the submit method above) as well as the original job request information in the object's JobDescription. In the LSF script, we'll pass the job ID to the bjobs program, and that will return the job's status information. We'll compare the status field from the bjobs output to see what job state we should return. If the job fails, and there is a way to determine that from the scheduler, then the script should return in its hash both @code JOB_STATE => Globus::GRAM::JobState::FAILED @endcode and @code ERROR => Globus::GRAM::Error::->value @endcode Here's an excerpt from the LSF scheduler module implementation: @code sub poll { my $self = shift; my $description = $self->{JobDescription}; my $job_id = $description->jobid(); my $state; my $status_line; $self->log("polling job $job_id"); # Get first line matching job id $_ = (grep(/$job_id/, `$bjobs $job_id 2>/dev/null`))[0]; # Get 3th field (status) $_ = (split(/\s+/))[2]; if(/PEND/) { $state = Globus::GRAM::JobState::PENDING; } elsif(/USUSP|SSUSP|PSUSP/) { $state = Globus::GRAM::JobState::SUSPENDED } ... return {JOB_STATE => $state}; } @endcode @subsection gram_tut_cancel Cancelling Jobs All scheduler modules must also implement the cancel method. The purpose of this method is to cancel a running job. As with the poll method described above, this method will be given the job ID as part of the JobDescription object held by the manager object. If the scheduler interface provides feedback that the job was cancelled successfully, then we can return a JOB_STATE change to the FAILED state. Otherwise we can return an empty hash reference, and let the poll method return the state change next time it is called. To process a cancel in the LSF case, we will run the bkill command with the job ID. @code sub cancel { my $self = shift; my $description = $self->{JobDescription}; my $job_id = $description->jobid(); $self->log("cancel job $job_id"); system("$bkill $job_id >/dev/null 2>/dev/null"); if($? == 0) { return { JOB_STATE => Globus::GRAM::JobState::FAILED } } return Globus::GRAM::Error::JOB_CANCEL_FAILED; } @endcode @subsection gram_tut_exit_1 End of the script It is required that all perl modules return a non-zero value when they are parsed. To do this, make sure the last line of your module consists of: @code 1; @endcode @section job_manager_tutorial_service_setup Setting up a Scheduler Once we've written the job manager script, we need to get it installed so that the gatekeeper will be able to run our new service. We do this by writing a setup script. For LSF, we will write the script setup-globus-job-manager-lsf.pl, which we will list in the LSF package as the Post_Install_Program. To set up the Gatekeeper service, our LSF setup script does the following: -# Perform system-specific configuration. -# Install the GRAM scheduler Perl module and register as a gatekeeper service. -# (Optional) Install an RSL validation file defining extra scheduler-specific RSL attributes which the scheduler interface will support. -# Update the GPT metadata to indicate that the job manager service has been set up. @subsection system_specific_configuration System-Specific Configuration First, our scheduler setup script probes for any system-specific information needed to interface with the local scheduler. For example, the LSF scheduler uses the mpirun, bsub, bqueues, bjobs, and bkill commands to submit, poll, and cancel jobs. We'll assume that the administrator who is installing the package has these commands in their path. We'll use an autoconf script to locate the executable paths for these commands and substitute them into our scheduler Perl module. In the LSF package, we have the find-lsf-tools script, which is generated during bootstrap by autoconf from the find-lsf-tools.in file: @code ## Required Prolog AC_REVISION($Revision: 1.7 $) AC_INIT(lsf.in) # checking for the GLOBUS_LOCATION if test "x$GLOBUS_LOCATION" = "x"; then echo "ERROR Please specify GLOBUS_LOCATION" >&2 exit 1 fi ... ## Check for optional tools, warn if not found AC_PATH_PROG(MPIRUN, mpirun, no) if test "$MPIRUN" = "no" ; then AC_MSG_WARN([Cannot locate mpirun]) fi ... ## Check for required tools, error if not found AC_PATH_PROG(BSUB, bsub, no) if test "$BSUB" = "no" ; then AC_MSG_ERROR([Cannot locate bsub]) fi ... ## Required epilog - update scheduler specific module prefix='$(GLOBUS_LOCATION)' exec_prefix='$(GLOBUS_LOCATION)' libexecdir=${prefix}/libexec AC_OUTPUT( lsf.pm:lsf.in ) @endcode If this script exits with a non-zero error code, then the setup script propagates the error to the caller and exits without installing the service. @subsection installing_service_entry Registering as a Gatekeeper Service Next, the setup script installs it's perl module into the perl library directory and registers an entry in the Globus Gatekeeper's service directory. The program globus-job-manager-service (distributed in the job manager program setup package) performs both of these tasks. When run, it expects the scheduler perl module to be located in the $GLOBUS_LOCATION/setup/globus directory. @code $libexecdir/globus-job-manager-service -add -m lsf -s jobmanager-lsf; @endcode @subsection installing_validation_file Installing an RSL Validation File If the scheduler script implements RSL attributes which are not part of the core set supported by the job manager, it must publish them in the job manager's data directory. If the scheduler script wants to set some default values of RSL attributes, it may also set those as the default values in the validation file. The format of the validation file is described in the @ref globus_gram_job_manager_rsl_validation_file section of the documentation. The validation file must be named scheduler-type.rvf and installed in the $GLOBUS_LOCATION/share/globus_gram_job_manager directory. In the LSF setup script, we check the list of queues supported by the local LSF installation, and add a section of acceptable values for the queue RSL attribute: @code open(VALIDATION_FILE, ">$ENV{GLOBUS_LOCATION}/share/globus_gram_job_manager/lsf.rvf"); # Customize validation file with queue info open(BQUEUES, "bqueues -w |"); # discard header $_ = ; my @queues = (); while() { chomp; $_ =~ m/^(\S+)/; push(@queues, $1); } close(BQUEUES); if(@queues) { print VALIDATION_FILE "Attribute: queue\n"; print VALIDATION_FILE join(" ", "Values:", @queues); } close VALIDATION_FILE; @endcode @subsection updating_gpt_metadata Updating GPT Metadata Finally, the setup package should create and finalize a Grid::GPT::Setup. The value of $package must be the same value as the gpt_package_metadata Name attribute in the package's metadata file. If either the new() or finish() methods fail, then it is considered good practice to clean up any files created by the setup script. From setup-globus-job-manager-lsf.pl: @code my $metadata = new Grid::GPT::Setup( package_name => "globus_gram_job_manager_setup_lsf"); ... $metadata->finish(); @endcode @section job_manager_tutorial_service_packaging Packaging Now that we've written a job manager scheduler interface, we'll package it using GPT to make it easy for our users to build and install. We'll start by gathering the different files we've written above into a single directory lsf. - lsf.in - find-lsf-tools.in - setup-globus-job-manager.pl @subsection job_manager_tutorial_doc Package Documentation If there are any scheduler-specific options defined for this scheduler module, or if there any any optional setup items, then it is good to provide a documentation page which describes these. For LSF, we describe the changes since the last version of this package in the file globus_gram_job_manager_lsf.dox. This file consists of a doxygen mainpage. See www.doxygen.org for information on how to write documentation with that tool. @subsection job_manager_tutorial_configure configure.in Now, we'll write our configure.in script. This file is converted to the configure shell script by the bootstrap script below. Since we don't do any probes for compile-time tools or system characteristics, we just call the various initialization macros used by GPT, declare that we may provide doxygen documentation, and then output the files we need substitions done on. @code AC_REVISION($Revision: 1.7 $) AC_INIT(Makefile.am) GLOBUS_INIT AM_PROG_LIBTOOL dnl Initialize the automake rules the last argument AM_INIT_AUTOMAKE($GPT_NAME, $GPT_VERSION) LAC_DOXYGEN("../", "*.dox") GLOBUS_FINALIZE AC_OUTPUT( Makefile pkgdata/Makefile pkgdata/pkg_data_src.gpt doxygen/Doxyfile doxygen/Doxyfile-internal doxygen/Makefile ) @endcode @subsection job_manager_tutorial_pkg_data Package Metadata Now we'll write our metadata file, and put it in the pkgdata subdirectory of our package. The important things to note in this file are the package name and version, the post_install_program, and the setup sections. These define how the package distribution will be named, what command will be run by gpt-postinstall when this package is installed, and what the setup dependencies will be written when the Grid::GPT::Setup object is @ref updating_gpt_metadata "finalized". @code LSF Job Manager Setup ResourceManagement @GPT_CFLAGS@ @GPT_EXTERNAL_INCLUDES@ @GPT_EXTERNAL_LIBS@ Run the setup-globus-job-manager-lsf setup script to configure an lsf job manager. setup-globus-job-manager-lsf @endcode @subsection job_manager_tutorial_automake Automake Makefile.am The automake Makefile.am for this package is short because there isn't any compilation needed for this package. We just need to define what needs to be installed into which directory, and what source files need to be put inot our source distribution. For the LSF package, we need to list the lsf.in, find-lsf-tools, and setup-globus-job-manager-lsf.pl scripts as files to be installed into the setup directory. We need to add those files plus our documentation source file to the EXTRA_LIST variable so that they will be included in source distributions. The rest of the lines in the file are needed for proper interaction with GPT. @code include $(top_srcdir)/globus_automake_pre include $(top_srcdir)/globus_automake_pre_top SUBDIRS = pkgdata doxygen setup_SCRIPTS = \ lsf.in \ find-lsf-tools \ setup-globus-job-manager-lsf.pl EXTRA_DIST = $(setup_SCRIPTS) globus_gram_job_manager_lsf.dox include $(top_srcdir)/globus_automake_post include $(top_srcdir)/globus_automake_post_top @endcode @subsection job_manager_tutorial_bootstrap Bootstrap The final piece we need to write for our package is the bootstrap script. This script is the standard bootstrap script for a globus package, with an extra line to generate the fine-lsf-tools script using autoconf. @code #!/bin/sh # checking for the GLOBUS_LOCATION if test "x$GLOBUS_LOCATION" = "x"; then echo "ERROR Please specify GLOBUS_LOCATION" >&2 exit 1 fi if [ ! -f ${GLOBUS_LOCATION}/libexec/globus-bootstrap.sh ]; then echo "ERROR: Unable to locate \${GLOBUS_LOCATION}/libexec/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 . ${GLOBUS_LOCATION}/libexec/globus-bootstrap.sh autoconf find-lsf-tools.in > find-lsf-tools chmod 755 find-lsf-tools exit 0 @endcode @section job_manager_tutorial_building Building, Testing, and Debugging With this all done, we can now try to build our now package. To do so, we'll need to run @code % ./bootstrap % ./globus-build @endcode If all of the files are written correctly, this should result in our package being installed into $GLOBUS_LOCATION. Once that is done, we should be able to run gpt-postinstall to configure our new job manager. Now, we should be able to run the command @code % globus-personal-gatekeeper -start -jmtype lsf @endcode to start a gatekeeper configured to run a job manager using our new scripts. Running this will output a contact string (referred to as below), which we can use to connect to this new service. To do so, we'll run globus-job-run to submit a test job: @code % globus-job-run /bin/echo Hello, LSF Hello, LSF @endcode @subsection job_manager_tutorial_debugging When Things Go Wrong If the test above fails, or more complicated job failures are occurring, then you'lll have to debug your scheduler interface. Here are a few tips to help you out. Make sure that your script is valid Perl. If you run @code perl -I$GLOBUS_LOCATION/lib/perl \ $GLOBUS_LOCATION/lib/perl/Globus/GRAM/JobManager/lsf.pm @endcode You should get no output. If there are any diagnostics, correct them (in the lsf.in file), reinstall your package, and rerun the setup script. Look at the Globus Toolkit Error FAQ and see if the failure is perhaps not related to your scheduler script at all. Enable logging for the job manager. By default, the job manager is configured to log only when it notices a job failure. However, if your problem is that your script is not returning a failure code when you expect, you might want to enable logging always. To do this, modify the job manager configuration file to contain "-save-logfile always" in place of "-save-log on_error". Adding logging messages to your script: the JobManager object implements a log method, which allows you to write messages to the job manager log file. Do this as your methods are called to pinpoint where the error occurs. Save the job description file when your script is run. This will allow you to run the globus-job-manager-script.pl interactively (or in the Perl debugger). To save the job description file, you can do @code $self->{JobDescription}->save("/tmp/job_description.$$"); @endcode in any of the methods you've implemented. */ /* - Scheduler Module Setup Package - http://www.ncsa.uiuc.edu/Divisions/ACES/GPT/GPT_NativePackagingGuide.html - Makefile.am - bootstrap - configure.in - pkgdata/pkg_data_src.gpt.in - xxx.in - sub new - sub submit - sub poll - sub cancel - others if desired - find-xxx-tools - setup-globus-job-manager-xxx - setup-globus-job-manager-xxx.pl - globus_gram_job_manager_xxx.dox - adding a validation file. */ globus_gram_job_manager-13.53/configure.in0000666000076400007640000000455011772143463015634 00000000000000dnl AC_REVISION($Revision: 1.13.2.6 $) AC_INIT(Makefile.am) GLOBUS_INIT AM_PROG_LIBTOOL dnl Initialize the automake rules the last argument AM_INIT_AUTOMAKE($GPT_NAME, $GPT_VERSION) dnl Don't create a pkg-config file for program-only packages pkgconffile="" LAC_DOXYGEN("../", "*.dox") LAC_DOXYGEN_EXAMPLE_DIR("../") GLOBUS_OPENSSL xml_catalog_path="notset" AC_ARG_WITH( xml-catalog, AC_HELP_STRING( [--with-xml-catalog=PATH], [Look for XML catalog in PATH]), [xml_catalog_path="$withval"], [xml_catalog_path="notset"]) AC_PATH_PROG(XSLTPROC, "xsltproc") AC_PATH_PROG(XMLLINT, "xmllint") if test "x$xml_catalog_path" != x"notset"; then if test ! -f "$xml_catalog_path"; then AC_MSG_ERROR([Invalid XML catalog path]) else XML_CATALOG_PATH=$xml_catalog_path AC_SUBST(XML_CATALOG_PATH) fi fi GLOBUS_TOOLKIT_VERSION="`globus-version`" if test "x$GLOBUS_TOOLKIT_VERSION" = "x"; then GLOBUS_TOOLKIT_VERSION="UNKNOWN" fi AC_SUBST(GLOBUS_TOOLKIT_VERSION) AM_CONDITIONAL(REBUILD_PARSER, [false]) AM_CONDITIONAL(REBUILD_SCANNER, [false]) AM_PATH_XML2([2.6.11], [ac_cv_have_libxml2=yes], [ac_cv_have_libxml2=no AC_MSG_WARN([Unable to locate a usable libxml2]) AC_MSG_WARN([Teragrid gateway user extension will not be usable]) AC_MSG_WARN([To remedy, please install libxml2 using your operating system's package management tools or from http://www.xmlsoft.org/downloads.html])]) if test "$ac_cv_have_libxml2" = "yes"; then AC_DEFINE(HAVE_LIBXML2) fi dnl Some preprocessor tricks to get CMSG_SPACE and co. defined in case $host in *solaris*) AC_DEFINE(__EXTENSIONS__) AC_DEFINE(_XOPEN_SOURCE) AC_DEFINE(_XOPEN_SOURCE_EXTENDED) ;; esac AM_CONDITIONAL([GENERATE_MANPAGES], [test "$xml_catalog_path" != "notset"]) AC_DEFINE_UNQUOTED(GLOBUS_FLAVOR_NAME, "$GLOBUS_FLAVOR_NAME") LOGDIR="`eval_path $localstatedir/log/globus`" AC_SUBST(LOGDIR) AUDITDIR="`eval_path $localstatedir/lib/globus/gram-audit`" AC_SUBST(AUDITDIR) GLOBUS_FINALIZE AC_OUTPUT( pkgdata/Makefile pkgdata/pkg_data_src.gpt scripts/Makefile seg/Makefile rvf/Makefile doxygen/Makefile doxygen/Doxyfile doxygen/Doxyfile-internal globus-personal-gatekeeper globus-gram-job-manager.conf gram.logrotate Makefile version.h ) globus_gram_job_manager-13.53/main.c0000666000076400007640000010137712040264634014411 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_job_manager.c Resource Allocation Job Manager * * CVS Information: * * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/main.c,v $ * $Date: 2012/10/19 14:54:20 $ * $Revision: 1.41.2.6 $ * $Author: bester $ */ #include "globus_common.h" #include "gssapi.h" #include "globus_gss_assist.h" #include "globus_gsi_system_config.h" #include "globus_common.h" #include "globus_callout.h" #include "globus_gram_job_manager.h" #include "globus_gram_protocol.h" #include "globus_gass_cache.h" #include "globus_gram_jobmanager_callout_error.h" #include static int globus_l_gram_job_manager_activate(void); static int globus_l_gram_deactivate(void); static globus_result_t globus_l_gram_create_stack( const char * driver_name, globus_xio_stack_t * stack, globus_xio_driver_t * driver); static void reply_and_exit( globus_gram_job_manager_t * manager, int rc, char * gt3_failure_message); static void globus_l_gram_process_pending_restarts( void * arg); static void globus_l_gram_cputype_and_manufacturer( globus_gram_job_manager_config_t * config); static void globus_l_gram_lockcheck( void * arg); #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ int main( int argc, char ** argv) { int rc; globus_gram_job_manager_config_t config; globus_gram_job_manager_t manager; char * sleeptime_str; long sleeptime = 0; globus_bool_t debug_mode_service = GLOBUS_FALSE; globus_bool_t located_active_jm = GLOBUS_FALSE; int http_body_fd = -1; int context_fd = -1; gss_cred_id_t cred = GSS_C_NO_CREDENTIAL; OM_uint32 major_status, minor_status; pid_t forked_starter = 0; globus_bool_t cgi_invoked = GLOBUS_FALSE; int lock_tries_left = 10; if ((sleeptime_str = getenv("GLOBUS_JOB_MANAGER_SLEEP"))) { sleeptime = atoi(sleeptime_str); sleep(sleeptime); } if (getenv("GATEWAY_INTERFACE")) { cgi_invoked = GLOBUS_TRUE; } /* * Stdin and stdout point at socket to client * Make sure no buffering. * stderr may also, depending on the option in the grid-services */ setbuf(stdout,NULL); /* Don't export these to the perl scripts */ fcntl(STDIN_FILENO, F_SETFD, (int) 1); fcntl(STDOUT_FILENO, F_SETFD, (int) 1); fcntl(STDERR_FILENO, F_SETFD, (int) 1); /* * At least have minimal POSIX path for job environment via extra * environment values */ if(getenv("PATH") == NULL) { char * path; char default_path[] = "/usr/bin:/bin"; size_t pathlen; pathlen = confstr(_CS_PATH, NULL, (size_t) 0); if (pathlen < sizeof(default_path)) { pathlen = sizeof(default_path); } path = malloc(pathlen); path[0] = 0; (void) confstr(_CS_PATH, path, pathlen); if (path[0] == 0) { strncpy(path, default_path, pathlen); } setenv("PATH", path, 1); } /* Force non-threaded execution for now */ globus_thread_set_model(GLOBUS_THREAD_MODEL_NONE); /* Activate a common before parsing command-line so that * things work. Note that we can't activate everything yet because we might * set the GLOBUS_TCP_PORT_RANGE after parsing command-line args and we * need that set before activating XIO. */ rc = globus_module_activate(GLOBUS_COMMON_MODULE); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "Error activating GLOBUS_COMMON_MODULE\n"); exit(1); } /* Parse command line options to get jobmanager configuration */ rc = globus_gram_job_manager_config_init(&config, argc, argv); if (rc != GLOBUS_SUCCESS) { reply_and_exit(NULL, rc, NULL); } globus_thread_key_create( &globus_i_gram_request_key, NULL); rc = globus_gram_job_manager_logging_init(&config); if (rc != GLOBUS_SUCCESS) { exit(1); } if (getenv("GRID_SECURITY_HTTP_BODY_FD") == NULL && !cgi_invoked) { debug_mode_service = GLOBUS_TRUE; } /* Set environment variables from configuration */ if(config.globus_location != NULL) { globus_libc_setenv("GLOBUS_LOCATION", config.globus_location, GLOBUS_TRUE); } if(config.tcp_port_range != NULL) { globus_libc_setenv("GLOBUS_TCP_PORT_RANGE", config.tcp_port_range, GLOBUS_TRUE); } if(config.tcp_source_range != NULL) { globus_libc_setenv("GLOBUS_TCP_SOURCE_RANGE", config.tcp_source_range, GLOBUS_TRUE); } /* Activate all of the modules we will be using */ rc = globus_l_gram_job_manager_activate(); if(rc != GLOBUS_SUCCESS) { exit(1); } /* * Get the delegated credential (or the default credential if we are * run without a client. Don't care about errors in the latter case. */ major_status = globus_gss_assist_acquire_cred( &minor_status, GSS_C_BOTH, &cred); if ((!debug_mode_service) && GSS_ERROR(major_status)) { globus_gss_assist_display_status( stderr, "Error acquiring security credential\n", major_status, minor_status, 0); exit(1); } if (cred != GSS_C_NO_CREDENTIAL) { unsigned long hash; char * newtag; rc = globus_gram_gsi_get_dn_hash( cred, &hash); if (rc == GLOBUS_SUCCESS) { newtag = globus_common_create_string("%s%s%lx", strcmp(config.service_tag, "untagged") == 0 ? "" : config.service_tag, strcmp(config.service_tag, "untagged") == 0 ? "" : ".", hash); free(config.service_tag); config.service_tag = newtag; } } /* * Remove delegated proxy from disk. */ if ((!debug_mode_service) && getenv("X509_USER_PROXY") != NULL) { remove(getenv("X509_USER_PROXY")); unsetenv("X509_USER_PROXY"); } /* Set up LRM-specific state based on our configuration. This will create * the job contact listener, start the SEG if needed, and open the log * file if needed. */ rc = globus_gram_job_manager_init(&manager, cred, &config); if(rc != GLOBUS_SUCCESS) { reply_and_exit(NULL, rc, manager.gt3_failure_message); } /* * Pull out file descriptor numbers for security context and job request * from the environment (set by the gatekeeper) */ if (cgi_invoked) { http_body_fd = 0; context_fd = -1; } else if (!debug_mode_service) { char * fd_env = getenv("GRID_SECURITY_HTTP_BODY_FD"); rc = sscanf(fd_env ? fd_env : "-1", "%d", &http_body_fd); if (rc != 1 || http_body_fd < 0) { fprintf(stderr, "Error locating http body fd\n"); exit(1); } fcntl(http_body_fd, F_SETFD, 1); fd_env = getenv("GRID_SECURITY_CONTEXT_FD"); rc = sscanf(fd_env ? fd_env : "-1", "%d", &context_fd); if (rc != 1 || context_fd < 0) { fprintf(stderr, "Error locating security context fd\n"); exit(1); } fcntl(context_fd, F_SETFD, 1); } /* Redirect stdin from /dev/null, we'll handle stdout after the reply is * sent */ if (!cgi_invoked) { freopen("/dev/null", "r", stdin); } /* Here we'll either become the active job manager to process all * jobs for this user/host/lrm combination, or we'll hand off the * file descriptors containing the info to the active job manager */ while (!located_active_jm) { /* We'll try to get the lock file associated with being the * active job manager here. If we get the OLD_JM_ALIVE error * somebody else has it */ rc = globus_gram_job_manager_startup_lock( &manager, &manager.lock_fd); if (rc == GLOBUS_SUCCESS) { /* We've acquired the lock. We will fork a new process to act like * all other job managers which don't have the lock, and continue * on in this process managing jobs for this LRM. Note that the * child process does not inherit the lock */ if (!debug_mode_service) { int save_errno = 0; /* We've acquired the manager lock */ forked_starter = fork(); save_errno = errno; if (forked_starter < 0) { if (sleeptime != 0) { sleep(sleeptime); } fprintf(stderr, "fork failed: %s", strerror(save_errno)); exit(1); } else if (forked_starter == 0) { /* We are the child process. We'll close our reference to * the lock and let the other process deal with jobs */ close(manager.lock_fd); manager.lock_fd = -1; } globus_logging_update_pid(); if (sleeptime != 0) { sleep(sleeptime); } } if (manager.lock_fd >= 0) { /* We hold the manager lock, so we'll store our credential, and * then, try to accept socket connections. If the socket * connections fail, we'll exit, and another process * will be forked to handle them. */ rc = globus_gram_job_manager_gsi_write_credential( NULL, cred, manager.cred_path); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "write cred failed\n"); exit(1); } if (!debug_mode_service) { close(http_body_fd); http_body_fd = -1; } rc = globus_gram_job_manager_startup_socket_init( &manager, &manager.active_job_manager_handle, &manager.socket_fd); if (rc != GLOBUS_SUCCESS) { /* This releases our lock. Either the child process will * attempt to acquire the lock again or some another job * manager will acquire the lock */ exit(0); } assert(manager.socket_fd != -1); } } else if (rc != GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE) { /* Some system error. Try again */ if (--lock_tries_left == 0) { reply_and_exit(NULL, rc, "Unable to create lock file"); } sleep(1); continue; } /* If manager.socket_fd != -1 then we are the main job manager for this * LRM. * We will restart all existing jobs and then allow the startup * socket to accept new jobs from other job managers. */ if (manager.socket_fd != -1) { /* Look up cputype/manufacturer if not known yet */ globus_l_gram_cputype_and_manufacturer(manager.config); GlobusTimeAbstimeGetCurrent(manager.usagetracker->jm_start_time); globus_i_gram_usage_stats_init(&manager); globus_i_gram_usage_start_session_stats(&manager); located_active_jm = GLOBUS_TRUE; /* Load existing jobs. The show must go on if this fails, unless it * fails with a misconfiguration error */ rc = globus_gram_job_manager_request_load_all( &manager); if (rc == GLOBUS_GRAM_PROTOCOL_ERROR_GATEKEEPER_MISCONFIGURED) { if (forked_starter > 0) { kill(forked_starter, SIGTERM); forked_starter = 0; } reply_and_exit(NULL, rc, manager.gt3_failure_message); } if (context_fd != -1) { close(context_fd); context_fd = -1; } freopen("/dev/null", "a", stdout); /* At this point, seg_last_timestamp is the earliest last timestamp * for any pre-existing jobs. If that is 0, then we don't have any * existing jobs so we'll just ignore seg events prior to now. */ if (manager.seg_last_timestamp == 0) { manager.seg_last_timestamp = time(NULL); } /* Start off the SEG if we need it. */ if (config.seg_module != NULL || strcmp(config.jobmanager_type, "fork") == 0 || strcmp(config.jobmanager_type, "condor") == 0) { rc = globus_gram_job_manager_init_seg(&manager); /* TODO: If SEG load fails and load_all added some to the * job_id hash, they will need to be pushed into the state * machine so that polling fallback can happen. */ if (rc != GLOBUS_SUCCESS) { config.seg_module = NULL; } } /* GRAM-128: * Register a periodic event to process the GRAM jobs that were * reloaded from their job state files at job manager start time. * This will acquire and then release a reference to each job, * which, behind the scenes, will kick of the state machine * for that job if needed. */ if (!globus_list_empty(manager.pending_restarts)) { globus_reltime_t restart_period; GlobusTimeReltimeSet(restart_period, 1, 0); rc = globus_callback_register_periodic( &manager.pending_restart_handle, NULL, &restart_period, globus_l_gram_process_pending_restarts, &manager); } { globus_reltime_t expire_period; GlobusTimeReltimeSet(expire_period, 1, 0); rc = globus_callback_register_periodic( &manager.expiration_handle, NULL, &expire_period, globus_gram_job_manager_expire_old_jobs, &manager); } { globus_reltime_t lockcheck_period; GlobusTimeReltimeSet(lockcheck_period, 60, 0); rc = globus_callback_register_periodic( &manager.lockcheck_handle, NULL, &lockcheck_period, globus_l_gram_lockcheck, &manager); } { globus_reltime_t idlescript_period; GlobusTimeReltimeSet(idlescript_period, 60, 0); rc = globus_callback_register_periodic( &manager.idle_script_handle, NULL, &idlescript_period, globus_gram_script_close_idle, &manager); } } else if (http_body_fd >= 0) { /* If manager.socket_fd == -1 then we are either the child from the * fork or another process started somehow (either command-line * invocation or via a job submit). If we have a client, then we'll * send our fds to the job manager with the lock and let it process * the job. * * If this succeeds, we set located_active_jm and leave the loop. * Otherwise, we try again. */ if (context_fd >= 0) { rc = globus_gram_job_manager_starter_send( &manager, http_body_fd, context_fd, fileno(stdout), cred); } else { rc = globus_gram_job_manager_starter_send_v2( &manager, cred); } if (rc == GLOBUS_SUCCESS) { located_active_jm = GLOBUS_TRUE; close(http_body_fd); if (context_fd >= 0) { close(context_fd); } manager.done = GLOBUS_TRUE; } else { globus_libc_usleep(250000); } } else { /* We were started by hand, but another process is currently the * main job manager */ unsigned long realpid = 0; FILE * pidin = fopen(manager.pid_path, "r"); fscanf(pidin, "%lu", &realpid); fclose(pidin); fprintf(stderr, "Other job manager process with pid %lu running and processing jobs\n", realpid); exit(0); } } /* Ignore SIGCHILD, and automatically reap child processes. Because of the * fork() above to delegate to another job manager process, and the use of * sub-processes to invoke the perl modules, we create some other * processes. We don't care too much how they exit, so we'll just make sure * we don't create zombies out of them. */ { struct sigaction act; act.sa_handler = SIG_IGN; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGCHLD); #ifdef SA_NOCLDWAIT act.sa_flags = SA_NOCLDWAIT; #else /* This may leave zombies running on non-POSIX systems like Hurd */ act.sa_flags = 0; #endif sigaction(SIGCHLD, &act, NULL); } /* Enable log rotation via SIGUSR1 */ { struct sigaction act; act.sa_handler = globus_i_job_manager_log_rotate; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGUSR1); act.sa_flags = 0; sigaction(SIGUSR1, &act, NULL); } GlobusGramJobManagerLock(&manager); if (manager.socket_fd != -1 && globus_hashtable_empty(&manager.request_hash) && manager.grace_period_timer == GLOBUS_NULL_HANDLE) { globus_gram_job_manager_set_grace_period_timer(&manager); } /* For the active job manager, this will block until all jobs have * terminated. For any other job manager, the monitor.done is set to * GLOBUS_TRUE and this falls right through. */ while (! manager.done) { GlobusGramJobManagerWait(&manager); } if (manager.expiration_handle != GLOBUS_NULL_HANDLE) { globus_callback_unregister(manager.expiration_handle, NULL, NULL, NULL); } if (manager.lockcheck_handle != GLOBUS_NULL_HANDLE) { globus_callback_unregister(manager.lockcheck_handle, NULL, NULL, NULL); } if (manager.idle_script_handle != GLOBUS_NULL_HANDLE) { globus_callback_unregister(manager.idle_script_handle, NULL, NULL, NULL); } GlobusGramJobManagerUnlock(&manager); globus_gram_job_manager_log( &manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.end " "level=DEBUG " "\n"); /* Clean-up to do if we are the active job manager only */ if (manager.socket_fd != -1) { globus_gram_job_manager_script_close_all(&manager); globus_i_gram_usage_end_session_stats(&manager); globus_i_gram_usage_stats_destroy(&manager); remove(manager.pid_path); remove(manager.cred_path); remove(manager.socket_path); remove(manager.lock_path); } globus_gram_job_manager_logging_destroy(); globus_gram_job_manager_destroy(&manager); globus_gram_job_manager_config_destroy(&config); rc = globus_l_gram_deactivate(); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "deactivation failed with rc=%d\n", rc); exit(1); } /* { const char * gk_jm_id_var = "GATEKEEPER_JM_ID"; const char * gk_jm_id = globus_libc_getenv(gk_jm_id_var); globus_gram_job_manager_request_acct( request, "%s %s JM exiting\n", gk_jm_id_var, gk_jm_id ? gk_jm_id : "none"); } */ return(0); } /* main() */ #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL /** * Activate all globus modules used by the job manager * * Attempts to activate all of the modules used by the job manager. In the * case of an error, a diagnostic message is printed to stderr. * * @retval GLOBUS_SUCCESS * Success * @retval all other * A module failed to activate */ static int globus_l_gram_job_manager_activate(void) { int rc; globus_result_t result; globus_module_descriptor_t * modules[] = { GLOBUS_COMMON_MODULE, GLOBUS_CALLOUT_MODULE, GLOBUS_GSI_SYSCONFIG_MODULE, GLOBUS_GSI_GSSAPI_MODULE, GLOBUS_GSI_GSS_ASSIST_MODULE, GLOBUS_GRAM_JOBMANAGER_CALLOUT_ERROR_MODULE, GLOBUS_XIO_MODULE, GLOBUS_GRAM_PROTOCOL_MODULE, GLOBUS_GASS_CACHE_MODULE, NULL }; globus_module_descriptor_t * failed_module = NULL; rc = globus_module_activate_array(modules, &failed_module); if (rc != GLOBUS_SUCCESS) { fprintf(stderr, "Error (%d) activating %s\n", rc, failed_module->module_name); goto activate_failed; } result = globus_l_gram_create_stack( "file", &globus_i_gram_job_manager_file_stack, &globus_i_gram_job_manager_file_driver); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_FAILURE; goto stack_init_failed; } result = globus_l_gram_create_stack( "popen", &globus_i_gram_job_manager_popen_stack, &globus_i_gram_job_manager_popen_driver); if (result != GLOBUS_SUCCESS) { goto destroy_file_stack; } if (rc != GLOBUS_SUCCESS) { destroy_file_stack: globus_xio_stack_destroy(globus_i_gram_job_manager_file_stack); globus_xio_driver_unload(globus_i_gram_job_manager_file_driver); stack_init_failed: activate_failed: ; } return rc; } /* globus_l_gram_job_manager_activate() */ static int globus_l_gram_deactivate(void) { (void) globus_xio_stack_destroy( globus_i_gram_job_manager_file_stack); (void) globus_xio_stack_destroy( globus_i_gram_job_manager_popen_stack); globus_xio_driver_unload(globus_i_gram_job_manager_file_driver); globus_xio_driver_unload(globus_i_gram_job_manager_popen_driver); return globus_module_deactivate_all(); } /* globus_l_gram_deactivate(void) */ static globus_result_t globus_l_gram_create_stack( const char * driver_name, globus_xio_stack_t * stack, globus_xio_driver_t * driver) { globus_result_t result; result = globus_xio_driver_load( driver_name, driver); if (result != GLOBUS_SUCCESS) { goto driver_load_failed; } result = globus_xio_stack_init(stack, NULL); if (result != GLOBUS_SUCCESS) { goto stack_init_failed; } result = globus_xio_stack_push_driver( *stack, *driver); if (result != GLOBUS_SUCCESS) { goto driver_push_failed; } if (result != GLOBUS_SUCCESS) { driver_push_failed: globus_xio_stack_destroy(*stack); *stack = NULL; stack_init_failed: globus_xio_driver_unload(*driver); *driver = NULL; driver_load_failed: ; } return result; } /* globus_l_gram_create_stack() */ static void reply_and_exit( globus_gram_job_manager_t * manager, int rc, char * gt3_failure_message) { int myrc; int context_fd; gss_ctx_id_t response_context = GSS_C_NO_CONTEXT; char * fd_env; fd_env = getenv("GRID_SECURITY_CONTEXT_FD"); myrc = sscanf(fd_env ? fd_env : "-1", "%d", &context_fd); if (myrc == 1 && context_fd >= 0) { myrc = globus_gram_job_manager_import_sec_context( NULL, context_fd, &response_context); } globus_gram_job_manager_reply( NULL, manager, rc, NULL, 1, response_context, gt3_failure_message); exit(0); } /* reply_and_exit() */ static void globus_l_gram_process_pending_restarts( void * arg) { globus_gram_job_manager_t * manager = arg; void * key; char gramid[64]; int i; int rc; int restarted=0; globus_gram_jobmanager_request_t * request; GlobusGramJobManagerLock(manager); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.process_pending_restarts.start " "level=DEBUG " "pending_restarts=%d " "\n", globus_list_size(manager->pending_restarts)); GlobusGramJobManagerUnlock(manager); for (i = 0; i < 20; i++) { GlobusGramJobManagerLock(manager); if (manager->pending_restarts == NULL) { GlobusGramJobManagerUnlock(manager); break; } key = globus_list_first(manager->pending_restarts); globus_assert(key != NULL); strncpy(gramid, key, sizeof(gramid)); GlobusGramJobManagerUnlock(manager); /* * This call below will remove the job from the list when it * reloads it and start the state machine. */ rc = globus_gram_job_manager_add_reference( manager, gramid, "restart job", &request); /* If this fails, then removing the reference will allow it * to potentially hit negative counts */ if (rc == GLOBUS_SUCCESS) { restarted++; /* XXX: What if this fails? */ rc = globus_gram_job_manager_remove_reference( manager, gramid, "restart job"); } } GlobusGramJobManagerLock(manager); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.process_pending_restarts.end " "level=DEBUG " "processed=%d " "pending_restarts=%d " "\n", restarted, globus_list_size(manager->pending_restarts)); if (manager->pending_restarts == NULL) { globus_callback_unregister( manager->pending_restart_handle, NULL, NULL, NULL); manager->pending_restart_handle = GLOBUS_NULL_HANDLE; GlobusGramJobManagerUnlock(manager); return; } GlobusGramJobManagerUnlock(manager); } static void globus_l_gram_cputype_and_manufacturer( globus_gram_job_manager_config_t * config) { char *config_guess_path = NULL; FILE *config_guess = NULL; char config_guessbuf[32]; char *hyphen, *hyphen2; if (config->globus_host_manufacturer == NULL || config->globus_host_cputype == NULL) { /* No config.guess-$hostname yet */ globus_eval_path( "${datadir}/globus/config.guess", &config_guess_path); if (config_guess_path != NULL) { config_guess = popen(config_guess_path, "r"); if (config_guess != NULL) { if (fgets(config_guessbuf, sizeof(config_guessbuf), config_guess) != NULL) { hyphen = strchr(config_guessbuf, '-'); if (config->globus_host_cputype == NULL && hyphen) { *hyphen = '\0'; config->globus_host_cputype = strdup(config_guessbuf); } hyphen++; hyphen2 = strchr(hyphen, '-'); if (config->globus_host_manufacturer == NULL && hyphen2) { *hyphen2 = '\0'; config->globus_host_manufacturer = strdup(hyphen); } } pclose(config_guess); } free(config_guess_path); } } } static void globus_l_gram_lockcheck( void * arg) { globus_gram_job_manager_t * manager = arg; struct stat lockfile_stat = {0}, lockfd_stat = {0}; int lockfile_errno = 0, lockfd_errno = 0; int rc; char *msg1 = NULL, *msg2 = NULL, *msg3 = NULL; errno = 0; rc = stat(manager->lock_path, &lockfile_stat); if (rc < 0) { msg1 = "Cannot stat lockfile"; lockfile_errno = errno; } rc = fstat(manager->lock_fd, &lockfd_stat); if (rc < 0) { lockfd_errno = errno; msg2 = "Cannot stat lockfd"; } if (msg1 == NULL && msg2 == NULL) { if (lockfd_stat.st_ino != lockfile_stat.st_ino) { msg3 = "Lockfile replaced"; } } if (msg1 != NULL || msg2 != NULL || msg3 != NULL) { goto fatal; } return; fatal: globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_FATAL, "event=gram.jobmanager.end " "level=FATAL " "message=\"Lockfile sanity check failed, aborting\" " "lockfile=\"%s\" " "lockfile_inode=%ld " "lockfile_errno=%d " "lockfile_message=\"%s\" " "lockfd=%d " "lockfd_inode=%ld " "lockfd_errno=%d " "lockfd_message=\"%s\" " "%s%s%s" "%s%s%s" "%s%s%s" "\n", manager->lock_path, (long int) lockfile_stat.st_ino, lockfile_errno, strerror(lockfile_errno), manager->lock_fd, (long int) lockfd_stat.st_ino, lockfd_errno, strerror(lockfile_errno), (msg1 != NULL) ? "msg1=\"" : "", (msg1 != NULL) ? msg1 : "", (msg1 != NULL) ? "\" " : "", (msg2 != NULL) ? "msg2=\"" : "", (msg2 != NULL) ? msg2 : "", (msg2 != NULL) ? "\" " : "", (msg3 != NULL) ? "msg3=\"" : "", (msg3 != NULL) ? msg3 : "", (msg3 != NULL) ? "\" " : ""); abort(); } /* globus_l_gram_lockcheck() */ #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ globus_gram_job_manager-13.53/rsl.xml0000666000076400007640000003604411735076151014646 00000000000000 rsl 5 University of Chicago rsl GRAM5 RSL Attributes Description arguments The command line arguments for the executable. Use quotes, if a space is required in a single argument. count The number of executions of the executable. [Default: 1] directory Specifies the path of the directory the jobmanager will use as the default directory for the requested job. [Default: $(HOME)] dry_run If dryrun = yes then the jobmanager will not submit the job for execution and will return success. [Default: no] environment The environment variables that will be defined for the executable in addition to default set that is given to the job by the jobmanager. executable The name of the executable file to run on the remote machine. If the value is a GASS URL, the file is transferred to the remote gass cache before executing the job and removed after the job has terminated. expiration Time (in seconds) after a a job fails to receive a two-phase commit end signal before it is cleaned up. [Default: 14400] file_clean_up Specifies a list of files which will be removed after the job is completed. file_stage_in Specifies a list of ("remote URL" "local file") pairs which indicate files to be staged to the nodes which will run the job. file_stage_in_shared Specifies a list of ("remote URL" "local file") pairs which indicate files to be staged into the cache. A symlink from the cache to the "local file" path will be made. file_stage_out Specifies a list of ("local file" "remote URL") pairs which indicate files to be staged from the job to a GASS-compatible file server. gass_cache Specifies location to override the GASS cache location. gram_my_job Obsolete and ignored. [Default: collective] host_count Only applies to clusters of SMP computers, such as newer IBM SP systems. Defines the number of nodes ("pizza boxes") to distribute the "count" processes across. job_type This specifies how the jobmanager should start the job. Possible values are single (even if the count > 1, only start 1 process or thread), multiple (start count processes or threads), mpi (use the appropriate method (e.g. mpirun) to start a program compiled with a vendor-provided MPI library. Program is started with count nodes), and condor (starts condor jobs in the "condor" universe.) [Default: multiple] library_path Specifies a list of paths to be appended to the system-specific library path environment variables. [Default: $(GLOBUS_LOCATION)/lib] loglevel Override the default log level for this job. The value of this attribute consists of a combination of the strings FATAL, ERROR, WARN, INFO, DEBUG, TRACE joined by the | character logpattern Override the default log path pattern for this job. The value of this attribute is a string (potentially containing RSL substitutions) that is evaluated to the path to write the log to. If the resulting string contains the string $(DATE) (or any other RSL substitution), it will be reevaluated at log time. max_cpu_time Explicitly set the maximum cputime for a single execution of the executable. The units is in minutes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set cputime, then an error will be returned. max_memory Explicitly set the maximum amount of memory for a single execution of the executable. The units is in Megabytes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set maxMemory, then an error will be returned. max_time The maximum walltime or cputime for a single execution of the executable. Walltime or cputime is selected by the GRAM scheduler being interfaced. The units is in minutes. The value will go through an atoi() conversion in order to get an integer. max_wall_time Explicitly set the maximum walltime for a single execution of the executable. The units is in minutes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set walltime, then an error will be returned. min_memory Explicitly set the minimum amount of memory for a single execution of the executable. The units is in Megabytes. The value will go through an atoi() conversion in order to get an integer. If the GRAM scheduler cannot set minMemory, then an error will be returned. project Target the job to be allocated to a project account as defined by the scheduler at the defined (remote) resource. proxy_timeout Obsolete and ignored. Now a job-manager-wide setting. queue Target the job to a queue (class) name as defined by the scheduler at the defined (remote) resource. remote_io_url Writes the given value (a URL base string) to a file, and adds the path to that file to the environment throught the GLOBUS_REMOTE_IO_URL environment variable. If this is specified as part of a job restart RSL, the job manager will update the file's contents. This is intended for jobs that want to access files via GASS, but the URL of the GASS server has changed due to a GASS server restart. restart Start a new job manager, but instead of submitting a new job, start managing an existing job. The job manager will search for the job state file created by the original job manager. If it finds the file and successfully reads it, it will become the new manager of the job, sending callbacks on status and streaming stdout/err if appropriate. It will fail if it detects that the old jobmanager is still alive (via a timestamp in the state file). If stdout or stderr was being streamed over the network, new stdout and stderr attributes can be specified in the restart RSL and the jobmanager will stream to the new locations (useful when output is going to a GASS server started by the client that's listening on a dynamic port, and the client was restarted). The new job manager will return a new contact string that should be used to communicate with it. If a jobmanager is restarted multiple times, any of the previous contact strings can be given for the restart attribute. rsl_substitution Specifies a list of values which can be substituted into other rsl attributes' values through the $(SUBSTITUTION) mechanism. save_state Causes the jobmanager to save it's job state information to a persistent file on disk. If the job manager exits or is suspended, the client can later start up a new job manager which can continue monitoring the job. savejobdescription Save a copy of the job description to $HOME [Default: no] scratch_dir Specifies the location to create a scratch subdirectory in. A SCRATCH_DIRECTORY RSL substitution will be filled with the name of the directory which is created. stderr The name of the remote file to store the standard error from the job. If the value is a GASS URL, the standard error from the job is transferred dynamically during the execution of the job. There are two accepted forms of this value. It can consist of a single destination: stderr = URL, or a sequence of destinations: stderr = (DESTINATION) (DESTINATION). In the latter case, the DESTINATION may itself be a URL or a sequence of an x-gass-cache URL followed by a cache tag. [Default: /dev/null] stderr_position Specifies where in the file remote standard error streaming should be restarted from. Must be 0. stdin The name of the file to be used as standard input for the executable on the remote machine. If the value is a GASS URL, the file is transferred to the remote gass cache before executing the job and removed after the job has terminated. [Default: /dev/null] stdout The name of the remote file to store the standard output from the job. If the value is a GASS URL, the standard output from the job is transferred dynamically during the execution of the job. There are two accepted forms of this value. It can consist of a single destination: stdout = URL, or a sequence of destinations: stdout = (DESTINATION) (DESTINATION). In the latter case, the DESTINATION may itself be a URL or a sequence of an x-gass-cache URL followed by a cache tag. [Default: /dev/null] stdout_position Specifies where in the file remote output streaming should be restarted from. Must be 0. two_phase Use a two-phase commit for job submission and completion. The job manager will respond to the initial job request with a WAITING_FOR_COMMIT error. It will then wait for a signal from the client before doing the actual job submission. The integer supplied is the number of seconds the job manager should wait before timing out. If the job manager times out before receiving the commit signal, or if a client issues a cancel signal, the job manager will clean up the job's files and exit, sending a callback with the job status as GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED. After the job manager sends a DONE or FAILED callback, it will wait for a commit signal from the client. If it receives one, it cleans up and exits as usual. If it times out and save_state was enabled, it will leave all of the job's files in place and exit (assuming the client is down and will attempt a job restart later). The timeoutvalue can be extended via a signal. When one of the following errors occurs, the job manager does not delete the job state file when it exits: GLOBUS_GRAM_PROTOCOL_ERROR_COMMIT_TIMED_OUT, GLOBUS_GRAM_PROTOCOL_ERROR_TTL_EXPIRED, GLOBUS_GRAM_PROTOCOL_ERROR_JM_STOPPED, GLOBUS_GRAM_PROTOCOL_ERROR_USER_PROXY_EXPIRED. In these cases, it can not be restarted, so the job manager will not wait for the commit signal after sending the FAILED callback username Verify that the job is running as this user. globus_gram_job_manager-13.53/globus_automake_pre_top0000644000076400007640000000000012055152374020131 00000000000000globus_gram_job_manager-13.53/gptdata.sh0000664000076400007640000000034612145177134015275 00000000000000GPT_NAME='globus_gram_job_manager' GPT_MAJOR_VERSION='13' GPT_MINOR_VERSION='53' GPT_AGE_VERSION='0' GPT_CFLAGS='@GPT_PKG_CFLAGS@' GPT_INCLUDES='@GPT_EXTERNAL_INCLUDES@' GPT_LIBS='@GPT_EXTERNAL_LIBS@' GPT_BUILD_WITH_FLAVORS='yes' globus_gram_job_manager-13.53/job_execution_environment.dox0000666000076400007640000000747011620260407021312 00000000000000/** @page globus_gram_job_manager_job_execution_environment Job Execution Environment @section globus_gram_job_manager_env_vars Environment Variables The GRAM Job Manager provides a minimal environment for user's jobs. The following environment variables will be set by the job manager. Variables marked with an asterisk (*) will only be set if a related job manager configuration option or RSL attribute is provided. Local schedulers may set additional environment variables. @par HOME The user's home directory. @par LOGNAME The user's login name. @par X509_USER_PROXY The path to the job manager's delegated credential. (GSI only). @par GLOBUS_GRAM_JOB_CONTACT The job manager's contact string for this job. @par GLOBUS_LOCATION The path to the Globus installation on the job manager host. @par X509_CERT_DIR* The path to a trusted certificate directory. This variable will only be set if the -x509-cert-dir argument is given to the job manager. @par GLOBUS_GASS_CACHE_DEFAULT* The path to the job's GASS cache (if the gass_cache RSL attribute is present). @par GLOBUS_TCP_PORT_RANGE* A system-specific range of TCP ports which may be used by the job. Globus I/O will automatically honor this range. Only present if the related configuration option is present in the job manager configuration file. @par GLOBUS_REMOTE_IO_URL* The path to a file containing a URL string of a GASS server which the job may access (if the remote_io_url attribute is present). @par GLOBUS_NEXUS_NO_GSI Disables GSI in Nexus's TCP protocol, for compatibility with Nexus 4.6 and earlier. @section globus_gram_job_manager_rsl_subs RSL Substitions In addition to the environment variables described above, a number of RSL substitutions are made available by the job manager. These substitions may be added to the environment by the job RSL if needed. @par HOME The user's home directory. @par LOGNAME The user's login name. @par GLOBUS_ID The subject name of the security credentials under which the job is running. @par GLOBUS_GRAM_JOB_CONTACT The job manager's contact string for this job. @par GLOBUS_HOST_MANUFACTURER The manufacturer part of the host configuration string (derived from config.guess) @par GLOBUS_HOST_CPUTYPE The CPU type part of the host configuration string (derived from config.guess) @par GLOBUS_HOST_OSNAME The operating system name part of the host configuration string (derived from config.guess) @par GLOBUS_HOST_OSVERSION The operating system version number part of the host configuration string (derived from config.guess) @par GLOBUS_GATEKEEPER_HOST The name of the host on which the gatekeeper is running. @par GLOBUS_GATEKEEPER_PORT The TCP port which on which the gatekeeper is accepting connections. @par GLOBUS_GATEKEEPER_SUBJECT The subject name of the security credentials under which the gatekeeper is running. @par GLOBUS_LOCATION The path to the Globus installation on the job manager host. @par GLOBUS_CACHED_STDOUT The name of the local file in the cache where stdout is being stored. This may be used as the value of the stdout RSL attribute to cause one copy of output to be stored in the cache. A stdio_update signal may be used to retrieve the output when the job is finishing. @par GLOBUS_CACHED_STDERR The name of the local file in the cache where stderr is being stored. This may be used as the value of the stderr RSL attribute to cause one copy of output to be stored in the cache. A stdio_update signal may be used to retrieve the output when the job is finishing. @par SCRATCH_DIRECTORY The path of the scratch directory for this job. (Only set if the scratch_dir RSL attribute is used). @par GLOBUS_CONDOR_ARCH The condor name of the architecture which the job manager is handling jobs for. (deprecated) @par GLOBUS_CONDOR_OS The condor name of the operating system which the job manager is handling jobs for. (deprecated) */ globus_gram_job_manager-13.53/manual.xml0000666000076400007640000000305611272324167015317 00000000000000 ] > GRAM5 Commands globus_gram_job_manager-13.53/globus-personal-gatekeeper.10000666000076400007640000001624611735076151020636 00000000000000'\" t .\" Title: globus-personal-gatekeeper .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 03/29/2012 .\" Manual: GRAM5 Commands .\" Source: University of Chicago .\" Language: English .\" .TH "GLOBUS\-PERSONAL\-GA" "1" "03/29/2012" "University of Chicago" "GRAM5 Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" globus-personal-gatekeeper \- Manage a user\*(Aqs personal gatekeeper daemon .SH "SYNOPSIS" .HP \w'\fBglobus\-personal\-gatekeeper\fR\ 'u \fBglobus\-personal\-gatekeeper\fR [\-help] [\-usage] [\-version] [\-versions] [\-list] [\-directory\ \fICONTACT\fR] .HP \w'\fBglobus\-personal\-gatekeeper\fR\ 'u \fBglobus\-personal\-gatekeeper\fR [\-debug] {\-start} [\-jmtype\ \fILRM\fR] [\-auditdir\ \fIAUDIT_DIRECTORY\fR] [\-port\ \fIPORT\fR] [\-log\ [=\fIDIRECTORY\fR]] [\-seg] [\-acctfile\ \fIACCOUNTING_FILE\fR] .HP \w'\fBglobus\-personal\-gatekeeper\fR\ 'u \fBglobus\-personal\-gatekeeper\fR [\-killall] [\-kill] .SH "DESCRIPTION" .PP The \fBglobus\-personal\-gatekeeper\fR command is a utility which manages a gatekeeper and job manager service for a single user\&. Depending on the command\-line arguments it will operate in one of several modes\&. In the first set of arguments indicated in the synopsis, the program provides information about the \fBglobus\-personal\-gatekeeper\fR command or about instances of the \fBglobus\-personal\-gatekeeper\fR that are running currently\&. The second set of arguments indicated in the synopsis provide control over starting a new \fBglobus\-personal\-gatekeeper\fR instance\&. The final set of arguments provide control for terminating one or more \fBglobus\-personal\-gatekeeper\fR instances\&. .PP The \fB\-start\fR mode will create a new subdirectory of \fB$HOME\fR/\&.globus and write the configuration files needed to start a \fBglobus\-gatekeeper\fR daemon which will invoke the \fBglobus\-job\-manager\fR service when new authenticated connections are made to its service port\&. The \fBglobus\-personal\-gatekeeper\fR then exits, printing the contact string for the new gatekeeper prefixed by GRAM contact: to standard output\&. In addition to the arguments described above, any arguments described in \fBglobus\-job\-manager(8)\fR can be appended to the command\-line and will be added to the job manager configuration for the service started by the \fBglobus\-gatekeeper\fR\&. .PP The new \fBglobus\-gatekeeper\fR will continue to run in the background until killed by invoking \fBglobus\-personal\-gatekeeper\fR with the \fB\-kill\fR or \fB\-killall\fR argument\&. When killed, it will kill the \fBglobus\-gatekeeper\fR and \fBglobus\-job\-manager\fR processes, remove state files and configuration data, and then exit\&. Jobs which are running when the personal gatekeeper is killed will continue to run, but their job directory will be destroyed so they may fail in the LRM\&. .PP The full set of command\-line options to \fBglobus\-personal\-gatekeeper\fR consists of: .PP \fB\-help\fR, \fB\-usage\fR .RS 4 Print command\-line option summary and exit .RE .PP \fB\-version\fR .RS 4 Print software version .RE .PP \fB\-versions\fR .RS 4 Print software version including DiRT information .RE .PP \fB\-list\fR .RS 4 Print a list of all currently running personal gatekeepers\&. These entries will be printed one per line\&. .RE .PP \fB\-directory \fR\fB\fICONTACT\fR\fR .RS 4 Print the configuration directory for the personal gatekeeper with the contact string \fICONTACT\fR\&. .RE .PP \fB\-debug\fR .RS 4 Print additional debugging information when starting a personal gatekeeper\&. This option is ignored in other modes\&. .RE .PP \fB\-start\fR .RS 4 Start a new personal gatekeeper process\&. .RE .PP \fB\-jmtype \fR\fB\fILRM\fR\fR .RS 4 Use \fILRM\fR as the local resource manager interface\&. If not provided when starting a personal gatekeeper, the job manager will use the default fork LRM\&. .RE .PP \fB\-auditdir \fR\fB\fIAUDIT_DIRECTORY\fR\fR .RS 4 Write audit report files to \fIAUDIT_DIRECTORY\fR\&. If not provided, the job manager will not write any audit files\&. .RE .PP \fB\-port \fR\fB\fIPORT\fR\fR .RS 4 Listen for gatekeeper TCP/IP connections on the port \fIPORT\fR\&. If not provided, the gatekeeper will let the operating system choose\&. .RE .PP \fB\-log\fR\fB[=\fIDIRECTORY\fR]\fR .RS 4 Write job manager log files to \fIDIRECTORY\fR\&. If \fIDIRECTORY\fR is omitted, the default of \fB$HOME\fR will be used\&. If this option is not present, the job manager will not write any log files\&. .RE .PP \fB\-seg\fR .RS 4 Try to use the SEG mechanism to receive job state change information, instead of polling for these\&. These require either the system administrator or the user to run an instance of the \fBglobus\-job\-manager\-event\-generator\fR program for the LRM specified by the \fB\-jmtype\fR option\&. .RE .PP \fB\-acctfile \fR\fB\fIACCOUNTING_FILE\fR\fR .RS 4 Write gatekeeper accounting entries to \fIACCOUNTING_FILE\fR\&. If not provided, no accounting records are written\&. .RE .SH "EXAMPLES" .PP This example shows the output when starting a new personal gatekeeper which will schedule jobs via the lsf LRM, with debugging enabled\&. .sp .if n \{\ .RS 4 .\} .nf % \fBglobus\-personal\-gatekeeper \-start \-jmtype lsf\fR verifying setup\&.\&.\&. done\&. GRAM contact: personal\-grid\&.example\&.org:57846:/DC=org/DC=example/CN=Joe User .fi .if n \{\ .RE .\} .PP This example shows the output when listing the current active personal gatekeepers\&. .sp .if n \{\ .RS 4 .\} .nf % \fBglobus\-personal\-gatekeeper \-list\fR personal\-grid\&.example\&.org:57846:/DC=org/DC=example/CN=Joe User .fi .if n \{\ .RE .\} .PP This example shows the output when querying the configuration directory for th eabove personal gatekeeper\&. gatekeepers\&. .sp .if n \{\ .RS 4 .\} .nf % \fBglobus\-personal\-gatekeeper \-directory "personal\-grid\&.example\&.org:57846:/DC=org/DC=example/CN=Joe User"\fR /home/juser/\&.globus/\&.personal\-gatekeeper\&.personal\-grid\&.example\&.org\&.1337 .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf % \fBglobus\-personal\-gatekeeper \-kill "personal\-grid\&.example\&.org:57846:/DC=org/DC=example/CN=Joe User"\fR killing gatekeeper: "personal\-grid\&.example\&.org:57846:/DC=org/DC=example/CN=Joe User" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBglobusrun\fR(1), \fBglobus-job-manager\fR(8), \fBglobus-gatekeeper\fR(8) globus_gram_job_manager-13.53/tg_gateway.c0000666000076400007640000002444112145172466015623 00000000000000/* * Portions of this file Copyright 1999-2009 University of Chicago * Portions of this file Copyright 1999-2009 The University of Southern Californ ia. * * 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_common.h" #include "gssapi.h" #include "globus_gram_protocol.h" #include "globus_gsi_credential.h" #if HAVE_LIBXML2 #include "libxml/parser.h" #include "libxml/xpath.h" #include "libxml/xpathInternals.h" #include "libxml/tree.h" #include "openssl/x509.h" static gss_OID_desc globus_l_saml_oid_desc = {11, (void *) "\x2B\x06\x01\x04\x01\x9B\x50\x01\x01\x01\x0C" }; gss_OID globus_saml_oid = &globus_l_saml_oid_desc; globus_bool_t globus_l_tg_saml_assertion_is_self_issued( gss_ctx_id_t ctx, const char * entity_id) { /* TODO: Process trusted authorities entities map */ return GLOBUS_TRUE; } /* globus_l_tg_saml_assertion_is_self_issued() */ #endif /* HAVE_LIBXML2 */ int globus_i_gram_get_tg_gateway_user( gss_ctx_id_t context, globus_gsi_cred_handle_t peer_cred, char ** gateway_user) { #if HAVE_LIBXML2 OM_uint32 maj_stat, min_stat; gss_buffer_set_t data_set; ASN1_UTF8STRING * asn1_str; char * assertion_string; unsigned char * p; long pl; xmlDocPtr doc; xmlXPathContextPtr xpath_ctx; xmlXPathObjectPtr xresult; int rc; ASN1_OBJECT * asn1_desired_object = NULL; int cert_count; int found_index; int chain_index; X509 *cert; X509_EXTENSION * extension; ASN1_OCTET_STRING *asn1_oct_string; STACK_OF(X509) *chain = NULL; *gateway_user = NULL; if (context == GSS_C_NO_CONTEXT && peer_cred != NULL) { globus_result_t result; /* This basically duplicates the gss_inquire_sec_context_by_oid(), but * instead uses a gsi credential object */ rc = GLOBUS_SUCCESS; asn1_desired_object = ASN1_OBJECT_new(); if (asn1_desired_object == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto no_extension_in_cred_chain; } asn1_desired_object->length = globus_l_saml_oid_desc.length; asn1_desired_object->data = globus_l_saml_oid_desc.elements; result = globus_gsi_cred_get_cert_chain(peer_cred, &chain); if (result != GLOBUS_SUCCESS) { char * msg; msg = globus_error_print_friendly( globus_error_peek(result)); globus_gram_protocol_error_7_hack_replace_message( msg); free(msg); rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; goto no_extension_in_cred_chain; } cert_count = sk_X509_num(chain); found_index = -1; for (chain_index = 0; chain_index < cert_count; chain_index++) { cert = sk_X509_value(chain, chain_index); found_index = X509_get_ext_by_OBJ(cert, asn1_desired_object, found_index); if (found_index >= 0) { extension = X509_get_ext(cert, found_index); if (extension == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; globus_gram_protocol_error_7_hack_replace_message( "Unable to extract SAML assertion extension from certificate chain"); goto no_extension_in_cred_chain; } asn1_oct_string = X509_EXTENSION_get_data(extension); if (asn1_oct_string == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; globus_gram_protocol_error_7_hack_replace_message( "Unable to extract SAML assertion extension from certificate chain"); goto no_extension_in_cred_chain; } p = asn1_oct_string->data; asn1_str = d2i_ASN1_UTF8STRING(NULL, (void *)&p, asn1_oct_string->length); if (asn1_str == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; globus_gram_protocol_error_7_hack_replace_message( "Unable to convert SAML assertion text from DER to UTF8"); goto no_extension_in_cred_chain; } assertion_string = malloc(asn1_str->length + 1); if (assertion_string == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto no_extension_in_cred_chain; } memcpy(assertion_string, asn1_str->data, asn1_str->length); assertion_string[asn1_str->length] = 0; break; } } if (chain_index == cert_count) { goto no_extension_in_cred_chain; } } else if (context == GSS_C_NO_CONTEXT) { rc = GLOBUS_SUCCESS; goto no_context; } else { maj_stat = gss_inquire_sec_context_by_oid( &min_stat, context, globus_saml_oid, &data_set); if (GSS_ERROR(maj_stat)) { globus_gram_protocol_error_7_hack_replace_message( "Error extracting SAML assertion"); rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; goto inquire_failed; } /* We'll process only the first SAML assertion bound in the X.509 chain */ if (data_set->count < 1) { rc = GLOBUS_SUCCESS; goto empty_data_set; } p = data_set->elements[0].value; pl = data_set->elements[0].length; /* Convert DER-Encoded string to UTF8 */ asn1_str = d2i_ASN1_UTF8STRING(NULL, (void *) &p, pl); if (!asn1_str) { globus_gram_protocol_error_7_hack_replace_message( "Error decoding SAML assertion"); rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; goto utfstring_failed; } assertion_string = malloc(asn1_str->length + 1); if (assertion_string == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto assertion_string_malloc_failed; } memcpy(assertion_string, asn1_str->data, asn1_str->length); assertion_string[asn1_str->length] = 0; } /* Parse SAML assertion */ doc = xmlParseDoc(BAD_CAST assertion_string); if (doc == NULL) { globus_gram_protocol_error_7_hack_replace_message( "Error parsing SAML assertion"); rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; goto parse_assertion_failed; } xmlXPathInit(); /* Use XPATH to extract Issuer */ xpath_ctx = xmlXPathNewContext(doc); if (xpath_ctx == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto xpath_ctx_init_failed; } rc = xmlXPathRegisterNs( xpath_ctx, (xmlChar *) "s", (xmlChar *) "urn:oasis:names:tc:SAML:1.0:assertion"); if (rc != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto xpath_register_ns_failed; } xresult = xmlXPathEvalExpression( (const xmlChar *) "string(/s:Assertion/@Issuer)", xpath_ctx); if (xresult == NULL) { globus_gram_protocol_error_7_hack_replace_message( "Error processing SAML assertion: no \"Issuer\" attribute"); rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; goto xpath_eval_issuer_failed; } if (! globus_l_tg_saml_assertion_is_self_issued( context, (const char *) xresult->stringval)) { /* Ignore non-self issued assertions */ rc = GLOBUS_SUCCESS; goto non_self_issued; } xmlXPathFreeObject(xresult); /* Use XPATH to extract the sender-vouches, self-issued, TG principal name * Subject attribute from the Assertion's AuthenticationStatement */ xresult = xmlXPathEvalExpression( (const xmlChar *) "string(/s:Assertion/s:AuthenticationStatement/s:Subject[string(s:SubjectConfirmation/s:ConfirmationMethod) = 'urn:oasis:names:tc:SAML:1.0:cm:sender-vouches' and s:NameIdentifier/@Format = 'http://teragrid.org/names/nameid-format/principalname']/s:NameIdentifier[1])", xpath_ctx); if (xresult == NULL) { globus_gram_protocol_error_7_hack_replace_message( "Error processing SAML assertion: no teragrid principal"); rc = GLOBUS_GRAM_PROTOCOL_ERROR_AUTHORIZATION; goto get_gateway_name_failed; } if (xresult != NULL && xresult->stringval != NULL && *(xresult->stringval) != 0) { *gateway_user = strdup((char *) xresult->stringval); } get_gateway_name_failed: non_self_issued: if (xresult != NULL) { xmlXPathFreeObject(xresult); } xpath_eval_issuer_failed: xpath_register_ns_failed: xmlXPathFreeContext(xpath_ctx); xpath_ctx_init_failed: xmlFreeDoc(doc); parse_assertion_failed: free(assertion_string); assertion_string_malloc_failed: ASN1_UTF8STRING_free(asn1_str); utfstring_failed: empty_data_set: gss_release_buffer_set(&min_stat, &data_set); inquire_failed: no_extension_in_cred_chain: no_context: if (asn1_desired_object != NULL) { ASN1_OBJECT_free(asn1_desired_object); } if (chain != NULL) { sk_X509_free(chain); } return rc; #else *gateway_user = NULL; return GLOBUS_SUCCESS; #endif /* HAVE_LIBXML2 */ } /* globus_i_gram_get_tg_gateway_user() */ globus_gram_job_manager-13.53/pkgdata/0000775000076400007640000000000012145177165015011 500000000000000globus_gram_job_manager-13.53/pkgdata/pkg_data_src.gpt.in0000666000076400007640000002032212145172467020474 00000000000000 GRAM Jobmanager ResourceManagement @GPT_PKG_CFLAGS@ @GPT_EXTERNAL_INCLUDES@ @GPT_EXTERNAL_LIBS@ globus_gram_job_manager-13.53/pkgdata/pkg_data_src.pc.in0000664000076400007640000000147512145177130020302 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ GLOBUS_FLAVOR_NAME=@GLOBUS_FLAVOR_NAME@ flavorincludedir=@flavorincludedir@ Name: globus-gram-job-manager Description: Globus Toolkit - GRAM Jobmanager Version: 13.53 Requires.private: globus-gsi-credential >= 5 globus-scheduler-event-generator >= 4 globus-xio-popen-driver >= 2 globus-xio >= 3 globus-gss-assist >= 8 globus-core >= 8 globus-gsi-sysconfig >= 5 globus-callout >= 2 globus-gssapi-gsi >= 10 globus-gram-job-manager-callout-error >= 2 globus-gram-protocol >= 11 globus-common >= 14 globus-usage >= 3 @GPT_PKGCONFIG_DEPENDENCIES@ globus-rsl >= 9 globus-gass-cache >= 8 globus-gass-transfer >= 7 Libs: -L${libdir} Libs.private: @GPT_EXTERNAL_LIBS@ Cflags: @GPT_PKG_CFLAGS@ -I${includedir} -I${flavorincludedir} @GPT_EXTERNAL_INCLUDES@ globus_gram_job_manager-13.53/pkgdata/Makefile.am0000644000076400007640000000461012055152252016752 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_gram_job_manager-13.53/pkgdata/Makefile.in0000664000076400007640000005170212145177133016776 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_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@ AUDITDIR = @AUDITDIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ 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@ GENERATE_MANPAGES_FALSE = @GENERATE_MANPAGES_FALSE@ GENERATE_MANPAGES_TRUE = @GENERATE_MANPAGES_TRUE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GLOBUS_TOOLKIT_VERSION = @GLOBUS_TOOLKIT_VERSION@ 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@ LOGDIR = @LOGDIR@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ 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@ REBUILD_PARSER_FALSE = @REBUILD_PARSER_FALSE@ REBUILD_PARSER_TRUE = @REBUILD_PARSER_TRUE@ REBUILD_SCANNER_FALSE = @REBUILD_SCANNER_FALSE@ REBUILD_SCANNER_TRUE = @REBUILD_SCANNER_TRUE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XML2_CONFIG = @XML2_CONFIG@ XMLLINT = @XMLLINT@ XML_CATALOG_PATH = @XML_CATALOG_PATH@ XML_CPPFLAGS = @XML_CPPFLAGS@ XML_LIBS = @XML_LIBS@ XSLTPROC = @XSLTPROC@ 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_gram_job_manager-13.53/dirt.sh0000666000076400007640000000005412145172470014607 00000000000000DIRT_TIMESTAMP=1368716600 DIRT_BRANCH_ID=83 globus_gram_job_manager-13.53/globus_gram_job_manager_script.c0000666000076400007640000026240612131302361021666 00000000000000/* * Copyright 1999-2009 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_gram_job_manager.h" #include #include #include #include #include #include globus_xio_driver_t globus_i_gram_job_manager_popen_driver; globus_xio_stack_t globus_i_gram_job_manager_popen_stack; static uint64_t globus_l_gram_next_script_sequence = 0; typedef struct globus_gram_script_handle_s { globus_gram_job_manager_t * manager; globus_gram_job_manager_scripts_t * scripts; globus_xio_handle_t handle; globus_byte_t return_buf[GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE]; size_t return_buf_offset; globus_result_t result; int pending_ops; time_t last_use; } *globus_gram_script_handle_t; int globus_gram_job_manager_script_handle_init( globus_gram_job_manager_t * manager, globus_gram_job_manager_scripts_t * scripts, globus_gram_script_handle_t * handle); static int globus_l_gram_enqueue_description( globus_fifo_t * fifo, globus_gram_jobmanager_request_t * request, va_list ap); static int globus_l_gram_enqueue_string( globus_fifo_t * fifo, const char * format, ...); static int globus_l_gram_fifo_to_iovec( globus_fifo_t * fifo, struct iovec ** iovec, int * num_iovec); /* Module Specific Types */ typedef void (*globus_gram_job_manager_script_callback_t)( void * arg, globus_gram_jobmanager_request_t * request, int failure_code, int starting_state, const char * variable, const char * value); typedef struct { globus_gram_job_manager_script_callback_t callback; void * callback_arg; globus_gram_jobmanager_request_t * request; int starting_jobmanager_state; struct iovec * iov; int iovcnt; globus_gram_script_handle_t handle; globus_gram_script_priority_t priority; } globus_gram_job_manager_script_context_t; /* Module Specific Prototypes */ static void globus_l_gram_job_manager_script_read( 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); static void globus_l_gram_job_manager_default_done( void * arg, globus_gram_jobmanager_request_t * request, int failure_code, int starting_state, const char * variable, const char * value); static void globus_l_gram_job_manager_query_done( void * arg, globus_gram_jobmanager_request_t * request, int failure_code, int starting_jobmanager_state, const char * variable, const char * value); static int globus_l_gram_request_validate( globus_gram_jobmanager_request_t * request); static char * globus_l_gram_job_manager_script_prepare_param( const char * param); static int globus_l_gram_enqueue_staging_list( globus_gram_jobmanager_request_t * request, globus_fifo_t * fifo, globus_gram_job_manager_staging_type_t type); static void globus_l_gram_job_manager_script_staged_done( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_staging_type_t type, const char * value); static int globus_l_gram_script_queue( globus_gram_job_manager_t * manager, globus_gram_job_manager_script_context_t * context); static void globus_l_gram_process_script_queue_locked( globus_gram_job_manager_t * manager, globus_gram_job_manager_scripts_t * scripts); static void globus_l_gram_job_manager_script_done( globus_gram_job_manager_t * manager, globus_gram_job_manager_scripts_t * scripts, globus_gram_script_handle_t handle); static void globus_l_script_close_callback( globus_xio_handle_t handle, globus_result_t result, void * user_arg); static void globus_l_script_writev_callback( 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); static void globus_l_gram_script_open_callback( globus_xio_handle_t handle, globus_result_t result, void * user_arg); static int globus_l_gram_script_register_read_and_write( globus_gram_job_manager_script_context_t * script_context); static int globus_l_gram_script_priority_cmp( void * priority_1, void * priority_2); static int globus_l_match_script_client_addr( void * datum, void * arg); /** * Begin execution of a job manager script */ static int globus_l_gram_job_manager_script_run( globus_gram_jobmanager_request_t * request, const char * script_cmd, globus_gram_job_manager_script_callback_t callback, void * callback_arg, ...) { globus_gram_job_manager_script_context_t * script_context; int rc; globus_fifo_t fifo; va_list ap; rc = globus_fifo_init(&fifo); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto fifo_init_failed; } rc = globus_l_gram_enqueue_string(&fifo, "%s\n", script_cmd); if (rc != GLOBUS_SUCCESS) { goto enqueue_cmd_failed; } va_start(ap, callback_arg); rc = globus_l_gram_enqueue_description( &fifo, request, ap); va_end(ap); if (rc != GLOBUS_SUCCESS) { goto enqueue_description_failed; } rc = globus_l_gram_enqueue_string(&fifo, "\n"); if (rc != GLOBUS_SUCCESS) { goto enqueue_end_of_cmd_failed; } script_context = malloc( sizeof(globus_gram_job_manager_script_context_t)); if (script_context == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto script_context_malloc_failed; } rc = globus_gram_job_manager_add_reference( request->manager, request->job_contact_path, "script", NULL); globus_assert(rc == GLOBUS_SUCCESS); script_context->callback = callback; script_context->callback_arg = callback_arg; script_context->request = request; script_context->starting_jobmanager_state = request->jobmanager_state; if (strcmp(script_cmd, "poll") == 0) { script_context->priority.priority_level = GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_POLL; } else if (strcmp(script_cmd, "cancel") == 0) { script_context->priority.priority_level = GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_CANCEL; } else if (strcmp(script_cmd, "submit") == 0) { script_context->priority.priority_level = GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_SUBMIT; } else if (strcmp(script_cmd, "stage_out") == 0) { script_context->priority.priority_level = GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_STAGE_OUT; } else if (strcmp(script_cmd, "stage_in") == 0) { script_context->priority.priority_level = GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_STAGE_IN; } else if (strcmp(script_cmd, "signal") == 0) { script_context->priority.priority_level = GLOBUS_GRAM_SCRIPT_PRIORITY_LEVEL_SIGNAL; } rc = globus_l_gram_fifo_to_iovec( &fifo, &script_context->iov, &script_context->iovcnt); rc = globus_l_gram_script_queue( request->manager, script_context); if (rc != GLOBUS_SUCCESS) { goto queue_failed; } if (rc != GLOBUS_SUCCESS) { queue_failed: globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "script"); free(script_context); } script_context_malloc_failed: enqueue_end_of_cmd_failed: enqueue_description_failed: enqueue_cmd_failed: if (rc != GLOBUS_SUCCESS) { globus_fifo_destroy_all(&fifo, free); } else { globus_fifo_destroy(&fifo); } fifo_init_failed: return rc; } /* globus_l_gram_job_manager_script_run() */ static void globus_l_gram_job_manager_script_read( 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_gram_jobmanager_request_t * request; globus_gram_job_manager_script_context_t * script_context; globus_gram_script_handle_t script_handle; char * script_variable; char * script_variable_end; unsigned char * script_value; globus_bool_t eof = GLOBUS_FALSE; char * p; int failure_code = 0; int i; globus_gram_job_manager_scripts_t * scripts; script_context = user_arg; request = script_context->request; script_handle = script_context->handle; script_handle->return_buf_offset += nbytes; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.script_read.start " "level=DEBUG " "gramid=%s " "result=%d " "nbytes=%d " "\n", request->job_contact_path, result, (int) nbytes); if ((script_handle->return_buf_offset == sizeof(script_handle->return_buf)) && (memchr(script_handle->return_buf, '\n', script_handle->return_buf_offset) == NULL)) { result = GLOBUS_FAILURE; failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.script_read.end " "level=ERROR " "gramid=%s " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, (int) -failure_code, "script response doesn't contain newline"); eof = GLOBUS_TRUE; script_handle->result = GLOBUS_FAILURE; } else if (result) { eof = GLOBUS_TRUE; if (!globus_xio_error_is_eof(result)) { char * errstr; char * errstr_escaped; errstr = globus_error_print_friendly(globus_error_peek(result)); errstr_escaped = globus_gram_prepare_log_string(errstr); failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.script_read.end " "level=ERROR " "gramid=%s " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, (int) -failure_code, errstr_escaped ? errstr_escaped : ""); if (errstr) { free(errstr); } if (errstr_escaped) { free(errstr_escaped); } } script_handle->result = result; } while((p = memchr(script_handle->return_buf, '\n', script_handle->return_buf_offset)) != NULL) { char * escaped; size_t newline_offset; *p = '\0'; newline_offset = p - (char *) &script_handle->return_buf[0]; if (request->job_log_level & GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE) { escaped = globus_gram_prepare_log_string( (char *) &script_handle->return_buf[0]); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.script_read.info " "level=TRACE " "gramid=%s " "response=\"%s\" " "\n", request->job_contact_path, escaped ? escaped : ""); if (escaped) { free(escaped); } } script_variable = (char *) script_handle->return_buf; if (*script_variable == 0) { /* End of input */ eof = GLOBUS_TRUE; script_handle->return_buf_offset -= newline_offset + 1; break; } while(*script_variable && isspace(*script_variable)) { script_variable++; } script_variable_end = script_variable; while(*script_variable_end && *script_variable_end != ':') { script_variable_end++; } *script_variable_end = '\0'; script_value = (unsigned char *) script_variable_end+1; script_context->callback( script_context->callback_arg, request, failure_code, script_context->starting_jobmanager_state, script_variable, (char *) script_value); /* * We need to log the batch job ID to the accounting file. */ if(strcmp(script_variable, "GRAM_SCRIPT_JOB_ID") == 0) { const char * gk_jm_id_var = "GATEKEEPER_JM_ID"; const char * gk_jm_id = getenv(gk_jm_id_var); const char * gk_peer = getenv("GATEKEEPER_PEER"); const char * globus_id = getenv("GLOBUS_ID"); uid_t uid = getuid(); gid_t gid = getgid(); const char *user = request->config->logname; globus_gram_job_manager_request_acct( request, "%s %s for %s on %s\n", gk_jm_id_var, gk_jm_id ? gk_jm_id : "none", globus_id ? globus_id : "unknown", gk_peer ? gk_peer : "unknown"); globus_gram_job_manager_request_acct( request, "%s %s mapped to %s (%u, %u)\n", gk_jm_id_var, gk_jm_id ? gk_jm_id : "none", user, uid, gid); globus_gram_job_manager_request_acct( request, "%s %s has %s %s manager type %s\n", gk_jm_id_var, gk_jm_id ? gk_jm_id : "none", script_variable, script_value, request->config->jobmanager_type); } if(script_handle->return_buf_offset > newline_offset) { memmove(&script_handle->return_buf[0], &script_handle->return_buf[newline_offset+1], script_handle->return_buf_offset - newline_offset - 1); script_handle->return_buf_offset -= newline_offset + 1; } else { script_handle->return_buf[0] = '\0'; script_handle->return_buf_offset = 0; } } if(! eof) { if (sizeof(script_handle->return_buf) > script_handle->return_buf_offset) { globus_gram_job_manager_request_log( script_context->request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.script_read.info " "level=TRACE " "message=\"registering read\" " "return_buf_offset=%d " "read_len=%d " "\n", (int) script_handle->return_buf_offset, (int) (sizeof(script_handle->return_buf) - script_handle->return_buf_offset), p); result = globus_xio_register_read( script_handle->handle, &script_handle->return_buf[script_handle->return_buf_offset], sizeof(script_handle->return_buf) - script_handle->return_buf_offset, 1, NULL, globus_l_gram_job_manager_script_read, script_context); if(result == GLOBUS_SUCCESS) { /* New callback registered successfully */ return; } } else { result = GLOBUS_FAILURE; } { char * errstr; char * errstr_escaped; errstr = globus_error_print_friendly(globus_error_peek(result)); errstr_escaped = globus_gram_prepare_log_string(errstr); failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; globus_gram_job_manager_request_log( script_context->request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.script_read.end " "level=ERROR " "gramid=%s " "status=%d " "reason=\"%s\" " "\n", request->job_contact_path, -failure_code, errstr_escaped ? errstr_escaped : ""); if (errstr) { free(errstr); } if (errstr_escaped) { free(errstr_escaped); } } } script_handle = script_context->handle; GlobusGramJobManagerLock(request->manager); script_handle->pending_ops--; scripts = globus_list_first( globus_list_search_pred( request->manager->scripts_per_client, globus_l_match_script_client_addr, request->job_stats.client_address)); globus_l_gram_job_manager_script_done(request->manager, scripts, script_handle); GlobusGramJobManagerUnlock(request->manager); script_context->callback( script_context->callback_arg, request, (result == GLOBUS_SUCCESS) ? GLOBUS_SUCCESS : GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS, script_context->starting_jobmanager_state, NULL, NULL); if (result == GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( script_context->request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.script_read.end " "level=TRACE " "gramid=%s " "status=%d " "\n", request->job_contact_path, 0); } globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "script"); for (i = 0; i < script_context->iovcnt; i++) { free(script_context->iov[i].iov_base); } free(script_context->iov); free(script_context); } /* globus_l_gram_job_manager_script_read() */ /** * Submit a job request to a local scheduler. * * This function submits the passed job request to the local scheduler * script. * * @param request * The request containing the job description and related information. * * @return * This function returns GLOBUS_SUCCESS or a failure code if the * job could not be submitted. If successful, this function will call * into the state machine once the job submission result has happened. */ int globus_gram_job_manager_script_submit( globus_gram_jobmanager_request_t * request) { char * script_cmd = "submit"; int rc; rc = globus_l_gram_request_validate(request); if (rc != GLOBUS_SUCCESS) { return rc; } /* * used to test job manager functionality without actually submitting * job */ if (request->dry_run) { return GLOBUS_GRAM_PROTOCOL_ERROR_DRYRUN; } if (request->config->seg_module && strcmp(request->config->seg_module, "condor") == 0) { rc = globus_l_gram_job_manager_script_run( request, script_cmd, globus_l_gram_job_manager_default_done, NULL, "emitcondorprocesses", 'd', 1, NULL); } else if (request->config->seg_module && strcmp(request->config->seg_module, "fork") == 0) { rc = globus_l_gram_job_manager_script_run( request, script_cmd, globus_l_gram_job_manager_default_done, NULL, "useforkstarter", 'd', 1, NULL); } else { rc = globus_l_gram_job_manager_script_run( request, script_cmd, globus_l_gram_job_manager_default_done, NULL, NULL); } return rc; } /* globus_gram_job_manager_script_submit() */ /** * Set job request status and fire callback so it registers */ static int local_globus_set_status( globus_gram_jobmanager_request_t * request, globus_gram_protocol_job_state_t status) { globus_reltime_t delay; int rc; if(request->status != status) { globus_gram_job_manager_request_set_status(request, status); request->unsent_status_change = GLOBUS_TRUE; } GlobusTimeReltimeSet(delay, 0, 0); rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay); return rc; } /* local_globus_set_status() */ /** * Modified job_contact in place to remove the port. */ static void job_contact_strip_port( char * job_contact) { char * first_end; char * second_begin; if( job_contact == 0 ) return; first_end = strrchr( job_contact, ':' ); if( first_end == 0 ) /* malformed job_contact? */ return; second_begin = strchr( first_end, '/' ); if( second_begin == 0 ) /* malformed job_contact? */ return; memmove(first_end, second_begin, strlen(second_begin) + 1); } /** * Try to poll status of job request using Condor grid_manager_monitor_agent * * If the Condor grid_manager_monitor_agent is running on the machine, this * function retrieve job request status using that, otherwise it fails. * Expected to be called exclusively from globus_gram_job_manager_script_poll. */ int globus_gram_job_manager_script_poll_fast( globus_gram_jobmanager_request_t * request) { int i; char * grid_monitor_output = 0; char * grid_monitor_files[3] = { NULL, NULL, NULL }; /* Path is $GLOBUS_LOCATION/GRID_MONITOR_LOCATION$UID */ const char * GRID_MONITOR_LOCATION_1 = "/tmp/grid_manager_monitor_agent_log."; const char * GRID_MONITOR_LOCATION_2 = "/tmp/gram_job_state/grid_manager_monitor_agent_log."; const char * WHITESPACE = " \t"; uid_t this_uid = geteuid(); struct stat stat_results; FILE * grid_monitor_file = 0; int rc; time_t MAX_MONITOR_FILE_AGE = (60*5); /* seconds */ char line[1024]; char line_job_contact[1024]; int return_val = GLOBUS_FAILURE; time_t status_file_last_update = 0; char * job_contact_match = 0; if( ! request || !request->job_contact) { goto FAST_POLL_EXIT_FAILURE; } if(this_uid > 999999) { /* UIDs this large are unlikely, but if they occur the buffer * isn't large enough to handle it */ goto FAST_POLL_EXIT_FAILURE; } /* The grid monitor's job status file can be in one of two places. * We want to check both. */ grid_monitor_files[0] = globus_common_create_string( "%s%s%d", request->config->globus_location ? request->config->globus_location : "", GRID_MONITOR_LOCATION_1, (int)this_uid); if( ! grid_monitor_files[0]) { goto FAST_POLL_EXIT_FAILURE; } grid_monitor_files[1] = globus_common_create_string( "%s%s%d", request->config->globus_location ? request->config->globus_location : "", GRID_MONITOR_LOCATION_2, (int)this_uid); if( ! grid_monitor_files[1]) { goto FAST_POLL_EXIT_FAILURE; } for ( i = 0; grid_monitor_files[i]; i++ ) { grid_monitor_output = grid_monitor_files[i]; grid_monitor_file = fopen(grid_monitor_output, "r"); if( ! grid_monitor_file ) { /* No monitor file? That's acceptable, silently fail */ continue; } rc = stat(grid_monitor_output, &stat_results); if( rc != 0 ) { fclose(grid_monitor_file); grid_monitor_file = NULL; continue; } if(stat_results.st_uid != this_uid || !S_ISREG(stat_results.st_mode)) { fclose(grid_monitor_file); grid_monitor_file = NULL; continue; } if( (stat_results.st_mtime + MAX_MONITOR_FILE_AGE) < time(NULL) ) { fclose(grid_monitor_file); grid_monitor_file = NULL; continue; } break; } if ( grid_monitor_file == NULL ) { goto FAST_POLL_EXIT_FAILURE; } /* If we got this far, we've decided we trust the file */ /* Read the first line, which is two timestamps as seconds since epoch. * The first one is start time of last query pass, the second is finish. */ if( ! fgets(line, sizeof(line), grid_monitor_file) ) { goto FAST_POLL_EXIT_FAILURE; } if( ! feof(grid_monitor_file) && line[strlen(line) - 1] != '\n') { goto FAST_POLL_EXIT_FAILURE; } status_file_last_update = atoi(line); if(status_file_last_update < request->status_update_time) { /* We somehow got a status update more recent than the status file. * Most likely we successfully executed a traditional poll faster than * the status script processed things. This status file is fresh * enough, so we should switch over to using that, we want to avoid * firing off a traditional poll. So, leave the existing status in * place and report a successful poll. */ local_globus_set_status(request, request->status); return_val = GLOBUS_SUCCESS; goto FAST_POLL_EXIT; } job_contact_match = malloc(strlen(request->job_contact) + 1); strcpy(job_contact_match, request->job_contact); job_contact_strip_port(job_contact_match); /* TODO: First pass. Improve with binary search of file to make * scanning large files fast. Still this is probably plenty fast * enough for fairly large runs. */ while( 1 ) { size_t len = 0; char * line_bit = line; int new_status = 0; if( ! fgets(line, sizeof(line), grid_monitor_file) ) { /* end of file (or error), job isn't in file. It might just not * have been noticed yet. Silently skip */ goto FAST_POLL_EXIT_FAILURE; } if( ! feof(grid_monitor_file) && line[strlen(line) - 1] != '\n') { goto FAST_POLL_EXIT_FAILURE; } len = strcspn(line_bit, WHITESPACE); if(len == 0) { goto FAST_POLL_EXIT_FAILURE; } /* So long as sizeof(line_job_contact) == sizeof(line), * this is safe */ memcpy(line_job_contact, line, len); line_job_contact[len] = 0; job_contact_strip_port(line_job_contact); if( strcmp(line_job_contact, job_contact_match) != 0 ) { continue; } line_bit += len; len = strspn(line_bit, WHITESPACE); if(len == 0) { goto FAST_POLL_EXIT_FAILURE; } line_bit += len; /* Found exact match, read status */ len = strspn(line_bit, "0123456789"); if(len == 0) { /* No digits!? */ goto FAST_POLL_EXIT_FAILURE; } new_status = atoi(line_bit); if ( new_status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED ) { /* Condor's grid monitor doesn't report the GRAM failure code * that usually accompanies a FAILED status. Let's call the * poll function ourselves to get that status. */ globus_gram_job_manager_request_log(request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "JMI: poll_fast: Monitoring file reports FAILED, " "Reverting to normal polling to get failure code.\n"); goto FAST_POLL_EXIT_FAILURE; } local_globus_set_status(request, new_status); return_val = GLOBUS_SUCCESS; goto FAST_POLL_EXIT; } FAST_POLL_EXIT_FAILURE: return_val = GLOBUS_FAILURE; FAST_POLL_EXIT: if(grid_monitor_file) fclose(grid_monitor_file); for ( i = 0; grid_monitor_files[i]; i++ ) { free(grid_monitor_files[i]); } if( job_contact_match ) free(job_contact_match); return return_val; } /* globus_gram_job_manager_script_poll_fast() */ /** * Poll the status of a job request. * * This function invokes a scheduler-specific program to determine * the current status of the job request. The job status field of * the requst structure will be updated with the new status. * * @param request * The request containing the job description. * @return GLOBUS_GRAM_JOBMANAGER_STATUS_UNCHANGED or * GLOBUS_GRAM_JOBMANAGER_STATUS_CHANGED depending whether the job status * is the same as the result from the value of request's status field. This * field will be updated if the job's status has changed. */ int globus_gram_job_manager_script_poll( globus_gram_jobmanager_request_t * request) { char * script_cmd = "poll"; int rc; rc = globus_l_gram_request_validate(request); if (rc != GLOBUS_SUCCESS) { return rc; } /* Keep the state file's timestamp up to date so that * anything scrubbing the state files of old and dead * processes leaves it alone */ if(request->job_state_file) { utime(request->job_state_file, NULL); } if( globus_gram_job_manager_script_poll_fast(request) == GLOBUS_SUCCESS ) { return(GLOBUS_SUCCESS); } rc = globus_l_gram_job_manager_script_run( request, script_cmd, globus_l_gram_job_manager_default_done, NULL, NULL); if (rc != GLOBUS_SUCCESS) { return rc; } return(GLOBUS_SUCCESS); } /* globus_gram_job_manager_script_poll() */ /** * Cancel a GRAM job. * * This function invokes a scheduler-specific program which cancels the * job. * * @param request * The job request containing information about the job to be cancelled. */ int globus_gram_job_manager_script_cancel( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_query_t * query) { char * script_cmd = "cancel"; int rc; rc = globus_l_gram_request_validate(request); if (rc != GLOBUS_SUCCESS) { return rc; } rc = globus_l_gram_job_manager_script_run( request, script_cmd, globus_l_gram_job_manager_query_done, query, NULL); if (rc != GLOBUS_SUCCESS) { return rc; } return(GLOBUS_SUCCESS); } /* globus_gram_job_manager_script_cancel() */ /** * Send a signal to a job scheduler * * @param request * The job request containing information about the job to * signal. The signal and signal_arg data are used by * this function. */ int globus_gram_job_manager_script_signal( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_query_t * query) { char * script_cmd = "signal"; int rc; rc = globus_l_gram_request_validate(request); if (rc != GLOBUS_SUCCESS) { return rc; } /* * add the signal and signal_arg to the script arg file */ rc = globus_l_gram_job_manager_script_run( request, script_cmd, globus_l_gram_job_manager_query_done, query, "signal", 'd', query->signal, "signalarg", 's', query->signal_arg, NULL); if(rc != GLOBUS_SUCCESS) { return rc; } return(GLOBUS_SUCCESS); } /* globus_gram_job_manager_script_signal() */ int globus_gram_job_manager_script_stage_in( globus_gram_jobmanager_request_t * request) { char * script_cmd = "stage_in"; int rc; rc = globus_l_gram_request_validate(request); if (rc != GLOBUS_SUCCESS) { return rc; } rc = globus_l_gram_job_manager_script_run( request, script_cmd, globus_l_gram_job_manager_default_done, NULL, NULL); if (rc != GLOBUS_SUCCESS) { return rc; } return(GLOBUS_SUCCESS); } /* globus_gram_job_manager_script_stage_in() */ int globus_gram_job_manager_script_stage_out( globus_gram_jobmanager_request_t * request) { char * script_cmd = "stage_out"; int rc; rc = globus_l_gram_request_validate(request); if (rc != GLOBUS_SUCCESS) { return rc; } rc = globus_l_gram_job_manager_script_run( request, script_cmd, globus_l_gram_job_manager_default_done, NULL, NULL); return rc; } /* globus_gram_job_manager_script_stage_out() */ /** * Completion callback for done and poll scripts. * * This is called when a line of output containing a variable:value * pair is read from the script's execution. */ static void globus_l_gram_job_manager_default_done( void * arg, globus_gram_jobmanager_request_t * request, int failure_code, int starting_jobmanager_state, const char * variable, const char * value) { int script_status; int rc; GlobusGramJobManagerRequestLock(request); if(failure_code) { request->failure_code = failure_code; } if(!variable) { globus_reltime_t delay; GlobusTimeReltimeSet(delay, 0, 0); rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay); } else if(strcmp(variable, "GRAM_SCRIPT_JOB_STATE") == 0) { script_status = atoi(value); if(script_status < 0) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.script_read.info " "level=ERROR " "gramid=%s " "msg=\"%s\" " "value=\"%s\" " "script_status=%d " "\n", request->job_contact_path, "Invalid GRAM_SCRIPT_JOB_STATE", value, script_status); } else if(globus_i_gram_job_manager_script_valid_state_change( request, script_status)) { if ((script_status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE) && globus_gram_job_manager_rsl_need_stage_out(request)) { globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT); } else { globus_gram_job_manager_request_set_status( request, script_status); } request->unsent_status_change = GLOBUS_TRUE; } } else if(strcmp(variable, "GRAM_SCRIPT_ERROR") == 0) { script_status = atoi(value); if(request->jobmanager_state == starting_jobmanager_state) { globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); if(script_status <= 0) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.script_read.info " "level=ERROR " "gramid=%s " "msg=\"%s\" " "value=\"%s\" " "script_status=%d " "\n", request->job_contact_path, "Invalid GRAM_SCRIPT_ERROR", value, script_status); } else { request->failure_code = script_status; } request->unsent_status_change = GLOBUS_TRUE; } } else if(strcmp(variable, "GRAM_SCRIPT_JOB_ID") == 0) { if(value != NULL && strlen(value) > 0) { request->job_id_string = strdup(value); request->original_job_id_string = strdup(value); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_INFO, "event=gram.job.info " "level=INFO " "msg=\"%s\" " "gramid=%s " "lrm_id=\"%s\" " "\n", "job submitted to lrm", request->job_contact_path, value); } } else if(strcmp(variable, "GRAM_SCRIPT_JOB_ACCT_INFO") == 0) { if(value != NULL && strlen(value) > 0) { const char *gk_jm_id_var = "GATEKEEPER_JM_ID"; const char *gk_jm_id = getenv(gk_jm_id_var); const char *v = value; char *buf = malloc(strlen(value) + 1); char *b = buf; char c; while ((*b++ = ((c = *v++) != '\\') ? c : ((c = *v++) != 'n' ) ? c : '\n')) { } globus_gram_job_manager_request_acct( request, "%s %s summary:\n%s\nJMA -- end of summary\n", gk_jm_id_var, gk_jm_id ? gk_jm_id : "none", buf); free(buf); } } else if(strcmp(variable, "GRAM_SCRIPT_SCRATCH_DIR") == 0) { request->scratchdir = strdup(value); } else if(strcmp(variable, "GRAM_SCRIPT_STAGED_IN") == 0) { globus_l_gram_job_manager_script_staged_done( request, GLOBUS_GRAM_JOB_MANAGER_STAGE_IN, value); } else if(strcmp(variable, "GRAM_SCRIPT_STAGED_IN_SHARED") == 0) { globus_l_gram_job_manager_script_staged_done( request, GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED, value); } else if(strcmp(variable, "GRAM_SCRIPT_STAGED_OUT") == 0) { if(request->jobmanager_state == starting_jobmanager_state) { globus_l_gram_job_manager_script_staged_done( request, GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT, value); } } else if (strcmp(variable, "GRAM_SCRIPT_STAGED_STREAM") == 0) { if(request->jobmanager_state == starting_jobmanager_state) { globus_l_gram_job_manager_script_staged_done( request, GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS, value); } } else if(strncmp(variable, "GRAM_SCRIPT_GT3", 15) == 0) { if (request->gt3_failure_type == NULL && strcmp(variable, "GRAM_SCRIPT_GT3_FAILURE_TYPE") == 0) { request->gt3_failure_type = strdup(value); } else if (request->gt3_failure_message == NULL && strcmp(variable, "GRAM_SCRIPT_GT3_FAILURE_MESSAGE") == 0) { request->gt3_failure_message = strdup(value); } else if (request->gt3_failure_source == NULL && strcmp(variable, "GRAM_SCRIPT_GT3_FAILURE_SOURCE") == 0) { request->gt3_failure_source = strdup(value); } else if (request->gt3_failure_destination == NULL && strcmp(variable, "GRAM_SCRIPT_GT3_FAILURE_DESTINATION") == 0) { request->gt3_failure_destination = strdup(value); } } else if(strcmp(variable, "GRAM_SCRIPT_LOG") == 0) { if (request->job_log_level & GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.script.log " "level=DEBUG " "%s " "\n", value); } } else if(request->jobmanager_state == starting_jobmanager_state) { globus_gram_job_manager_request_set_status(request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED); request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; request->unsent_status_change = GLOBUS_TRUE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.script_read.info " "level=ERROR " "gramid=%s " "msg=\"%s\" " "variable=\"%s\" " "value=\"%s\" " "\n", request->job_contact_path, "unknown variable", variable, value); } GlobusGramJobManagerRequestUnlock(request); } /* globus_l_gram_job_manager_default_done() */ /** * Completion callback for query-initiated scripts */ static void globus_l_gram_job_manager_query_done( void * arg, globus_gram_jobmanager_request_t * request, int failure_code, int starting_jobmanager_state, const char * variable, const char * value) { int script_status; globus_gram_job_manager_query_t * query; globus_reltime_t delay; int rc; query = arg; GlobusGramJobManagerRequestLock(request); if(failure_code) { request->failure_code = failure_code; } if(!variable) { GlobusTimeReltimeSet(delay, 0, 0); rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay); } else if(strcmp(variable, "GRAM_SCRIPT_ERROR") == 0) { script_status = atoi(value); if(script_status <= 0) { query->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; } else { query->failure_code = script_status; } } else if(strcmp(variable, "GRAM_SCRIPT_JOB_STATE") == 0) { script_status = atoi(value); if(script_status <= 0) { query->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; } else if((query->type == GLOBUS_GRAM_JOB_MANAGER_CANCEL || query->signal == GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_CANCEL) && (globus_i_gram_job_manager_script_valid_state_change( request, script_status))) { request->unsent_status_change = GLOBUS_TRUE; globus_gram_job_manager_request_set_status(request, script_status); if(request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED) { request->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_USER_CANCELLED; query->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_USER_CANCELLED; } } else if((query->signal == GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_SUSPEND || query->signal == GLOBUS_GRAM_PROTOCOL_JOB_SIGNAL_RESUME) && globus_i_gram_job_manager_script_valid_state_change( request, script_status)) { globus_gram_job_manager_request_set_status(request, script_status); request->unsent_status_change = GLOBUS_TRUE; } } else if(strcmp(variable, "GRAM_SCRIPT_LOG") == 0) { if (request->job_log_level & GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.script.log " "level=DEBUG " "%s " "\n", value); } } else { query->failure_code = GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS; } GlobusGramJobManagerRequestUnlock(request); } /* globus_l_gram_job_manager_default_done() */ static int globus_l_gram_enqueue_rsl_value( globus_fifo_t * fifo, globus_rsl_value_t * globus_rsl_value_ptr) { globus_rsl_value_t * tmp_rsl_value_ptr; globus_list_t * tmp_rsl_list; char * prepared; char * tmp; int rc = GLOBUS_SUCCESS; if (globus_rsl_value_ptr==NULL) return(0); switch (globus_rsl_value_ptr->type) { case GLOBUS_RSL_VALUE_LITERAL: rc = globus_l_gram_enqueue_string(fifo, "'"); tmp = globus_rsl_value_literal_get_string(globus_rsl_value_ptr); prepared = globus_l_gram_job_manager_script_prepare_param( tmp); if (!prepared) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto prepare_failed; } rc = globus_fifo_enqueue(fifo, prepared); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; free(prepared); goto enqueue_failed; } rc = globus_l_gram_enqueue_string(fifo, "'"); break; case GLOBUS_RSL_VALUE_SEQUENCE: tmp_rsl_list = globus_rsl_value_sequence_get_value_list( globus_rsl_value_ptr); rc = globus_l_gram_enqueue_string(fifo, "["); if (rc != GLOBUS_SUCCESS) { goto enqueue_failed; } while (! globus_list_empty(tmp_rsl_list)) { tmp_rsl_value_ptr = (globus_rsl_value_t *) globus_list_first (tmp_rsl_list); globus_l_gram_enqueue_rsl_value(fifo, tmp_rsl_value_ptr); tmp_rsl_list = globus_list_rest(tmp_rsl_list); if(!globus_list_empty(tmp_rsl_list)) { rc = globus_l_gram_enqueue_string(fifo, ","); if (rc != GLOBUS_SUCCESS) { goto enqueue_failed; } } } rc = globus_l_gram_enqueue_string(fifo, "] "); if (rc != GLOBUS_SUCCESS) { goto enqueue_failed; } break; case GLOBUS_RSL_VALUE_VARIABLE: case GLOBUS_RSL_VALUE_CONCATENATION: default: rc = GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; break; } enqueue_failed: prepare_failed: return rc; } /* globus_l_gram_enqueue_rsl_value() */ static int globus_l_gram_enqueue_rsl( globus_fifo_t * fifo, globus_rsl_t * ast_node) { globus_list_t * tmp_rsl_list; globus_rsl_t * tmp_rsl_ptr; int rc; if (globus_rsl_is_boolean(ast_node)) { tmp_rsl_list = globus_rsl_boolean_get_operand_list(ast_node); while (! globus_list_empty(tmp_rsl_list)) { tmp_rsl_ptr = (globus_rsl_t *) globus_list_first (tmp_rsl_list); rc = globus_l_gram_enqueue_rsl(fifo, tmp_rsl_ptr); tmp_rsl_list = globus_list_rest(tmp_rsl_list); if(!globus_list_empty(tmp_rsl_list)) { rc = globus_l_gram_enqueue_string(fifo, ",\n"); } if(rc != GLOBUS_SUCCESS) { return rc; } } } else { /* Skip these, as they will be over-ridden by the todo lists */ if((strcmp(globus_rsl_relation_get_attribute(ast_node), "filestagein") == 0) || (strcmp(globus_rsl_relation_get_attribute(ast_node), "filestageinshared") == 0) || (strcmp(globus_rsl_relation_get_attribute(ast_node), "filestageout") == 0) || (strcmp(globus_rsl_relation_get_attribute(ast_node), "filestreamout") == 0)) { return 0; } rc = globus_l_gram_enqueue_string( fifo, " '%s' => ", globus_rsl_relation_get_attribute(ast_node)); rc = globus_l_gram_enqueue_rsl_value( fifo, globus_rsl_relation_get_value_sequence(ast_node)); if(rc != GLOBUS_SUCCESS) { return rc; } } return 0; } /* globus_l_gram_enqueue_rsl() */ static int globus_l_gram_enqueue_description( globus_fifo_t * fifo, globus_gram_jobmanager_request_t * request, va_list ap) { char * attribute; char format; char * string_value; int int_value; char * prepared; int rc; rc = globus_l_gram_enqueue_string( fifo, "$ENV{X509_USER_PROXY} = '%s';\n" "$ENV{GLOBUS_GRAM_JOB_CONTACT} = '%s';\n", request->x509_user_proxy, request->job_contact); rc = globus_l_gram_enqueue_string( fifo, "$description =\n{\n"); globus_l_gram_enqueue_rsl(fifo, request->rsl); /* Other non-rsl or rsl-override attributes */ for (attribute = va_arg(ap, char *); attribute != NULL; attribute = va_arg(ap, char *)) { format = (char) va_arg(ap, int); switch(format) { case 's': string_value = va_arg(ap, char *); if(string_value) { prepared = globus_l_gram_job_manager_script_prepare_param( string_value); rc = globus_l_gram_enqueue_string( fifo, ",\n '%s' => [ '%s' ]", attribute, prepared); free(prepared); } break; case 'i': case 'd': int_value = va_arg(ap, int); rc = globus_l_gram_enqueue_string( fifo, ",\n '%s' => [ '%d' ]", attribute, int_value); break; } } if(request->uniq_id) { rc = globus_l_gram_enqueue_string( fifo, ",\n 'uniqid' => [ '%s' ]", request->uniq_id); } if(request->job_id_string) { rc = globus_l_gram_enqueue_string( fifo, ",\n 'jobid' => [ '%s' ]", request->job_id_string); } if(request->cache_tag) { rc = globus_l_gram_enqueue_string( fifo, ",\n 'cachetag' => [ '%s' ]", request->cache_tag); } if(request->config->condor_os) { rc = globus_l_gram_enqueue_string( fifo, ",\n 'condoros' => [ '%s' ]", request->config->condor_os); } if(request->config->condor_arch) { rc = globus_l_gram_enqueue_string( fifo, ",\n 'condorarch' => [ '%s' ]", request->config->condor_arch); } if (request->job_dir) { rc = globus_l_gram_enqueue_string( fifo, ",\n 'jobdir' => [ '%s' ]", request->job_dir); } rc = globus_l_gram_enqueue_string( fifo, ",\n 'streamingdisabled' => [ %d ]", request->config->streaming_disabled); rc = globus_l_gram_enqueue_string( fifo, ",\n 'streamingrequested' => [ %d ]", request->streaming_requested ); rc = globus_l_gram_enqueue_string( fifo, ",\n 'statefile' => [ '%s' ]", request->job_state_file); rc = globus_l_gram_enqueue_staging_list( request, fifo, GLOBUS_GRAM_JOB_MANAGER_STAGE_IN); rc = globus_l_gram_enqueue_staging_list( request, fifo, GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED); rc = globus_l_gram_enqueue_staging_list( request, fifo, GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT); rc = globus_l_gram_enqueue_staging_list( request, fifo, GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS); rc = globus_l_gram_enqueue_string( fifo, "\n};\n"); return rc; } /* globus_l_gram_enqueue_description() */ /** * Escape single quotes within a string * * @param param * Original string to be escaped */ static char * globus_l_gram_job_manager_script_prepare_param( const char * param) { int i; int j; char * new_param; if (param == NULL) { return NULL; } new_param = malloc(strlen(param)*2+1); for (i = 0, j = 0; param[i] != '\0'; i++) { if(param[i] == '\\' ) { new_param[j++] = '\\'; new_param[j++] = '\\'; } else if (param[i] == '\'') { new_param[j++] = '\\'; new_param[j++] = '\''; } else { new_param[j++] = param[i]; } } new_param[j] = '\0'; return new_param; } /* globus_l_gram_job_manager_script_prepare_param() */ /** * Validate that the job manager is properly configured. * * This function validates the job scripts needed to handle this job * request exist and are executable. * * @param request * The job request we are submitting. This is used to check * that the job manager type is supported by this installation * of the job manager, and for logging. * * @retval GLOBUS_SUCCESS * The job manager is able to submit the job request to the appropriate * scripts. * @retval GLOBUS_FAILURE * The job manager is unable to submit the job request; the request * failure code will be updated with the reason why the job couldn't be * submitted. */ static int globus_l_gram_request_validate( globus_gram_jobmanager_request_t * request) { struct stat statbuf; char * script_path; char * script_path_pattern; int rc = GLOBUS_SUCCESS; globus_result_t result = GLOBUS_SUCCESS; static globus_bool_t first = GLOBUS_TRUE; if (!first) { return GLOBUS_SUCCESS; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.request_validate.start " "level=TRACE " "gramid=%s " "\n", request->job_contact_path); globus_assert(request->config->jobmanager_type); if(request->rsl == NULL) { return GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSL; } /* * test that the scheduler script files exist and * that the user has permission to execute then. */ /*---------------- job manager script -----------------*/ result = globus_eval_path("${libexecdir}/globus-job-manager-script.pl", &script_path); if (result != GLOBUS_SUCCESS || script_path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_SCRIPT_NOT_FOUND; goto eval_script_path_failed; } if (stat(script_path, &statbuf) != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_SCRIPT_NOT_FOUND; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.request_validate.end " "level=ERROR " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, script_path, "Script status failed", -rc, errno, strerror(errno)); goto script_path_not_found; } if (access(script_path, X_OK) < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_SCRIPT_PERMISSIONS; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.request_validate.end " "level=ERROR " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "\n", request->job_contact_path, script_path, "Script not executable", -rc); goto bad_script_permissions; } free(script_path); script_path = NULL; script_path_pattern = globus_common_create_string( "${perlmoduledir}/Globus/GRAM/JobManager/%s.pm", request->config->jobmanager_type); if (script_path_pattern == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto script_pattern_alloc_failed; } /* Verify existence of scheduler specific script. */ result = globus_eval_path(script_path_pattern, &script_path); if (result != GLOBUS_SUCCESS || script_path == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto lrm_script_path_failed; } if(stat(script_path, &statbuf) != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_SCRIPT_NOT_FOUND; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.request_validate.end " "level=ERROR " "gramid=%s " "path=\"%s\" " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, script_path, "Module status failed", -rc, errno, strerror(errno)); goto lrm_module_not_found; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.request_validate.end " "level=TRACE " "gramid=%s " "status=%d\n", request->job_contact_path, 0); lrm_module_not_found: lrm_script_path_failed: if (script_path_pattern != NULL) { free(script_path_pattern); script_path_pattern = NULL; } script_pattern_alloc_failed: bad_script_permissions: script_path_not_found: if (script_path != NULL) { free(script_path); script_path = NULL; } eval_script_path_failed: if (rc == GLOBUS_SUCCESS) { first = GLOBUS_FALSE; } return rc; } /* globus_l_gram_request_validate() */ static int globus_l_gram_enqueue_string( globus_fifo_t * fifo, const char * format, ...) { va_list ap; char * tmp; int rc; va_start(ap, format); tmp = globus_common_v_create_string(format, ap); va_end(ap); if (!tmp) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto create_string_failed; } rc = globus_fifo_enqueue(fifo, tmp); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; free(tmp); goto fifo_enqueue_failed; } fifo_enqueue_failed: create_string_failed: return rc; } /* globus_l_gram_enqueue_string() */ static int globus_l_gram_enqueue_staging_list( globus_gram_jobmanager_request_t * request, globus_fifo_t * fifo, globus_gram_job_manager_staging_type_t type) { globus_list_t * tmp_list = NULL; char * attribute = NULL; char * from; char * to; globus_gram_job_manager_staging_info_t * info; int rc; switch(type) { case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN: tmp_list = request->stage_in_todo; attribute = GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_PARAM; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED: tmp_list = request->stage_in_shared_todo; attribute = GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_SHARED_PARAM; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT: tmp_list = request->stage_out_todo; attribute = GLOBUS_GRAM_PROTOCOL_FILE_STAGE_OUT_PARAM; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS: tmp_list = request->stage_stream_todo; attribute = "filestreamout"; break; } /* Always write the attribute to the script arg file, even if * it's empty---if we were restarted during staging, then we * may have files listed in the original RSL which have been staged * completely. */ rc = globus_l_gram_enqueue_string( fifo, ",\n '%s' => [", attribute); if (rc != GLOBUS_SUCCESS) { goto enqueue_string_failed; } while(!globus_list_empty(tmp_list)) { info = globus_list_first(tmp_list); tmp_list = globus_list_rest(tmp_list); from = globus_l_gram_job_manager_script_prepare_param( info->evaled_from); to = globus_l_gram_job_manager_script_prepare_param( info->evaled_to); rc = globus_l_gram_enqueue_string( fifo, " ['%s', '%s']%s", from, to, globus_list_empty(tmp_list) ? "\n" : ",\n"); free(from); free(to); if (rc != GLOBUS_SUCCESS) { goto enqueue_string_failed; } } rc = globus_l_gram_enqueue_string(fifo, " ]"); enqueue_string_failed: return rc; } /* globus_l_gram_enqueue_staging_list() */ static void globus_l_gram_job_manager_script_staged_done( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_staging_type_t type, const char * value) { char * from; char * to; from = malloc(strlen(value)+1); to = malloc(strlen(value)+1); sscanf(value, "%s %s", from, to); globus_gram_job_manager_staging_remove( request, type, from, to); if(request->jobmanager_state != GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) { globus_gram_job_manager_state_file_write( request); } free(from); free(to); } /* globus_l_gram_job_manager_script_staged_done() */ globus_bool_t globus_i_gram_job_manager_script_valid_state_change( globus_gram_jobmanager_request_t * request, globus_gram_protocol_job_state_t new_state) { switch(request->status) { case GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING: if(new_state != GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING) { return GLOBUS_TRUE; } return GLOBUS_FALSE; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE: if(new_state != GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING && new_state != GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE) { return GLOBUS_TRUE; } return GLOBUS_FALSE; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED: return GLOBUS_FALSE; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE: return GLOBUS_FALSE; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_SUSPENDED: if(new_state != GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING && new_state != GLOBUS_GRAM_PROTOCOL_JOB_STATE_SUSPENDED) { return GLOBUS_TRUE; } return GLOBUS_FALSE; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_UNSUBMITTED: if(new_state != GLOBUS_GRAM_PROTOCOL_JOB_STATE_UNSUBMITTED) { return GLOBUS_TRUE; } return GLOBUS_FALSE; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_IN: if(new_state != GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_IN) { return GLOBUS_TRUE; } return GLOBUS_FALSE; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT: if(new_state == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE || new_state == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED) { return GLOBUS_TRUE; } return GLOBUS_FALSE; default: return GLOBUS_FALSE; } } /* globus_l_gram_job_manager_script_valid_state_change() */ /** * Queue and perhaps start a job manager script * * If the job manager isn't currently running too many simultaneous scripts, * start the script described in the @a context parameter. Otherwise, queue * it in the manager's script fifo and it will start when another one finishes. * * @param manager * Manager state * @param context * Script context * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Error opening jobmanager script */ static int globus_l_gram_script_queue( globus_gram_job_manager_t * manager, globus_gram_job_manager_script_context_t * context) { int rc; globus_list_t * tmp; globus_gram_job_manager_scripts_t * scripts = NULL; GlobusGramJobManagerLock(manager); context->priority.sequence = globus_l_gram_next_script_sequence++; tmp = globus_list_search_pred( manager->scripts_per_client, globus_l_match_script_client_addr, context->request->job_stats.client_address); if (tmp == NULL) { scripts = malloc(sizeof(globus_gram_job_manager_scripts_t)); if (scripts == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto scripts_malloc_failed; } scripts->client_addr = strdup(context->request->job_stats.client_address); if (scripts->client_addr == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto scripts_contact_malloc_failed; } /* Remove port from the client addr */ { char * colon = strrchr(scripts->client_addr, ':'); if (colon) { *colon = '\0'; } } rc = globus_priority_q_init( &scripts->script_queue, globus_l_gram_script_priority_cmp); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto script_queue_init_failed; } /* Default number of scripts which can be run simultaneously */ scripts->script_slots_available = 5; rc = globus_fifo_init(&scripts->script_handles); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto script_handles_fifo_init_failed; } globus_list_insert(&manager->scripts_per_client, scripts); if (rc != GLOBUS_SUCCESS) { script_handles_fifo_init_failed: globus_priority_q_destroy(&scripts->script_queue); script_queue_init_failed: free(scripts->client_addr); scripts_contact_malloc_failed: free(scripts); scripts = NULL; } } else { scripts = globus_list_first(tmp); } if (scripts) { rc = globus_priority_q_enqueue( &scripts->script_queue, context, &context->priority); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto fifo_enqueue_failed; } globus_l_gram_process_script_queue_locked(manager, scripts); } scripts_malloc_failed: fifo_enqueue_failed: GlobusGramJobManagerUnlock(manager); return rc; } /* globus_l_gram_script_queue() */ /** * Start processing queued script commands on XIO handles. * * For each script context queued in the script fifo, either write its command * to an existing XIO handle or create a new XIO handle to process the script, * provided there are slots available for running more scripts. * * The mutex associated with the @a manager parameter must be locked when this * procedure is called. * * @param manager * Job manager state * @param scripts * Client-specific script handle collection */ static void globus_l_gram_process_script_queue_locked( globus_gram_job_manager_t * manager, globus_gram_job_manager_scripts_t * scripts) { int rc = GLOBUS_SUCCESS; globus_gram_job_manager_script_context_t * head = NULL; globus_result_t result; while ((!globus_priority_q_empty(&scripts->script_queue)) && (scripts->script_slots_available > 0 || !globus_fifo_empty(&scripts->script_handles))) { /* head may be non-null if we fail due to an I/O error below (see * the "continue" statements */ if (head == NULL) { head = globus_priority_q_first(&scripts->script_queue); } /* Prefer to reuse a handle to the script */ if (!globus_fifo_empty(&scripts->script_handles)) { head->handle = globus_fifo_dequeue(&scripts->script_handles); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.script.info " "level=DEBUG " "msg=\"%s\" " "handle=%p " "\n", "Using script handle from fifo", head->handle); rc = globus_l_gram_script_register_read_and_write(head); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_SUCCESS; continue; } } else { /* Create a new script if more slots are available */ assert(scripts->script_slots_available > 0); rc = globus_gram_job_manager_script_handle_init( manager, scripts, &head->handle); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.script.info " "level=DEBUG " "msg=\"%s\" " "handle=%p " "rc=%d " "\n", "Created new script handle", head->handle, -rc); if (rc != GLOBUS_SUCCESS) { continue; } result = globus_xio_register_open( head->handle->handle, NULL, manager->script_attr, globus_l_gram_script_open_callback, head); if (result != GLOBUS_SUCCESS) { /* I think blocking call is safe here */ globus_xio_close(head->handle->handle, NULL); head->handle->handle = NULL; continue; } head->handle->pending_ops++; scripts->script_slots_available--; } globus_priority_q_dequeue(&scripts->script_queue); head = NULL; } return; } /* globus_l_gram_process_script_queue_locked() */ static void globus_l_gram_script_open_callback( globus_xio_handle_t handle, globus_result_t result, void * user_arg) { globus_gram_job_manager_script_context_t * context = user_arg; globus_gram_script_handle_t script_handle = context->handle; globus_gram_jobmanager_request_t * request = context->request; int rc = GLOBUS_SUCCESS; int i; globus_gram_job_manager_scripts_t * scripts; script_handle->pending_ops--; if (result == GLOBUS_SUCCESS) { rc = globus_l_gram_script_register_read_and_write(context); } else { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_JOBMANAGER_SCRIPT; } if (rc != GLOBUS_SUCCESS) { GlobusGramJobManagerLock(script_handle->manager); scripts = globus_list_first( globus_list_search_pred( request->manager->scripts_per_client, globus_l_match_script_client_addr, request->job_stats.client_address)); globus_xio_register_close( handle, NULL, globus_l_script_close_callback, script_handle); scripts->script_slots_available++; GlobusGramJobManagerUnlock(script_handle->manager); context->callback( context->callback_arg, request, GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_SCRIPT_STATUS, context->starting_jobmanager_state, NULL, NULL); globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "script"); for (i = 0; i < context->iovcnt; i++) { free(context->iov[i].iov_base); } free(context->iov); free(context); } } /* globus_l_gram_script_open_callback() */ static int globus_l_gram_script_register_read_and_write( globus_gram_job_manager_script_context_t * script_context) { int i, total_iov_contents; globus_result_t result; globus_gram_job_manager_t * manager; globus_gram_jobmanager_request_t * request = script_context->request; globus_gram_job_manager_scripts_t * scripts; manager = script_context->handle->manager; scripts = globus_list_first( globus_list_search_pred( manager->scripts_per_client, globus_l_match_script_client_addr, request->job_stats.client_address)); for (i = 0, total_iov_contents = 0; i < script_context->iovcnt; i++) { total_iov_contents += script_context->iov[i].iov_len; } result = globus_xio_register_writev( script_context->handle->handle, script_context->iov, script_context->iovcnt, total_iov_contents, NULL, globus_l_script_writev_callback, script_context->handle); if (result != GLOBUS_SUCCESS) { char *errstr = globus_error_print_friendly( globus_error_peek(result)); char *escaped_errstr; escaped_errstr = globus_gram_prepare_log_string(errstr); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.script.write.end level=ERROR " "msg=\"%s\" status=%d reason=\"%s\"\n", "error writing to script input", -1, escaped_errstr ? escaped_errstr : ""); if (errstr) { free(errstr); } if (escaped_errstr) { free(escaped_errstr); } globus_xio_register_close( script_context->handle->handle, NULL, globus_l_script_close_callback, script_context->handle); script_context->handle = NULL; scripts->script_slots_available++; return GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_JOBMANAGER_SCRIPT; } script_context->handle->pending_ops++; result = globus_xio_register_read( script_context->handle->handle, script_context->handle->return_buf, sizeof(script_context->handle->return_buf), 1, NULL, globus_l_gram_job_manager_script_read, script_context); if (result != GLOBUS_SUCCESS) { globus_xio_register_close( script_context->handle->handle, NULL, globus_l_script_close_callback, script_context->handle); script_context->handle = NULL; scripts->script_slots_available++; return GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_JOBMANAGER_SCRIPT; } script_context->handle->pending_ops++; return GLOBUS_SUCCESS; } /** * Convert a fifo of NULL-terminated strings into an array of iovec structs * * @param fifo * Fifo of strings. All strings will be removed from this fifo, but it * will not be destroyed. * @param iov * Pointer to an array of iovec structs. A new array will be allocated * to hold the values of @a fifo. * @param num_iov * Pointer to the number of iovec structs in the resulting string. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed */ static int globus_l_gram_fifo_to_iovec( globus_fifo_t * fifo, struct iovec ** iov, int * num_iov) { globus_list_t *list; size_t len; char * str; int i; int rc = GLOBUS_SUCCESS; len = globus_fifo_size(fifo); list = globus_fifo_convert_to_list(fifo); *iov = malloc(len * sizeof(struct iovec)); if (*iov == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_iov_failed; } *num_iov = len; i = 0; for (; list != NULL; i++) { str = globus_list_remove(&list, list); (*iov)[i].iov_base = str; (*iov)[i].iov_len = strlen(str); } if (rc != GLOBUS_SUCCESS) { malloc_iov_failed: *iov = NULL; *num_iov = 0; } return rc; } /* globus_l_gram_fifo_to_iovec() */ /** * Finished processing a script, start another if one is queued * * @param manager * Job manager state * * @return void */ static void globus_l_gram_job_manager_script_done( globus_gram_job_manager_t * manager, globus_gram_job_manager_scripts_t * scripts, globus_gram_script_handle_t handle) { if (handle->pending_ops > 0) { return; } if (handle->result == GLOBUS_SUCCESS) { handle->last_use = time(NULL); globus_fifo_enqueue(&scripts->script_handles, handle); } else { globus_xio_register_close( handle->handle, NULL, globus_l_script_close_callback, handle); scripts->script_slots_available++; } globus_l_gram_process_script_queue_locked(manager, scripts); return; } /* globus_l_gram_job_manager_script_done() */ void globus_gram_job_manager_script_close_all( globus_gram_job_manager_t * manager) { globus_gram_script_handle_t handle; globus_list_t * tmp; globus_gram_job_manager_scripts_t * scripts; for (tmp = manager->scripts_per_client; tmp != NULL; tmp = globus_list_rest(tmp)) { scripts = globus_list_first(tmp); while (!globus_fifo_empty(&scripts->script_handles)) { handle = globus_fifo_dequeue(&scripts->script_handles); globus_xio_close( handle->handle, NULL); free(handle); scripts->script_slots_available++; } } } /* globus_gram_job_manager_script_close_all() */ int globus_gram_job_manager_script_handle_init( globus_gram_job_manager_t * manager, globus_gram_job_manager_scripts_t * scripts, globus_gram_script_handle_t * handle) { globus_result_t result; int rc = GLOBUS_SUCCESS; *handle = malloc(sizeof(struct globus_gram_script_handle_s)); if (*handle == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto fail; } (*handle)->scripts = scripts; (*handle)->return_buf[0] = 0; (*handle)->return_buf_offset = 0; (*handle)->result = GLOBUS_SUCCESS; (*handle)->manager = manager; (*handle)->pending_ops = 0; (*handle)->last_use = time(NULL); result = globus_xio_handle_create( &(*handle)->handle, globus_i_gram_job_manager_popen_stack); if (result != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_JOBMANAGER_SCRIPT; goto handle_create_failed; } if (rc != GLOBUS_SUCCESS) { handle_create_failed: free(*handle); } fail: if (rc != GLOBUS_SUCCESS) { *handle = NULL; } return rc; } /* globus_gram_job_manager_script_handle_init() */ static void globus_l_script_close_callback( globus_xio_handle_t handle, globus_result_t result, void * user_arg) { free(user_arg); } /* globus_l_script_close_callback() */ static void globus_l_script_writev_callback( 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_gram_script_handle_t script_handle = user_arg; globus_gram_job_manager_log( script_handle->manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.script_write.end " "level=DEBUG " "msg=\"%s\" " "nbytes=%d " "result=%d " "pending_ops=%d " "\n ", "writev callback", (int) nbytes, (int) result, script_handle->pending_ops); GlobusGramJobManagerLock(script_handle->manager); if (script_handle->result == GLOBUS_SUCCESS) { script_handle->result = result; } script_handle->pending_ops--; globus_l_gram_job_manager_script_done( script_handle->manager, script_handle->scripts, script_handle); GlobusGramJobManagerUnlock(script_handle->manager); } /** * Periodic callback to close idle script handles * * If a script handle hasn't been used in over 30 seconds, and there are * no pending script events, it will be closed by this callback and removed * from the script handle fifo. */ void globus_gram_script_close_idle( void * arg) { globus_gram_job_manager_t * manager = arg; globus_gram_script_handle_t handle; time_t now = time(NULL); globus_list_t * tmp; globus_gram_job_manager_scripts_t * scripts; GlobusGramJobManagerLock(manager); for (tmp = manager->scripts_per_client; tmp != NULL; tmp = globus_list_rest(tmp)) { scripts = globus_list_first(tmp); if (!globus_priority_q_empty(&scripts->script_queue)) { goto nonempty_queue; } while (!globus_fifo_empty(&scripts->script_handles)) { handle = globus_fifo_peek(&scripts->script_handles); if (difftime(now, handle->last_use) > 30.0) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.script_idle.info " "level=DEBUG " "msg=\"closing idle script handle after %.1f seconds" "\n ", difftime(now, handle->last_use)); globus_fifo_dequeue(&scripts->script_handles); globus_xio_close( handle->handle, NULL); free(handle); scripts->script_slots_available++; } else { break; } } nonempty_queue: ; } GlobusGramJobManagerUnlock(manager); } /* globus_gram_script_close_idle() */ static int globus_l_gram_script_priority_cmp( void * priority_1, void * priority_2) { globus_gram_script_priority_t *p1 = priority_1, *p2 = priority_2; if (p1->priority_level > p2->priority_level) { return 1; } else if (p1->priority_level < p2->priority_level) { return -1; } else if (p1->sequence > p2->sequence) { return 2; } else { assert(p1->sequence < p2->sequence); return -2; } } /* globus_l_gram_script_priority_cmp() */ static int globus_l_match_script_client_addr( void * datum, void * arg) { globus_gram_job_manager_scripts_t * scripts = datum; char * client_addr = arg; return strncmp(scripts->client_addr, client_addr, strlen(scripts->client_addr)) == 0; } /* globus_l_match_script_client_addr() */ globus_gram_job_manager-13.53/bootstrap0000777000076400007640000000110011627153727015255 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 aclocal_includes="-I $(pwd)" . ${GLOBUS_LOCATION}/share/globus/globus-bootstrap.sh globus_gram_job_manager-13.53/globus_gram_job_manager_script_interface.dox0000666000076400007640000000425111620260406024253 00000000000000/** @page globus_gram_job_manager_script_interface Job Manager Scheduler Interface The GRAM Job Manager interfaces with the job filesystems and scheduler through scheduler-specific Perl modules. GRAM provides several Perl modules which can be used to implement scheduler-specific interfaces to the GRAM Job Manager. These are:
Globus::GRAM::Error
This module implements the GRAM error results as objects. Methods in this module will construct a GRAM error with the value matching the values in the GRAM Protocol library. A scheduler-specific JobManager module may return one of these objects from its methods to indicate errors to the Job Manager program.
Globus::GRAM::JobState
This module defines the GRAM job state constants. A scheduler-specific JobManager module returns one of these values from its methods to indicate the managed job's current state.
Globus::GRAM::JobSignal
This module defines the GRAM job signal constant values. The Job Manager uses these values to communicate which signal is being invoked in the manager's signal method.
Globus::GRAM::JobManager
This module defines the actual implementatoin of the Job Manager scheduler interface. One writing a scheduler-specific GRAM interface will create a subclass of this object which overrides the default implementation's methods.
Globus::GRAM::JobDescription
This module mimics the RSL job description using perl syntax. The job manager passes an object of this type to the JobManager modules's constructor. The job manager stores RSL and some configuration values in that JobDescription object. The manager accesses values stored in the JobDescription by invoking methods containing the RSL attribute's name (example: $description->gram_my_job()). Method names are handled as if they were based on the canonical RSL representation of the attribute name. For example, the gram_my_job may be equivalently referred to as GramMyJob, grammyjob, or GRAM_My_Job.
*/ globus_gram_job_manager-13.53/globus-gram-job-manager.conf.in0000666000076400007640000000016711741216775021201 00000000000000-globus-toolkit-version @GLOBUS_TOOLKIT_VERSION@ -log-pattern @LOGDIR@/gram_$(LOGNAME).log -audit-directory @AUDITDIR@ globus_gram_job_manager-13.53/aclocal.m40000664000076400007640000106075512145177130015164 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([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 ppc64|s390x|sparc64|x86_64) libdir=\"$libdir64\" ;; *) libdir=\"$libdir32\" ;; esac " perl_libdir_choice=" if (\`uname -m\` =~ /^(ppc64|s390x|sparc64|x86_64)\$/) { \$libdir = \"$libdir64\"; } else { \$libdir = \"$libdir32\"; } " ;; 1:*linux*:*lib) libdir32="${libdir}" libdir64="${libdir}64" libdir_choice=" case \`uname -m\` in ppc64|s390x|sparc64|x86_64) libdir=\"$libdir64\" ;; *) libdir=\"$libdir32\" ;; esac " perl_libdir_choice=" if (\`uname -m\` =~ /^(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) ]) dnl AC_DEFUN([GLOBUS_OPENSSL], [ AC_ARG_WITH(openssl, AC_HELP_STRING( [--with-openssl=PATH], [Specify the root of the openssl installation]), [ case $withval in no|yes) ;; *) openssl="$withval" ;; esac ]) if test "${openssl}" != ""; then PKG_CONFIG_PATH=${openssl}/lib/pkgconfig export PKG_CONFIG_PATH fi AC_MSG_CHECKING([OpenSSL CFLAGS]) if test "$OPENSSL_CFLAGS" = ""; then if pkg-config openssl --exists > /dev/null 2>&1 ; then OPENSSL_CFLAGS="`pkg-config openssl --cflags`" elif test -r "${openssl}/include/openssl/ssl.h" ; then OPENSSL_CFLAGS="-I ${openssl}/include" fi fi AC_MSG_RESULT([using '$OPENSSL_CFLAGS']) CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}" AC_TRY_COMPILE([#include ], [SSL_library_init();],, [AC_MSG_ERROR([Unable to compile with SSL])]) AC_MSG_CHECKING([OpenSSL LIBS]) if test "$OPENSSL_LIBS" = ""; then if pkg-config openssl --exists > /dev/null 2>&1 ; then OPENSSL_PKGCONF_DEPENDENCIES="openssl" OPENSSL_LIBS="`pkg-config openssl --libs`" else OPENSSL_LIBS="-L${openssl}/lib -lssl -lcrypto" fi fi AC_MSG_RESULT([using '$OPENSSL_LIBS']) LIBS="${LIBS} ${OPENSSL_LIBS}" AC_TRY_LINK( [#include ], [SSL_library_init();], , [AC_MSG_ERROR([Unable to link with SSL])]) AC_SUBST(OPENSSL_CFLAGS) AC_SUBST(OPENSSL_LIBS) if test "x$OPENSSL_PKGCONF_DEPENDENCIES" != "x"; then GPT_PKGCONFIG_DEPENDENCIES="$GPT_PKGCONFIG_DEPENDENCIES $OPENSSL_PKGCONF_DEPENDENCIES" else GPT_EXTERNAL_INCLUDES="${GPT_EXTERNAL_INCLUDES} ${OPENSSL_CFLAGS}" GPT_EXTERNAL_LIBS="${GPT_EXTERNAL_LIBS} ${OPENSSL_LIBS}" fi ]) 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" ]) # Configure paths for LIBXML2 # Mike Hommey 2004-06-19 # use CPPFLAGS instead of CFLAGS # Toshio Kuratomi 2001-04-21 # Adapted from: # Configure paths for GLIB # Owen Taylor 97-11-3 dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS dnl AC_DEFUN([AM_PATH_XML2],[ AC_ARG_WITH(xml-prefix, [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)], xml_config_prefix="$withval", xml_config_prefix="") AC_ARG_WITH(xml-exec-prefix, [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)], xml_config_exec_prefix="$withval", xml_config_exec_prefix="") AC_ARG_ENABLE(xmltest, [ --disable-xmltest Do not try to compile and run a test LIBXML program],, enable_xmltest=yes) if test x$xml_config_exec_prefix != x ; then xml_config_args="$xml_config_args" if test x${XML2_CONFIG+set} != xset ; then XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config fi fi if test x$xml_config_prefix != x ; then xml_config_args="$xml_config_args --prefix=$xml_config_prefix" if test x${XML2_CONFIG+set} != xset ; then XML2_CONFIG=$xml_config_prefix/bin/xml2-config fi fi AC_PATH_PROG(XML2_CONFIG, xml2-config, no) min_xml_version=ifelse([$1], ,2.0.0,[$1]) AC_MSG_CHECKING(for libxml - version >= $min_xml_version) no_xml="" if test "$XML2_CONFIG" = "no" ; then no_xml=yes else XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags` XML_LIBS=`$XML2_CONFIG $xml_config_args --libs` xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_xmltest" = "xyes" ; then ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" LIBS="$XML_LIBS $LIBS" dnl dnl Now check if the installed libxml is sufficiently new. dnl (Also sanity checks the results of xml2-config to some extent) dnl rm -f conf.xmltest AC_TRY_RUN([ #include #include #include #include int main() { int xml_major_version, xml_minor_version, xml_micro_version; int major, minor, micro; char *tmp_version; system("touch conf.xmltest"); /* Capture xml2-config output via autoconf/configure variables */ /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = (char *)strdup("$min_xml_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string from xml2-config\n", "$min_xml_version"); exit(1); } free(tmp_version); /* Capture the version information from the header files */ tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION); if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) { printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION"); exit(1); } free(tmp_version); /* Compare xml2-config output to the libxml headers */ if ((xml_major_version != $xml_config_major_version) || (xml_minor_version != $xml_config_minor_version) || (xml_micro_version != $xml_config_micro_version)) { printf("*** libxml header files (version %d.%d.%d) do not match\n", xml_major_version, xml_minor_version, xml_micro_version); printf("*** xml2-config (version %d.%d.%d)\n", $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version); return 1; } /* Compare the headers to the library to make sure we match */ /* Less than ideal -- doesn't provide us with return value feedback, * only exits if there's a serious mismatch between header and library. */ LIBXML_TEST_VERSION; /* Test that the library is greater than our minimum version */ if ((xml_major_version > major) || ((xml_major_version == major) && (xml_minor_version > minor)) || ((xml_major_version == major) && (xml_minor_version == minor) && (xml_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", xml_major_version, xml_minor_version, xml_micro_version); printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the xml2-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n"); printf("*** correct copy of xml2-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } return 1; } ],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_xml" = x ; then AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$XML2_CONFIG" = "no" ; then echo "*** The xml2-config script installed by LIBXML could not be found" echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the XML2_CONFIG environment variable to the" echo "*** full path to xml2-config." else if test -f conf.xmltest ; then : else echo "*** Could not run libxml test program, checking why..." CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" LIBS="$LIBS $XML_LIBS" AC_TRY_LINK([ #include #include ], [ LIBXML_TEST_VERSION; return 0;], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBXML or finding the wrong" echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means LIBXML was incorrectly installed" echo "*** or that you have moved LIBXML since it was installed. In the latter case, you" echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ]) CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi fi XML_CPPFLAGS="" XML_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(XML_CPPFLAGS) AC_SUBST(XML_LIBS) rm -f conf.xmltest ]) globus_gram_job_manager-13.53/GLOBUS_LICENSE0000666000076400007640000002367611620260406015402 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_gram_job_manager-13.53/globus-job-manager.80000666000076400007640000004123511735076151017066 00000000000000'\" t .\" Title: globus-job-manager .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 03/29/2012 .\" Manual: GRAM5 Commands .\" Source: University of Chicago .\" Language: English .\" .TH "GLOBUS\-JOB\-MANAGER" "8" "03/29/2012" "University of Chicago" "GRAM5 Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" globus-job-manager \- Execute and monitor jobs .SH "SYNOPSIS" .HP \w'\fBglobus\-job\-manager\fR\ 'u \fBglobus\-job\-manager\fR {\-type\ \fILRM\fR} [\-conf\ \fICONFIG_PATH\fR] [\-help] [\-globus\-host\-manufacturer\ \fIMANUFACTURER\fR] [\-globus\-host\-cputype\ \fICPUTYPE\fR] [\-globus\-host\-osname\ \fIOSNAME\fR] [\-globus\-host\-osversion\ \fIOSVERSION\fR] [\-globus\-gatekeeper\-host\ \fIHOST\fR] [\-globus\-gatekeeper\-port\ \fIPORT\fR] [\-globus\-gatekeeper\-subject\ \fISUBJECT\fR] [\-home\ \fIGLOBUS_LOCATION\fR] [\-target\-globus\-location\ \fITARGET_GLOBUS_LOCATION\fR] [\-condor\-arch\ \fIARCH\fR] [\-condor\-os\ \fIOS\fR] [\-history\ \fIHISTORY_DIRECTORY\fR] [\-scratch\-dir\-base\ \fISCRATCH_DIRECTORY\fR] [\-enable\-syslog] [\-stdio\-log\ \fILOG_DIRECTORY\fR] [\-log\-pattern\ \fIPATTERN\fR] [\-log\-levels\ \fILEVELS\fR] [\-state\-file\-dir\ \fISTATE_DIRECTORY\fR] [\-globus\-tcp\-port\-range\ \fIPORT_RANGE\fR] [\-globus\-tcp\-source\-range\ \fISOURCE_RANGE\fR] [\-x509\-cert\-dir\ \fITRUSTED_CERTIFICATE_DIRECTORY\fR] [\-cache\-location\ \fIGASS_CACHE_DIRECTORY\fR] [\-k] [\-extra\-envvars\ \fIVAR=VAL,\&.\&.\&.\fR] [\-seg\-module\ \fISEG_MODULE\fR] [\-audit\-directory\ \fIAUDIT_DIRECTORY\fR] [\-globus\-toolkit\-version\ \fITOOLKIT_VERSION\fR] [\-disable\-streaming] [\-disable\-usagestats] [\-usagestats\-targets\ \fITARGET\fR] [\-service\-tag\ \fISERVICE_TAG\fR] .SH "DESCRIPTION" .PP The \fBglobus\-job\-manager\fR program is a servivce which starts and controls GRAM jobs which are executed by a local resource management system, such as LSF or Condor\&. The \fBglobus\-job\-manager\fR program is typically started by the \fBglobus\-gatekeeper\fR program and not directly by a user\&. It runs until all jobs it is managing have terminated or its delegated credentials have expired\&. .PP Typically, users interact with the \fBglobus\-job\-manager\fR program via client applications such as \fBglobusrun\fR, \fBglobus\-job\-submit\fR, or tools such as CoG jglobus or Condor\-G\&. .PP The full set of command\-line options to \fBglobus\-job\-manager\fR consists of: .PP \fB\-help\fR .RS 4 Display a help message to standard error and exit .RE .PP \fB\-type \fR\fB\fILRM\fR\fR .RS 4 Execute jobs using the local resource manager named \fILRM\fR\&. .RE .PP \fB\-conf \fR\fB\fICONFIG_PATH\fR\fR .RS 4 Read additional command\-line arguments from the file \fICONFIG_PATH\fR\&. If present, this must be the first command\-line argument to the \fBglobus\-job\-manager\fR program\&. .RE .PP \fB\-globus\-host\-manufacturer \fR\fB\fIMANUFACTURER\fR\fR .RS 4 Indicate the manufacturer of the system which the jobs will execute on\&. This parameter sets the value of the \fI$(GLOBUS_HOST_MANUFACTURER)\fR RSL substitution to \fIMANUFACTURER\fR .RE .PP \fB\-globus\-host\-cputype \fR\fB\fICPUTYPE\fR\fR .RS 4 Indicate the CPU type of the system which the jobs will execute on\&. This parameter sets the value of the \fI$(GLOBUS_HOST_CPUTYPE)\fR RSL substitution to \fICPUTYPE\fR .RE .PP \fB\-globus\-host\-osname \fR\fB\fIOSNAME\fR\fR .RS 4 Indicate the operating system type of the system which the jobs will execute on\&. This parameter sets the value of the \fI$(GLOBUS_HOST_OSNAME)\fR RSL substitution to \fIOSNAME\fR .RE .PP \fB\-globus\-host\-osversion \fR\fB\fIOSVERSION\fR\fR .RS 4 Indicate the operating system version of the system which the jobs will execute on\&. This parameter sets the value of the \fI$(GLOBUS_HOST_OSVERSION)\fR RSL substitution to \fIOSVERSION\fR .RE .PP \fB\-globus\-gatekeeper\-host \fR\fB\fIHOST\fR\fR .RS 4 Indicate the host name of the machine which the job was submitted to\&. This parameter sets the value of the \fI$(GLOBUS_GATEKEEPER_HOST)\fR RSL substitution to \fIHOST\fR .RE .PP \fB\-globus\-gatekeeper\-port \fR\fB\fIPORT\fR\fR .RS 4 Indicate the TCP port number of gatekeeper to which jobs are submitted to\&. This parameter sets the value of the \fI$(GLOBUS_GATEKEEPER_PORT)\fR RSL substitution to \fIPORT\fR .RE .PP \fB\-globus\-gatekeeper\-subject \fR\fB\fISUBJECT\fR\fR .RS 4 Indicate the X\&.509 identity of the gatekeeper to which jobs are submitted to\&. This parameter sets the value of the \fI$(GLOBUS_GATEKEEPER_SUBJECT)\fR RSL substitution to \fISUBJECT\fR .RE .PP \fB\-home \fR\fB\fIGLOBUS_LOCATION\fR\fR .RS 4 Indicate the path where the Globus Toolkit(r) is installed on the service node\&. This is used by the job manager to locate its support and configuration files\&. .RE .PP \fB\-target\-globus\-location \fR\fB\fITARGET_GLOBUS_LOCATION\fR\fR .RS 4 Indicate the path where the Globus Toolkit(r) is installed on the execution host\&. If this is omitted, the value specified as a parameter to \fB\-home\fR is used\&. This parameter sets the value of the \fI$(GLOBUS_LOCATION)\fR RSL substitution to \fITARGET_GLOBUS_LOCATION\fR .RE .PP \fB\-history \fR\fB\fIHISTORY_DIRECTORY\fR\fR .RS 4 Configure the job manager to write job history files to \fIHISTORY_DIRECTORY\fR\&. These files are described in the FILES section below\&. .RE .PP \fB\-scratch\-dir\-base \fR\fB\fISCRATCH_DIRECTORY\fR\fR .RS 4 Configure the job manager to use \fISCRATCH_DIRECTORY\fR as the default scratch directory root if a relative path is specified in the job RSL\*(Aqs \fIscratch_dir\fR attribute\&. .RE .PP \fB\-enable\-syslog\fR .RS 4 Configure the job manager to write log messages via syslog\&. Logging is further controlled by the argument to the \fB\-log\-levels\fR parameter described below\&. .RE .PP \fB\-log\-pattern \fR\fB\fIPATTERN\fR\fR .RS 4 Configure the job manager to write log messages to files named by the string \fIPATTERN\fR\&. The \fIPATTERN\fR string may contain job\-independent RSL substitutions such as $(HOME), $(LOGNAME), etc, as well as the special RSL substition $(DATE) which will be resolved at log time to the date in YYYYMMDD form\&. .RE .PP \fB\-stdio\-log \fR\fB\fILOG_DIRECTORY\fR\fR .RS 4 Configure the job manager to write log messages to files in the \fILOG_DIRECTORY\fR directory\&. This is a backward\-compatible parameter, equivalent to \fI\-log\-pattern \fR\fI\fILOG_DIRECTORY\fR\fR\fI/gram_$(DATE)\&.log\fR\&. .RE .PP \fB\-log\-levels \fR\fB\fILEVELS\fR\fR .RS 4 Configure the job manager to write log messages of certain levels to syslog and/or log files\&. The available log levels are FATAL, ERROR, WARN, INFO, DEBUG, and TRACE\&. Multiple values can be combined with the | character\&. The default value of logging when enabled is FATAL|ERROR\&. .RE .PP \fB\-state\-file\-dir \fR\fB\fISTATE_DIRECTORY\fR\fR .RS 4 Configure the job manager to write state files to \fISTATE_DIRECTORY\fR\&. If not specified, the job manager uses the default of \fI$GLOBUS_LOCATION\fR/tmp/gram_job_state/\&. This directory must be writable by all users and be on a file system which supports POSIX advisory file locks\&. .RE .PP \fB\-globus\-tcp\-port\-range \fR\fB\fIPORT_RANGE\fR\fR .RS 4 Configure the job manager to restrict its TCP/IP communication to use ports in the range described by \fIPORT_RANGE\fR\&. This value is also made available in the job environment via the \fIGLOBUS_TCP_PORT_RANGE\fR environment variable\&. .RE .PP \fB\-globus\-tcp\-source\-range \fR\fB\fISOURCE_RANGE\fR\fR .RS 4 Configure the job manager to restrict its TCP/IP communication to use source ports in the range described by \fISOURCE_RANGE\fR\&. This value is also made available in the job environment via the \fIGLOBUS_TCP_SOURCE_RANGE\fR environment variable\&. .RE .PP \fB\-x509\-cert\-dir \fR\fB\fITRUSTED_CERTIFICATE_DIRECTORY\fR\fR .RS 4 Configure the job manager to search \fITRUSTED_CERTIFICATE_DIRECTORY\fR for its list of trusted CA certificates and their signing policies\&. This value is also made available in the job environment via the \fIX509_CERT_DIR\fR environment variable\&. .RE .PP \fB\-cache\-location \fR\fB\fIGASS_CACHE_DIRECTORY\fR\fR .RS 4 Configure the job manager to use the path \fIGASS_CACHE_DIRECTORY\fR for its temporary GASS\-cache files\&. This value is also made available in the job environment via the \fIGLOBUS_GASS_CACHE_DEFAULT\fR environment variable\&. .RE .PP \fB\-k\fR .RS 4 Configure the job manager to assume it is using Kerberos for authentication instead of X\&.509 certificates\&. This disables some certificate\-specific processing in the job manager\&. .RE .PP \fB\-extra\-envvars \fR\fB\fIVAR=VAL,\&.\&.\&.\fR\fR .RS 4 Configure the job manager to define a set of environment variables in the job environment beyond those defined in the base job environment\&. The format of the parameter to this argument is a comma\-separated sequence of VAR=VAL pairs, where VAR is the variable name and VAL is the variable\*(Aqs value\&. If the value is not specified, then the value of the variable in the job manager\*(Aqs environment is used\&. This option may be present multiple times on the command\-line or the job manager configuration file to append multiple environment settings\&. .RE .PP \fB\-seg\-module \fR\fB\fISEG_MODULE\fR\fR .RS 4 Configure the job manager to use the schedule event generator module named by \fISEG_MODULE\fR to detect job state changes events from the local resource manager, in place of the less efficient polling operations used in GT2\&. To use this, one instance of the \fBglobus\-job\-manager\-event\-generator\fR must be running to process events for the LRM into a generic format that the job manager can parse\&. .RE .PP \fB\-audit\-directory \fR\fB\fIAUDIT_DIRECTORY\fR\fR .RS 4 Configure the job manager to write audit records to the directory named by \fIAUDIT_DIRECTORY\fR\&. This records can be loaded into a database using the \fBglobus\-gram\-audit\fR program\&. .RE .PP \fB\-globus\-toolkit\-version \fR\fB\fITOOLKIT_VERSION\fR\fR .RS 4 Configure the job manager to use \fITOOLKIT_VERSION\fR as the version for audit and usage stats records\&. .RE .PP \fB\-service\-tag \fR\fB\fISERVICE_TAG\fR\fR .RS 4 Configure the job manager to use \fISERVICE_TAG\fR as a unique identifier to allow multiple GRAM instances to use the same job state directories without interfering with each other\*(Aqs jobs\&. If not set, the value untagged will be used\&. .RE .PP \fB\-disable\-streaming\fR .RS 4 Configure the job manager to disable file streaming\&. This is propagated to the LRM script interface but has no effect in GRAM5\&. .RE .PP \fB\-disable\-usagestats\fR .RS 4 Disable sending of any usage stats data, even if \fB\-usagestats\-targets\fR is present in the configuration\&. .RE .PP \fB\-usagestats\-targets \fR\fB\fITARGET\fR\fR .RS 4 Send usage packets to a data collection service for analysis\&. The \fITARGET\fR string consists of a comma\-separated list of HOST:PORT combinations, each contaiing an optional list of data to send\&. See \m[blue]\fBUsage Stats Packets\fR\m[]\&\s-2\u[1]\d\s+2 for more information about the tags\&. Special tag strings of all (which enables all tags) and default may be used, or a sequence of characters for the various tags\&. If this option is not present in the configuration, then the default of usage\-stats\&.globus\&.org:4810 is used\&. .RE .PP \fB\-condor\-arch \fR\fB\fIARCH\fR\fR .RS 4 Set the architecture specification for condor jobs to be \fIARCH\fR in job classified ads generated by the GRAM5 codnor LRM script\&. This is required for the condor LRM but ignored for all others\&. .RE .PP \fB\-condor\-os \fR\fB\fIOS\fR\fR .RS 4 Set the operating system specification for condor jobs to be \fIOS\fR in job classified ads generated by the GRAM5 codnor LRM script\&. This is required for the condor LRM but ignored for all others\&. .RE .SH "ENVIRONMENT" .PP If the following variables affect the execution of \fBglobus\-job\-manager\fR .PP \fBHOME\fR .RS 4 User\*(Aqs home directory\&. .RE .PP \fBLOGNAME\fR .RS 4 User\*(Aqs name\&. .RE .PP \fBJOBMANAGER_SYSLOG_ID\fR .RS 4 String to prepend to syslog audit messages\&. .RE .PP \fBJOBMANAGER_SYSLOG_FAC\fR .RS 4 Facility to log syslog audit messages as\&. .RE .PP \fBJOBMANAGER_SYSLOG_LVL\fR .RS 4 Priority level to use for syslog audit messages\&. .RE .PP \fBGATEKEEPER_JM_ID\fR .RS 4 Job manager ID to be used in syslog audit records\&. .RE .PP \fBGATEKEEPER_PEER\fR .RS 4 Peer information to be used in syslog audit records .RE .PP \fBGLOBUS_ID\fR .RS 4 Credential information to be used in syslog audit records .RE .PP \fBGLOBUS_JOB_MANAGER_SLEEP\fR .RS 4 Time (in seconds) to sleep when the job manager is started\&. [For debugging purposes only] .RE .PP \fBGRID_SECURITY_HTTP_BODY_FD\fR .RS 4 File descriptor of an open file which contains the initial job request and to which the initial job reply should be sent\&. This file descriptor is inherited from the \fBglobus\-gatekeeper\fR\&. .RE .PP \fBX509_USER_PROXY\fR .RS 4 Path to the X\&.509 user proxy which was delegated by the client to the \fBglobus\-gatekeeper\fR program to be used by the job manager\&. .RE .PP \fBGRID_SECURITY_CONTEXT_FD\fR .RS 4 File descriptor containing an exported security context that the job manager should use to reply to the client which submitted the job\&. .RE .PP \fBGLOBUS_USAGE_TARGETS\fR .RS 4 Default list of usagestats services to send usage packets to\&. .RE .PP \fBGLOBUS_TCP_PORT_RANGE\fR .RS 4 Default range of allowed TCP ports to listen on\&. The \fB\-globus\-tcp\-port\-range\fR command\-line option overrides this\&. .RE .PP \fBGLOBUS_TCP_SOURCE_RANGE\fR .RS 4 Default range of allowed TCP ports to bind to\&. The \fB\-globus\-tcp\-source\-range\fR command\-line option overrides this\&. .RE .SH "FILES" .PP .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fILRM\fR\&.\fITAG\fR\&.\fIred\fR .RS 4 Job manager delegated user credential\&. .RE .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fILRM\fR\&.\fITAG\fR\&.\fIlock\fR .RS 4 Job manager state lock file\&. .RE .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fILRM\fR\&.\fITAG\fR\&.\fIpid\fR .RS 4 Job manager pid file\&. .RE .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fILRM\fR\&.\fITAG\fR\&.\fIsock\fR .RS 4 Job manager socket for inter\-job manager communications\&. .RE .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fIJOB_ID\fR/ .RS 4 Job\-specific state directory\&. .RE .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fIJOB_ID\fR/stdin .RS 4 Standard input which has been staged from a remote URL\&. .RE .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fIJOB_ID\fR/stdout .RS 4 Standard output which will be staged from a remote URL\&. .RE .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fIJOB_ID\fR/stderr .RS 4 Standard error which will be staged from a remote URL\&. .RE .PP \fB$HOME\fR/\&.globus/job/\fIHOSTNAME\fR/\fIJOB_ID\fR/x509_user_proxy .RS 4 Job\-specific delegated credential\&. .RE .PP \fB$GLOBUS_LOCATION\fR/tmp/gram_job_state/job\&.\fIHOSTNAME\fR\&.\fIJOB_ID\fR .RS 4 Job state file\&. .RE .PP \fB$GLOBUS_LOCATION\fR/tmp/gram_job_state/job\&.\fIHOSTNAME\fR\&.\fIJOB_ID\fR\&.lock .RS 4 Job state lock file\&. In most cases this will be a symlink to the job manager lock file\&. .RE .PP \fB$GLOBUS_LOCATION\fR/etc/globus\-job\-manager\&.conf .RS 4 Default location of the global job manager configuration file\&. .RE .PP \fB$GLOBUS_LOCATION\fR/etc/grid\-services/jobmanager\-\fILRM\fR .RS 4 Default location of the LRM\-specific gatekeeper configuration file\&. .RE .PP \fB$GLOBUS_LOCATION\fR/etc/globus/gram/job\-\-manager\&.rvf .RS 4 Default location of the site\-specific job manager RSL validation file\&. .RE .PP \fB$GLOBUS_LOCATION\fR/etc/globus/gram/\fIlrm\fR\&.rvf .RS 4 Default location of the site\-specific job manager RSL validation file for the named lrm\&. .RE .SH "SEE ALSO" .PP \fBglobusrun\fR(1), \fBglobus-gatekeeper\fR(8), \fBglobus-personal-gatekeeper\fR(1), \fBglobus-gram-audit\fR(8) .SH "NOTES" .IP " 1." 4 Usage Stats Packets .RS 4 \%http://confluence.globus.org/display/~bester/GRAM5+Usage+Stats+Packets .RE globus_gram_job_manager-13.53/doxygen/0000775000076400007640000000000012145177165015053 500000000000000globus_gram_job_manager-13.53/doxygen/Doxyfile.in0000644000076400007640000001145512055152374017105 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_gram_job_manager-13.53/doxygen/Doxyfile-internal.in0000644000076400007640000001073512055152374020717 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_gram_job_manager-13.53/doxygen/Makefile.am0000644000076400007640000000440512055152374017023 00000000000000include $(top_srcdir)/globus_automake_pre # # Automake rules for installing and building doxygen docs # doxygen_installdox = @lac_doxygen_installdox@ all-local: @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 ; make) ; \ fi \ fi install-data-local: @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-data-local: @if test ! -z "@DOXYGEN@"; then \ rm -rf ./doc*; \ fi filelist: @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: all-local @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_gram_job_manager-13.53/doxygen/Makefile.in0000664000076400007640000003400712145177132017036 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_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@ AUDITDIR = @AUDITDIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ 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@ GENERATE_MANPAGES_FALSE = @GENERATE_MANPAGES_FALSE@ GENERATE_MANPAGES_TRUE = @GENERATE_MANPAGES_TRUE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GLOBUS_TOOLKIT_VERSION = @GLOBUS_TOOLKIT_VERSION@ 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@ LOGDIR = @LOGDIR@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ 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@ REBUILD_PARSER_FALSE = @REBUILD_PARSER_FALSE@ REBUILD_PARSER_TRUE = @REBUILD_PARSER_TRUE@ REBUILD_SCANNER_FALSE = @REBUILD_SCANNER_FALSE@ REBUILD_SCANNER_TRUE = @REBUILD_SCANNER_TRUE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XML2_CONFIG = @XML2_CONFIG@ XMLLINT = @XMLLINT@ XML_CATALOG_PATH = @XML_CATALOG_PATH@ XML_CPPFLAGS = @XML_CPPFLAGS@ XML_LIBS = @XML_LIBS@ XSLTPROC = @XSLTPROC@ 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 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 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 all-local: @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 ; make) ; \ fi \ fi install-data-local: @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-data-local: @if test ! -z "@DOXYGEN@"; then \ rm -rf ./doc*; \ fi filelist: @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: all-local @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_gram_job_manager-13.53/seg/0000775000076400007640000000000012145177166014155 500000000000000globus_gram_job_manager-13.53/seg/seg_job_manager_module.c0000666000076400007640000006315212013453436020710 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_scheduler_event_generator.h" #include "globus_gram_protocol_constants.h" #include "version.h" #include /** * @mainpage Job Manager SEG Module */ #define SEG_JOB_MANAGER_DEBUG(level, message) \ GlobusDebugPrintf(SEG_JOB_MANAGER, level, message) #define JOB_MANAGER_SEG_SCHEDULER "JOB_MANAGER_SEG_SCHEDULER" #define JOB_MANAGER_SEG_LOG_PATH "JOB_MANAGER_SEG_LOG_PATH" /** * Debug levels: * If the environment variable SEG_JOB_MANAGER_DEBUG is set to a bitwise or * of these values, then a corresponding log message will be generated. */ typedef enum { /** * Information of function calls and exits */ SEG_JOB_MANAGER_DEBUG_INFO = (1<<0), /** * Warnings of things which may be bad. */ SEG_JOB_MANAGER_DEBUG_WARN = (1<<1), /** * Fatal errors. */ SEG_JOB_MANAGER_DEBUG_ERROR = (1<<2), /** * Details of function executions. */ SEG_JOB_MANAGER_DEBUG_TRACE = (1<<3) } globus_l_seg_job_manager_debug_level_t; enum { SEG_JOB_MANAGER_ERROR_UNKNOWN = 1, SEG_JOB_MANAGER_ERROR_OUT_OF_MEMORY, SEG_JOB_MANAGER_ERROR_BAD_PATH, SEG_JOB_MANAGER_ERROR_LOG_PERMISSIONS, SEG_JOB_MANAGER_ERROR_LOG_NOT_PRESENT, SEG_JOB_MANAGER_ERROR_LOG_EOF }; /** * State of the JOB_MANAGER log file parser. */ typedef struct { /** Path of the current log file being parsed */ char * path; /** Timestamp of when to start generating events from */ struct tm start_timestamp; /** Stdio file handle of the log file */ FILE * fp; /** Callback for periodic file polling */ globus_callback_handle_t callback; /** * Flag inidicating that this logfile isn't the one corresponding to * today, so and EOF on it should require us to close and open a newer * one */ globus_bool_t old_log; /** * Path to the directory where the JOB_MANAGER server log files are located */ char * log_dir; } globus_l_job_manager_logfile_state_t; static globus_mutex_t globus_l_job_manager_mutex; static globus_cond_t globus_l_job_manager_cond; static globus_bool_t shutdown_called; static int callback_count; GlobusDebugDefine(SEG_JOB_MANAGER); static int globus_l_job_manager_module_activate(void); static int globus_l_job_manager_module_deactivate(void); static void globus_l_job_manager_poll_callback( void * user_arg); static int globus_l_job_manager_parse_events( globus_l_job_manager_logfile_state_t * state); static void globus_l_job_manager_normalize_date( struct tm * tm); static int globus_l_job_manager_find_logfile( globus_l_job_manager_logfile_state_t * state); static globus_bool_t globus_l_time_is_newer( struct tm * value, struct tm * benchmark); static globus_bool_t globus_l_next_file_exists( globus_l_job_manager_logfile_state_t * state); GlobusExtensionDefineModule(globus_seg_job_manager) = { "globus_seg_job_manager", globus_l_job_manager_module_activate, globus_l_job_manager_module_deactivate, NULL, NULL, &local_version }; static int globus_l_job_manager_module_activate(void) { time_t timestamp_val; globus_l_job_manager_logfile_state_t * logfile_state; int rc; globus_reltime_t delay; globus_result_t result; char * scheduler; rc = globus_module_activate(GLOBUS_COMMON_MODULE); if (rc != GLOBUS_SUCCESS) { goto activate_common_failed; } rc = globus_mutex_init(&globus_l_job_manager_mutex, NULL); if (rc != GLOBUS_SUCCESS) { goto mutex_init_failed; } rc = globus_cond_init(&globus_l_job_manager_cond, NULL); if (rc != GLOBUS_SUCCESS) { goto cond_init_failed; } shutdown_called = GLOBUS_FALSE; callback_count = 0; GlobusDebugInit( SEG_JOB_MANAGER, SEG_JOB_MANAGER_DEBUG_INFO SEG_JOB_MANAGER_DEBUG_WARN SEG_JOB_MANAGER_DEBUG_ERROR SEG_JOB_MANAGER_DEBUG_TRACE); logfile_state = calloc(1, sizeof(globus_l_job_manager_logfile_state_t)); if (logfile_state == NULL) { goto calloc_state_failed; } /* Configuration info */ result = globus_scheduler_event_generator_get_timestamp(×tamp_val); if (result != GLOBUS_SUCCESS) { goto get_timestamp_failed; } if (timestamp_val != 0) { if (globus_libc_gmtime_r( ×tamp_val, &logfile_state->start_timestamp) == NULL) { goto gmtime_failed; } } scheduler = globus_libc_getenv(JOB_MANAGER_SEG_SCHEDULER); if (scheduler == NULL) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_ERROR, ("Error: %s not set\n", JOB_MANAGER_SEG_SCHEDULER)); result = GLOBUS_FAILURE; goto get_scheduler_failed; } if (getenv(JOB_MANAGER_SEG_LOG_PATH)) { logfile_state->log_dir = strdup(getenv(JOB_MANAGER_SEG_LOG_PATH)); } else { char * log_dir_pattern = globus_common_create_string( "${localstatedir}/lib/globus/globus-seg-%s", scheduler); globus_eval_path(log_dir_pattern, &logfile_state->log_dir); free(log_dir_pattern); } if (logfile_state->log_dir == NULL) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_ERROR, ("Error: out of memory\n")); goto get_path_failed; } /* Convert timestamp to filename */ rc = globus_l_job_manager_find_logfile(logfile_state); if (rc == GLOBUS_SUCCESS) { logfile_state->fp = fopen(logfile_state->path, "r"); if (logfile_state->fp == NULL) { rc = SEG_JOB_MANAGER_ERROR_OUT_OF_MEMORY; goto fopen_failed; } GlobusTimeReltimeSet(delay, 0, 0); } else if(rc == SEG_JOB_MANAGER_ERROR_LOG_NOT_PRESENT) { GlobusTimeReltimeSet(delay, 1, 0); } else { goto bad_log_path; } result = globus_callback_register_oneshot( &logfile_state->callback, &delay, globus_l_job_manager_poll_callback, logfile_state); if (result != GLOBUS_SUCCESS) { goto oneshot_failed; } callback_count++; return 0; oneshot_failed: if (logfile_state->fp) { fclose(logfile_state->fp); } fopen_failed: if (logfile_state->path) { free(logfile_state->path); } bad_log_path: free(logfile_state->log_dir); get_path_failed: get_scheduler_failed: get_timestamp_failed: gmtime_failed: free(logfile_state); calloc_state_failed: globus_cond_destroy(&globus_l_job_manager_cond); cond_init_failed: globus_mutex_destroy(&globus_l_job_manager_mutex); mutex_init_failed: globus_module_deactivate(GLOBUS_COMMON_MODULE); activate_common_failed: return 1; } /* globus_l_job_manager_module_activate() */ static int globus_l_job_manager_module_deactivate(void) { globus_mutex_lock(&globus_l_job_manager_mutex); shutdown_called = GLOBUS_TRUE; while (callback_count > 0) { globus_cond_wait(&globus_l_job_manager_cond, &globus_l_job_manager_mutex); } globus_mutex_unlock(&globus_l_job_manager_mutex); GlobusDebugDestroy(SEG_JOB_MANAGER); globus_module_deactivate(GLOBUS_COMMON_MODULE); return 0; } /** * Periodic poll of file to act like tail -f * * @param user_arg * Log file parsing state */ static void globus_l_job_manager_poll_callback( void * user_arg) { int rc; globus_l_job_manager_logfile_state_t * state = user_arg; globus_bool_t eof_hit = GLOBUS_FALSE; globus_reltime_t delay; globus_result_t result; time_t poll_time = time(NULL); struct tm poll_tm, *tm_result; struct stat stat; char * today; SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_INFO, ("globus_l_job_manager_poll_callback()\n")); globus_mutex_lock(&globus_l_job_manager_mutex); if (shutdown_called) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_INFO, ("polling while deactivating")); globus_mutex_unlock(&globus_l_job_manager_mutex); goto error; } globus_mutex_unlock(&globus_l_job_manager_mutex); if (state->fp != NULL) { /* Parse data */ SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_TRACE, ("parsing events\n")); rc = globus_l_job_manager_parse_events(state); if (rc == SEG_JOB_MANAGER_ERROR_LOG_EOF) { eof_hit = GLOBUS_TRUE; } } if (eof_hit) { tm_result = globus_libc_gmtime_r(&poll_time, &poll_tm); if (tm_result == NULL) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_WARN, ("Couldn't convert to gmtime\n")); } else { today = globus_common_create_string( "%s/%4d%02d%02d", state->log_dir, tm_result->tm_year+1900, tm_result->tm_mon+1, tm_result->tm_mday); if (today && (strcmp(today, state->path) != 0)) { /* New day... if new file exists and the old one hasn't changed since our * last poll, mark it as old */ if (globus_l_next_file_exists(state)) { rc = fstat(fileno(state->fp), &stat); if (rc != -1) { if (ftello(state->fp) == stat.st_size) { state->old_log = GLOBUS_TRUE; } } } } if (today) { free(today); } } } /* If end of log, close this logfile and look for a new one. Also, if * the current day's log doesn't exist yet, check for it */ if ((eof_hit && state->old_log) || state->fp == NULL) { if (state->fp) { fclose(state->fp); state->fp = NULL; state->start_timestamp.tm_mday++; state->start_timestamp.tm_hour = 0; state->start_timestamp.tm_min = 0; state->start_timestamp.tm_sec = 0; globus_l_job_manager_normalize_date(&state->start_timestamp); } rc = globus_l_job_manager_find_logfile(state); if (rc == GLOBUS_SUCCESS) { /* Opening a new logfile, run w/out delay */ state->fp = fopen(state->path, "r"); if (state->fp == NULL) { goto error; } eof_hit = GLOBUS_FALSE; GlobusTimeReltimeSet(delay, 0, 0); } else if (rc == SEG_JOB_MANAGER_ERROR_LOG_NOT_PRESENT) { /* Current day's logfile not present, wait a bit longer for * it to show up */ GlobusTimeReltimeSet(delay, 30, 0); eof_hit = GLOBUS_TRUE; } else { goto error; } } else if(eof_hit) { /* eof on current logfile, wait for new data */ GlobusTimeReltimeSet(delay, 2, 0); } else { /* still data available in current file, hurry up! */ GlobusTimeReltimeSet(delay, 0, 0); } result = globus_callback_register_oneshot( &state->callback, &delay, globus_l_job_manager_poll_callback, state); if (result != GLOBUS_SUCCESS) { goto error; } SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_INFO, ("globus_l_job_manager_poll_callback() exited with/success\n")); return; error: globus_mutex_lock(&globus_l_job_manager_mutex); if (shutdown_called) { callback_count--; if (callback_count == 0) { globus_cond_signal(&globus_l_job_manager_cond); } } globus_mutex_unlock(&globus_l_job_manager_mutex); SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_WARN, ("globus_l_job_manager_poll_callback() exited with/error\n")); return; } /* globus_l_job_manager_poll_callback() */ /** * Determine the next available JOB_MANAGER log file name from the * timestamp stored in the logfile state structure. * * @param state * JOB_MANAGER log state structure. The path field of the structure may be * modified by this function. * * @retval GLOBUS_SUCCESS * Name of an log file name has been found and the file exists. * @retval 1 * Something bad occurred. */ static int globus_l_job_manager_find_logfile( globus_l_job_manager_logfile_state_t * state) { struct tm * tm_result; struct tm tm_val; struct tm tm_now; globus_bool_t user_timestamp = GLOBUS_TRUE; time_t now; struct stat s; int rc; SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_INFO, ("globus_l_job_manager_find_logfile()\n")); if (state->path == NULL) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_TRACE, ("allocating path\n")); state->path = malloc(strlen(state->log_dir) + 10); if (state->path == NULL) { rc = SEG_JOB_MANAGER_ERROR_OUT_OF_MEMORY; goto error; } } now = time(NULL); tm_result = globus_libc_gmtime_r(&now, &tm_now); if (tm_result == NULL) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_WARN, ("localtime_r failed\n")); rc = SEG_JOB_MANAGER_ERROR_OUT_OF_MEMORY; goto error; } else { /* Get the first log message of the day */ tm_now.tm_sec = 0; tm_now.tm_min = 0; tm_now.tm_hour = 0; } if (state->start_timestamp.tm_sec == 0 && state->start_timestamp.tm_min == 0 && state->start_timestamp.tm_hour == 0 && state->start_timestamp.tm_mday == 0 && state->start_timestamp.tm_mon == 0 && state->start_timestamp.tm_year == 0) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_TRACE, ("no timestamp set, using current time\n")); memcpy(&state->start_timestamp, &tm_now, sizeof(struct tm)); user_timestamp = GLOBUS_FALSE; } memcpy(&tm_val, &state->start_timestamp, sizeof(struct tm)); tm_result = &tm_val; do { if (tm_result == NULL) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_WARN, ("couldn't get tm from timestmap\n")); rc = SEG_JOB_MANAGER_ERROR_OUT_OF_MEMORY; goto error; } if (tm_val.tm_year < tm_now.tm_year || (tm_val.tm_year == tm_now.tm_year && tm_val.tm_mon < tm_now.tm_mon) || (tm_val.tm_year == tm_now.tm_year && tm_val.tm_mon == tm_now.tm_mon && tm_val.tm_mday < tm_now.tm_mday)) { state->old_log = GLOBUS_TRUE; } else { state->old_log = GLOBUS_FALSE; } rc = sprintf(state->path, "%s/%4d%02d%02d", state->log_dir, tm_val.tm_year+1900, tm_val.tm_mon+1, tm_val.tm_mday); if (rc < 0) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_WARN, ("couldn't format date to string\n")); rc = SEG_JOB_MANAGER_ERROR_OUT_OF_MEMORY; goto error; } rc = stat(state->path, &s); if (rc < 0) { switch (errno) { case ENOENT: /* Doesn't exist, advance to the next day's log * for next try if we're not looking to the future. */ SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_ERROR, ("file %s doesn't exist\n", state->path)); /* Increment day by 1, then normalize to be a proper * struct tm without having tm_mday exceed what is valid * for the month. */ tm_val.tm_mday++; globus_l_job_manager_normalize_date(&tm_val); if (globus_l_time_is_newer(&tm_val, &tm_now)) { SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_ERROR, ("looking for file in the future!\n")); rc = SEG_JOB_MANAGER_ERROR_LOG_NOT_PRESENT; goto error; } /* Starting new log, get all messages in that file */ tm_val.tm_sec = 0; tm_val.tm_min = 0; tm_val.tm_hour = 0; memcpy(&state->start_timestamp, &tm_val, sizeof(struct tm)); break; case EACCES: SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_ERROR, ("permissions needed to access logfile %s\n", state->path)); /* Permission problem (fatal) */ rc = SEG_JOB_MANAGER_ERROR_LOG_PERMISSIONS; goto error; case ENOTDIR: case ELOOP: case ENAMETOOLONG: /* broken path (fatal) */ SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_ERROR, ("broken path to logfile %s\n", state->path)); rc = SEG_JOB_MANAGER_ERROR_BAD_PATH; goto error; case EFAULT: SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_ERROR, ("bad pointer\n")); globus_assert(errno != EFAULT); case EINTR: case ENOMEM: /* low kernel mem */ /* try again later */ SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_WARN, ("going to have to retry stat()\n")); continue; default: SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_ERROR, ("unexpected errno\n")); rc = SEG_JOB_MANAGER_ERROR_UNKNOWN; goto error; } } } while ((rc != 0) && user_timestamp); if (rc != 0) { goto error; } SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_INFO, ("globus_l_job_manager_find_logfile() exits w/out error\n")); return 0; error: SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_WARN, ("globus_l_job_manager_find_logfile() exits w/error\n")); return rc; } /* globus_l_job_manager_find_logfile() */ static int globus_l_job_manager_parse_events( globus_l_job_manager_logfile_state_t * state) { int rc; int protocol_msg_type; time_t stamp; char jobid[129]; char nl[2]; int job_state; int exit_code; struct tm gmstamp, *gmstampp; fpos_t pos; SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_INFO, ("globus_l_job_manager_parse_events() called\n")); fgetpos(state->fp, &pos); while ((rc = fscanf(state->fp, "%d;%ld;%128[^;];%d;%d%1[\n]", &protocol_msg_type, &stamp, jobid, &job_state, &exit_code, nl)) > 4) { if (rc == 4 && fscanf(state->fp, "%1[\n]", nl) != 1) { goto bad_line; } if (protocol_msg_type != 1) { goto bad_line; } gmstampp = globus_libc_gmtime_r(&stamp, &gmstamp); if (globus_l_time_is_newer(&state->start_timestamp, &gmstamp)) { /* Ignore events that occur before our start timestamp */ goto bad_line; } switch(job_state) { case GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING: globus_scheduler_event_pending(stamp, jobid); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE: globus_scheduler_event_active(stamp, jobid); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE: globus_scheduler_event_done(stamp, jobid, exit_code); break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED: globus_scheduler_event_failed(stamp, jobid, exit_code); break; default: goto bad_line; } bad_line: fgetpos(state->fp, &pos); } if (feof(state->fp)) { clearerr(state->fp); rc = SEG_JOB_MANAGER_ERROR_LOG_EOF; } else { rc = 0; } fsetpos(state->fp, &pos); SEG_JOB_MANAGER_DEBUG(SEG_JOB_MANAGER_DEBUG_INFO, ("globus_l_job_manager_parse_events() exits\n")); return rc; } /* globus_l_job_manager_parse_events() */ /* Leap year is year divisible by 4, unless divisibly by 100 and not by 400 */ #define IS_LEAP_YEAR(Y) \ (!(Y % 4)) && ((Y % 100) || !(Y % 400)) static void globus_l_job_manager_normalize_date( struct tm * tm) { int test_year; int overflow_days = 0; static int mday_max[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int mday_leap_max[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; do { if (overflow_days > 0) { tm->tm_mday = overflow_days; tm->tm_mon++; } /* skipped to the next year */ if (tm->tm_mon == 12) { tm->tm_year++; tm->tm_mon = 0; } test_year = tm->tm_year + 1900; overflow_days = IS_LEAP_YEAR(test_year) ? tm->tm_mday - mday_leap_max[tm->tm_mon] : tm->tm_mday - mday_max[tm->tm_mon]; } while (overflow_days > 0); } static globus_bool_t globus_l_time_is_newer( struct tm * value, struct tm * benchmark) { if (value->tm_year < benchmark->tm_year) { return GLOBUS_FALSE; } else if (value->tm_year > benchmark->tm_year) { return GLOBUS_TRUE; } else if (value->tm_mon < benchmark->tm_mon) { return GLOBUS_FALSE; } else if (value->tm_mon > benchmark->tm_mon) { return GLOBUS_TRUE; } else if (value->tm_mday < benchmark->tm_mday) { return GLOBUS_FALSE; } else if (value->tm_mday > benchmark->tm_mday) { return GLOBUS_TRUE; } else if (value->tm_hour < benchmark->tm_hour) { return GLOBUS_FALSE; } else if (value->tm_hour > benchmark->tm_hour) { return GLOBUS_TRUE; } else if (value->tm_min < benchmark->tm_min) { return GLOBUS_FALSE; } else if (value->tm_min > benchmark->tm_min) { return GLOBUS_TRUE; } else if (value->tm_sec < benchmark->tm_sec) { return GLOBUS_FALSE; } else if (value->tm_sec > benchmark->tm_sec) { return GLOBUS_TRUE; } else { return GLOBUS_FALSE; } } /* globus_l_time_is_newer() */ static globus_bool_t globus_l_next_file_exists( globus_l_job_manager_logfile_state_t * state) { struct tm next_day; char * next_log; globus_bool_t file_exists = GLOBUS_FALSE; next_day = state->start_timestamp; next_day.tm_mday++; globus_l_job_manager_normalize_date(&next_day); next_day.tm_sec = 0; next_day.tm_min = 0; next_day.tm_hour = 0; next_log = globus_common_create_string( "%s/%4d%02d%02d", state->log_dir, next_day.tm_year+1900, next_day.tm_mon+1, next_day.tm_mday); if (access(next_log, R_OK) == 0) { file_exists = GLOBUS_TRUE; } free(next_log); return file_exists; } /* globus_l_next_file_exists() */ globus_gram_job_manager-13.53/seg/Makefile.am0000666000076400007640000000072011714563241016124 00000000000000include $(top_srcdir)/globus_automake_pre # Compiler flags INCLUDES = $(GPT_INCLUDES) -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/rvf $(XML_CPPFLAGS) AM_CPPFLAGS = -DGLOBUS_BUILTIN=1 lib_LTLIBRARIES = libglobus_seg_job_manager.la libglobus_seg_job_manager_la_SOURCES = seg_job_manager_module.c libglobus_seg_job_manager_la_LDFLAGS = $(GPT_LDFLAGS) -module libglobus_seg_job_manager_la_LIBADD = $(GPT_LIB_LINKS) include $(top_srcdir)/globus_automake_post globus_gram_job_manager-13.53/seg/Makefile.in0000664000076400007640000004703412145177133016144 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 = seg 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_CLEAN_FILES = 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)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libglobus_seg_job_manager_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libglobus_seg_job_manager_la_OBJECTS = seg_job_manager_module.lo libglobus_seg_job_manager_la_OBJECTS = \ $(am_libglobus_seg_job_manager_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) 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_seg_job_manager_la_SOURCES) DIST_SOURCES = $(libglobus_seg_job_manager_la_SOURCES) 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@ AUDITDIR = @AUDITDIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ 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@ GENERATE_MANPAGES_FALSE = @GENERATE_MANPAGES_FALSE@ GENERATE_MANPAGES_TRUE = @GENERATE_MANPAGES_TRUE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GLOBUS_TOOLKIT_VERSION = @GLOBUS_TOOLKIT_VERSION@ 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@ LOGDIR = @LOGDIR@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ 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@ REBUILD_PARSER_FALSE = @REBUILD_PARSER_FALSE@ REBUILD_PARSER_TRUE = @REBUILD_PARSER_TRUE@ REBUILD_SCANNER_FALSE = @REBUILD_SCANNER_FALSE@ REBUILD_SCANNER_TRUE = @REBUILD_SCANNER_TRUE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XML2_CONFIG = @XML2_CONFIG@ XMLLINT = @XMLLINT@ XML_CATALOG_PATH = @XML_CATALOG_PATH@ XML_CPPFLAGS = @XML_CPPFLAGS@ XML_LIBS = @XML_LIBS@ XSLTPROC = @XSLTPROC@ 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 # Compiler flags INCLUDES = $(GPT_INCLUDES) -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/rvf $(XML_CPPFLAGS) AM_CPPFLAGS = -DGLOBUS_BUILTIN=1 lib_LTLIBRARIES = libglobus_seg_job_manager.la libglobus_seg_job_manager_la_SOURCES = seg_job_manager_module.c libglobus_seg_job_manager_la_LDFLAGS = $(GPT_LDFLAGS) -module libglobus_seg_job_manager_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 seg/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign seg/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 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_seg_job_manager.la: $(libglobus_seg_job_manager_la_OBJECTS) $(libglobus_seg_job_manager_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libglobus_seg_job_manager_la_LDFLAGS) $(libglobus_seg_job_manager_la_OBJECTS) $(libglobus_seg_job_manager_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: 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) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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-libLTLIBRARIES clean-libtool \ 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-exec-am: install-libLTLIBRARIES 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-info-am uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool 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-info install-info-am \ install-libLTLIBRARIES 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-info-am \ uninstall-libLTLIBRARIES # 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-libLTLIBRARIES : unlink: unlink-recursive unlink-libLTLIBRARIES : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-libLTLIBRARIES unlink-libLTLIBRARIES filelist-libLTLIBRARIES filelist: filelist-recursive filelist-libLTLIBRARIES : 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_gram_job_manager-13.53/globus_gram_job_manager_auditing.c0000666000076400007640000002262211756765202022203 00000000000000/* * Copyright 1999-2009 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_gram_job_manager.h" #ifdef BUILD_LITE #define asctime_r(a, b) asctime(a) #endif static int globus_l_gram_audit_get_username( char ** username); static int globus_l_gram_audit_write_timestamp( FILE * f, time_t when, const char * delim); static int globus_l_gram_audit_write_string( FILE * f, const char * s, const char * delim); int globus_gram_job_manager_auditing_file_write( globus_gram_jobmanager_request_t * request) { char * filename; FILE * auditing_file; time_t now; struct tm tmv; struct tm * tmp; char * name; int rc; const char * auditing_dir; if(request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE) { request->manager->usagetracker->count_total_done++; } else { request->manager->usagetracker->count_total_failed++; if(request->failure_code == GLOBUS_GRAM_PROTOCOL_ERROR_USER_CANCELLED) { request->manager->usagetracker->count_total_canceled++; } } auditing_dir = request->config->auditing_dir; if (auditing_dir == NULL) { rc = GLOBUS_SUCCESS; goto out; } rc = globus_l_gram_audit_get_username(&name); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto out; } now = time(NULL); if (now <= 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto free_name_out; } tmp = globus_libc_gmtime_r(&now, &tmv); filename = globus_common_create_string( "%s/%04d%02d%02dT%02d:%02d:%02d-%s-%s.gramaudit", auditing_dir, tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, tmp->tm_hour, tmp->tm_min, tmp->tm_sec, name, request->uniq_id); if (filename == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto free_name_out; } auditing_file = fopen(filename, "w"); if (auditing_file == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto free_filename_out; } rc = chmod(filename, 0750); if (rc != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto close_filename_out; } /* job_grid_id */ rc = globus_l_gram_audit_write_string(auditing_file, request->job_contact, ","); if (rc != 0) { goto close_filename_out; } /* local_job_id */ rc = globus_l_gram_audit_write_string(auditing_file, request->original_job_id_string, ","); if (rc != 0) { goto close_filename_out; } /* subject name */ rc = globus_l_gram_audit_write_string( auditing_file, request->config->subject, ","); if (rc != 0) { goto close_filename_out; } /* username */ rc = globus_l_gram_audit_write_string(auditing_file, name, ","); if (rc != 0) { goto close_filename_out; } /* idempotent id */ rc = globus_l_gram_audit_write_string(auditing_file, NULL, ","); if (rc != 0) { goto close_filename_out; } /* creation_time */ rc = globus_l_gram_audit_write_timestamp(auditing_file, request->creation_time, ","); if (rc != 0) { goto close_filename_out; } /* queued_time */ rc = globus_l_gram_audit_write_timestamp(auditing_file, request->queued_time, ","); if (rc != 0) { goto close_filename_out; } /* stage_in_gid (WS-GRAM only) */ rc = globus_l_gram_audit_write_string(auditing_file, NULL, ","); if (rc != 0) { goto close_filename_out; } /* stage_out_grid_id (WS-GRAM only) */ rc = globus_l_gram_audit_write_string(auditing_file, NULL, ","); if (rc != 0) { goto close_filename_out; } /* clean_up_grid_id (WS-GRAM only) */ rc = globus_l_gram_audit_write_string(auditing_file, NULL, ","); if (rc != 0) { goto close_filename_out; } /* globus_toolkit_version */ rc = globus_l_gram_audit_write_string( auditing_file, request->config->globus_version, ","); if (rc != 0) { goto close_filename_out; } /* resource_manager_type */ rc = globus_l_gram_audit_write_string( auditing_file, request->config->jobmanager_type, ","); if (rc != 0) { goto close_filename_out; } /* job_description */ rc = globus_l_gram_audit_write_string(auditing_file, request->rsl_spec, ","); if (rc != 0) { goto close_filename_out; } /* success_flag */ rc = globus_l_gram_audit_write_string(auditing_file, request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE ? "true" : "false", ","); if (rc != 0) { goto close_filename_out; } /* finished_flag */ rc = globus_l_gram_audit_write_string(auditing_file,"true",","); if (rc != 0) { goto close_filename_out; } rc = globus_l_gram_audit_write_string( auditing_file, request->gateway_user, "\n"); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto close_filename_out; } close_filename_out: fclose(auditing_file); if (rc != 0) { remove(filename); } free_filename_out: free(filename); free_name_out: free(name); out: return rc; } /* globus_gram_job_manager_auditing_file_write() */ static int globus_l_gram_audit_get_username( char ** username) { struct passwd pwd; struct passwd * res; int rc; char buffer[128]; rc = globus_libc_getpwuid_r( getuid(), &pwd, buffer, sizeof(buffer), &res); if (rc != 0 || res == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; goto out; } *username = strdup(pwd.pw_name); if (*username == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } out: return rc; } /* globus_l_gram_audit_get_username() */ static int globus_l_gram_audit_write_string( FILE * f, const char * s, const char * delim) { int rc; if (s == NULL) { rc = fprintf(f, "\"NULL\"%s", delim); return rc >= 0 ? GLOBUS_SUCCESS : GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } rc = fputc('"', f); if (rc == EOF) { return GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } while (*s != '\0') { if (*s == '"') { rc = fprintf(f, """); } else { rc = fputc(*s, f); } if (rc < 0) { return GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } s++; } rc = fputc('"', f); if (rc == EOF) { return GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } rc = fprintf(f, "%s", delim); return rc >= 0 ? GLOBUS_SUCCESS : GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } /* globus_l_gram_audit_write_string() */ static int globus_l_gram_audit_write_timestamp( FILE * f, time_t when, const char * delim) { int rc; char * t; char * tmp; struct tm tmv; struct tm * tm_p; #ifndef BUILD_LITE char tbuf[26]; #endif if (when == 0) { rc = fprintf(f, "\"NULL\"%s", delim); return rc >= 0 ? GLOBUS_SUCCESS : GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } tm_p = globus_libc_gmtime_r(&when, &tmv); if (tm_p == NULL) { return GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } t = asctime_r(tm_p, tbuf); if (t == NULL) { return GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } tmp = strchr(t, '\n'); if (tmp) { *tmp = '\0'; } tmp = strrchr(t, ' '); *tmp = '\0'; rc = fprintf(f, "\"%s UTC %s\"%s", t, tmp+1, delim); return rc >= 0 ? GLOBUS_SUCCESS : GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; } /* globus_l_gram_audit_write_timestamp() */ globus_gram_job_manager-13.53/globus_gram_job_manager_usagestats.c0000666000076400007640000013230411620260406022543 00000000000000/* * Copyright 1999-2009 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_gram_job_manager.h" #include "globus_usage.h" #include "version.h" globus_list_t * globus_l_gram_usage_handle_list = NULL; #define GLOBUS_L_GRAM_JM_USAGE_ID 20 #define GLOBUS_L_GRAM_JM_USAGE_VER 0 #define GLOBUS_L_GRAM_JOB_USAGE_ID 20 #define GLOBUS_L_GRAM_JOB_USAGE_VER 1 #define GLOBUS_L_GRAM_DEFAULT_SESSION_TAGLIST "ABCDEFGIKLMNOPQRSTUVWX" #define GLOBUS_L_GRAM_DEFAULT_JOB_TAGLIST "Babcdefghijklmnopqrstuvwxyz01234YZH" #define GLOBUS_L_GRAM_PRIVATE_SESSION_TAGLIST "" #define GLOBUS_L_GRAM_PRIVATE_JOB_TAGLIST "6789" #define GLOBUS_L_GRAM_MAX_TAGCOUNT 40 typedef enum globus_l_gram_usage_tag_e { /* per session tags */ GLOBUS_L_GRAM_USAGE_JM_STARTTIME = 'A', GLOBUS_L_GRAM_USAGE_SESSION_ID = 'B', GLOBUS_L_GRAM_USAGE_STATUS__TIME = 'C', GLOBUS_L_GRAM_USAGE_VERSION = 'D', GLOBUS_L_GRAM_USAGE_LRM = 'E', GLOBUS_L_GRAM_USAGE_POLL_USED = 'F', GLOBUS_L_GRAM_USAGE_AUDIT_USED = 'G', GLOBUS_L_GRAM_USAGE_RESTARTED_JOB_COUNT = 'I', GLOBUS_L_GRAM_USAGE_TOTAL_JOB_COUNT = 'K', GLOBUS_L_GRAM_USAGE_TOTAL_FAILED_COUNT = 'L', GLOBUS_L_GRAM_USAGE_TOTAL_CANCELED_COUNT = 'M', GLOBUS_L_GRAM_USAGE_TOTAL_DONE_COUNT = 'N', GLOBUS_L_GRAM_USAGE_TOTAL_DRYRUN_COUNT = 'O', GLOBUS_L_GRAM_USAGE_PEAK_JOB_COUNT = 'P', GLOBUS_L_GRAM_USAGE_CURRENT_JOB_COUNT = 'Q', GLOBUS_L_GRAM_USAGE_UNSUBMITTED_JOB_COUNT = 'R', GLOBUS_L_GRAM_USAGE_STAGE_IN_JOB_COUNT = 'S', GLOBUS_L_GRAM_USAGE_PENDING_JOB_COUNT = 'T', GLOBUS_L_GRAM_USAGE_ACTIVE_JOB_COUNT = 'U', GLOBUS_L_GRAM_USAGE_STAGE_OUT_JOB_COUNT = 'V', GLOBUS_L_GRAM_USAGE_FAILED_JOB_COUNT = 'W', GLOBUS_L_GRAM_USAGE_DONE_JOB_COUNT = 'X', /* per job tags */ /* GLOBUS_L_GRAM_USAGE_SESSION_ID */ GLOBUS_L_GRAM_USAGE_DRYRUN = 'a', GLOBUS_L_GRAM_USAGE_HOST_COUNT = 'b', GLOBUS_L_GRAM_USAGE_UNSUBMITTED_TS = 'c', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_TS = 'd', GLOBUS_L_GRAM_USAGE_PENDING_TS = 'e', GLOBUS_L_GRAM_USAGE_ACTIVE_TS = 'f', GLOBUS_L_GRAM_USAGE_FAILED_TS = 'g', GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_TS = 'h', GLOBUS_L_GRAM_USAGE_DONE_TS = 'i', GLOBUS_L_GRAM_USAGE_FAILURE_CODE = 'j', GLOBUS_L_GRAM_USAGE_STATUS_COUNT = 'k', GLOBUS_L_GRAM_USAGE_REGISTER_COUNT = 'l', GLOBUS_L_GRAM_USAGE_SIGNAL_COUNT = 'm', GLOBUS_L_GRAM_USAGE_REFRESH_COUNT = 'n', GLOBUS_L_GRAM_USAGE_FILE_CLEAN_UP_COUNT = 'o', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_HTTP_COUNT = 'p', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_HTTPS_COUNT = 'q', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_FTP_COUNT = 'r', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_GSIFTP_COUNT = 's', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_SHARED_HTTP_COUNT = 't', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_SHARED_HTTPS_COUNT = 'u', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_SHARED_FTP_COUNT = 'v', GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_SHARED_GSIFTP_COUNT = 'w', GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_HTTP_COUNT = 'x', GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_HTTPS_COUNT = 'y', GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_FTP_COUNT = 'z', GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_GSIFTP_COUNT = '0', GLOBUS_L_GRAM_USAGE_RSL_BITMASK = '1', GLOBUS_L_GRAM_USAGE_UNREGISTER_COUNT = '2', GLOBUS_L_GRAM_USAGE_COUNT = '3', GLOBUS_L_GRAM_USAGE_RSL_ATTRIBUTES = '4', GLOBUS_L_GRAM_USAGE_RESTART_COUNT = 'Y', GLOBUS_L_GRAM_USAGE_CALLBACK_COUNT = 'Z', GLOBUS_L_GRAM_USAGE_JOBTYPE = 'H', GLOBUS_L_GRAM_USAGE_EXEC_NAME /* */ = '6', GLOBUS_L_GRAM_USAGE_EXEC_ARGS /* */ = '7', GLOBUS_L_GRAM_USAGE_CLIENT_IP /* */ = '8', GLOBUS_L_GRAM_USAGE_USER_DN /* */ = '9', /* !! ADD to ALL_TAGLIST above when adding here */ } globus_l_gram_usage_tag_t; const char * globus_l_gram_rsl_attribute_ids[] = { /* Order must match the SQL definition (begins at 1) */ NULL, GLOBUS_GRAM_PROTOCOL_DIR_PARAM, GLOBUS_GRAM_PROTOCOL_EXECUTABLE_PARAM, GLOBUS_GRAM_PROTOCOL_ARGUMENTS_PARAM, GLOBUS_GRAM_PROTOCOL_STDIN_PARAM, GLOBUS_GRAM_PROTOCOL_STDOUT_PARAM, GLOBUS_GRAM_PROTOCOL_STDERR_PARAM, GLOBUS_GRAM_PROTOCOL_COUNT_PARAM, GLOBUS_GRAM_PROTOCOL_ENVIRONMENT_PARAM, GLOBUS_GRAM_PROTOCOL_MAX_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_MAX_WALL_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_MAX_CPU_TIME_PARAM, GLOBUS_GRAM_PROTOCOL_JOB_TYPE_PARAM, GLOBUS_GRAM_PROTOCOL_MYJOB_PARAM, GLOBUS_GRAM_PROTOCOL_QUEUE_PARAM, GLOBUS_GRAM_PROTOCOL_PROJECT_PARAM, GLOBUS_GRAM_PROTOCOL_HOST_COUNT_PARAM, GLOBUS_GRAM_PROTOCOL_DRY_RUN_PARAM, GLOBUS_GRAM_PROTOCOL_MIN_MEMORY_PARAM, GLOBUS_GRAM_PROTOCOL_MAX_MEMORY_PARAM, GLOBUS_GRAM_PROTOCOL_SAVE_STATE_PARAM, GLOBUS_GRAM_PROTOCOL_TWO_PHASE_COMMIT_PARAM, GLOBUS_GRAM_PROTOCOL_REMOTE_IO_URL_PARAM, GLOBUS_GRAM_PROTOCOL_SCRATCHDIR_PARAM, "rslsubstitution", GLOBUS_GRAM_PROTOCOL_RESTART_PARAM, GLOBUS_GRAM_PROTOCOL_STDOUT_POSITION_PARAM, GLOBUS_GRAM_PROTOCOL_STDERR_POSITION_PARAM, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_PARAM, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_SHARED_PARAM, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_OUT_PARAM, GLOBUS_GRAM_PROTOCOL_FILE_CLEANUP_PARAM, GLOBUS_GRAM_PROTOCOL_GASS_CACHE_PARAM, GLOBUS_GRAM_PROTOCOL_PROXY_TIMEOUT_PARAM, "librarypath", GLOBUS_GRAM_PROTOCOL_USER_NAME }; #define GLOBUS_L_GRAM_TOTAL_ATTRS \ (sizeof(globus_l_gram_rsl_attribute_ids) / \ sizeof(globus_l_gram_rsl_attribute_ids[0])) typedef struct globus_l_gram_usage_ent_s { globus_usage_stats_handle_t jm_handle; globus_usage_stats_handle_t job_handle; char * target; char * job_taglist; char * session_taglist; } globus_l_gram_usage_ent_t; void globus_i_gram_send_job_failure_stats( globus_gram_job_manager_t * manager, int rc) { globus_gram_jobmanager_request_t request; /* Make something that looks kinda like a request */ memset(&request, 0, sizeof(globus_gram_jobmanager_request_t)); request.status = GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED; request.config = manager->config; request.manager = manager; request.failure_code = rc; GlobusTimeAbstimeGetCurrent(request.job_stats.failed_timestamp); globus_i_gram_send_job_stats(&request); } void globus_i_gram_send_job_stats( globus_gram_jobmanager_request_t * request) { globus_result_t result; globus_list_t * list; globus_l_gram_usage_ent_t * usage_ent; char * keys[GLOBUS_L_GRAM_MAX_TAGCOUNT]; char * values[GLOBUS_L_GRAM_MAX_TAGCOUNT]; char * ptr; char * key; char keystr[2]; char valstr[2048]; char * value; int i = 0; char * save_taglist = NULL; const char * rsl_str; char * p; globus_list_t * attributes; int rc; uint64_t rsl_attributes_bitfield; int attrindex; if(globus_l_gram_usage_handle_list == NULL) { return; } for(list = globus_l_gram_usage_handle_list; !globus_list_empty(list); list = globus_list_rest(list)) { usage_ent = (globus_l_gram_usage_ent_t *) globus_list_first(list); if(!usage_ent || usage_ent->job_handle == NULL) { continue; } if(save_taglist == NULL || strcmp(save_taglist, usage_ent->job_taglist) != 0) { save_taglist = usage_ent->job_taglist; keystr[1] = 0; ptr = usage_ent->job_taglist; if (i > 0) { for (--i; i >= 0; i--) { if (keys[i] != NULL) { free(keys[i]); keys[i] = NULL; } if (values[i] != NULL) { free(values[i]); values[i] = NULL; } } } i = 0; while(ptr && *ptr) { value = NULL; switch(*ptr) { case GLOBUS_L_GRAM_USAGE_SESSION_ID: keystr[0] = *ptr; key = keystr; value = request->manager->usagetracker->jm_id; break; case GLOBUS_L_GRAM_USAGE_EXEC_NAME: rc = globus_gram_job_manager_rsl_attribute_get_string_value( request->rsl, "executable", &rsl_str); if(rc == 0) { value = (char *) rsl_str; } keystr[0] = *ptr; key = keystr; break; case GLOBUS_L_GRAM_USAGE_RSL_BITMASK: keystr[0] = *ptr; key = keystr; rsl_attributes_bitfield = 0; for (attrindex = 1; attrindex < GLOBUS_L_GRAM_TOTAL_ATTRS; attrindex++) { if (globus_gram_job_manager_rsl_attribute_exists( request->rsl, globus_l_gram_rsl_attribute_ids[attrindex])) { rsl_attributes_bitfield |= (1 << attrindex); } } snprintf(valstr, sizeof(valstr), "%"PRIu64, rsl_attributes_bitfield); value = valstr; break; case GLOBUS_L_GRAM_USAGE_RSL_ATTRIBUTES: keystr[0] = *ptr; key = keystr; attributes = globus_rsl_boolean_get_operand_list( request->rsl); p = valstr; p[0] = 0; while (!globus_list_empty(attributes)) { globus_rsl_t * attr; char * attr_name; attr = globus_list_first(attributes); attributes = globus_list_rest(attributes); if (!globus_rsl_is_relation(attr)) { continue; } attr_name = globus_rsl_relation_get_attribute(attr); for (attrindex = 1; attrindex < GLOBUS_L_GRAM_TOTAL_ATTRS; attrindex++) { if (strcmp(attr_name, globus_l_gram_rsl_attribute_ids[attrindex]) == 0) { break; } } if (attrindex == GLOBUS_L_GRAM_TOTAL_ATTRS) { /* Skip internal RSL hooks */ if (strcmp(attr_name, "filestreamout") == 0 || strcmp(attr_name, "restartcontacts") == 0) { continue; } p += snprintf(p, sizeof(valstr) - (p - valstr), "%s,", attr_name); } } if (p > valstr) { *(--p) = 0; } value = valstr; if (*value == 0) { value = 0; } break; case GLOBUS_L_GRAM_USAGE_EXEC_ARGS: attributes = globus_rsl_boolean_get_operand_list( request->rsl); while (!globus_list_empty(attributes)) { globus_rsl_t * attr; char * attr_name; attr = globus_list_first(attributes); attributes = globus_list_rest(attributes); if (!globus_rsl_is_relation(attr)) { continue; } attr_name = globus_rsl_relation_get_attribute(attr); if (strcmp( attr_name, GLOBUS_GRAM_PROTOCOL_ARGUMENTS_PARAM) == 0) { value = globus_rsl_value_unparse( globus_rsl_relation_get_value_sequence(attr)); strncpy(valstr, value, sizeof(valstr)); free(value); value = valstr; break; } } keystr[0] = *ptr; break; case GLOBUS_L_GRAM_USAGE_CLIENT_IP: keystr[0] = *ptr; key = keystr; value = request->job_stats.client_address; break; case GLOBUS_L_GRAM_USAGE_USER_DN: keystr[0] = *ptr; key = keystr; value = request->job_stats.user_dn; break; case GLOBUS_L_GRAM_USAGE_DRYRUN: keystr[0] = *ptr; key = keystr; value = request->dry_run ? "1" : "0"; break; case GLOBUS_L_GRAM_USAGE_COUNT: globus_gram_job_manager_rsl_attribute_get_string_value( request->rsl, "count", &rsl_str); if(rc == 0) { value = (char *) rsl_str; } keystr[0] = *ptr; key = keystr; break; case GLOBUS_L_GRAM_USAGE_HOST_COUNT: rc = globus_gram_job_manager_rsl_attribute_get_string_value( request->rsl, "hostcount", &rsl_str); if(rc == 0) { value = (char *) rsl_str; } keystr[0] = *ptr; key = keystr; break; case GLOBUS_L_GRAM_USAGE_UNSUBMITTED_TS: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%ld.%09ld", request->job_stats.unsubmitted_timestamp.tv_sec, request->job_stats.unsubmitted_timestamp.tv_nsec); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_TS: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%ld.%09ld", request->job_stats.file_stage_in_timestamp.tv_sec, request->job_stats.file_stage_in_timestamp.tv_nsec); value = valstr; break; case GLOBUS_L_GRAM_USAGE_PENDING_TS: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%ld.%09ld", request->job_stats.pending_timestamp.tv_sec, request->job_stats.pending_timestamp.tv_nsec); value = valstr; break; case GLOBUS_L_GRAM_USAGE_ACTIVE_TS: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%ld.%09ld", request->job_stats.active_timestamp.tv_sec, request->job_stats.active_timestamp.tv_nsec); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FAILED_TS: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%ld.%09ld", request->job_stats.failed_timestamp.tv_sec, request->job_stats.failed_timestamp.tv_nsec); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_TS: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%ld.%09ld", request->job_stats.file_stage_out_timestamp.tv_sec, request-> job_stats.file_stage_out_timestamp.tv_nsec); value = valstr; break; case GLOBUS_L_GRAM_USAGE_DONE_TS: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%ld.%09ld", request->job_stats.done_timestamp.tv_sec, request-> job_stats.done_timestamp.tv_nsec); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FAILURE_CODE: snprintf(valstr, sizeof(valstr), "%d", request->failure_code); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_STATUS_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.status_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_REGISTER_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.register_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_UNREGISTER_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.unregister_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_SIGNAL_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.signal_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_REFRESH_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.refresh_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_CLEAN_UP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.file_clean_up_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_HTTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.file_stage_in_http_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_HTTPS_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.file_stage_in_https_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_FTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.file_stage_in_ftp_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_GSIFTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.file_stage_in_gsiftp_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_SHARED_HTTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request->job_stats.file_stage_in_shared_http_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_SHARED_HTTPS_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.file_stage_in_shared_https_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_SHARED_FTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.file_stage_in_shared_ftp_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_IN_SHARED_GSIFTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.file_stage_in_shared_gsiftp_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_HTTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.file_stage_out_http_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_HTTPS_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.file_stage_out_https_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_FTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.file_stage_out_ftp_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_FILE_STAGE_OUT_GSIFTP_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.file_stage_out_gsiftp_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_RESTART_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.restart_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_CALLBACK_COUNT: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d", request-> job_stats.callback_count); value = valstr; break; case GLOBUS_L_GRAM_USAGE_JOBTYPE: rc = globus_gram_job_manager_rsl_attribute_get_string_value( request->rsl, "jobtype", &rsl_str); if(rc == 0) { value = (char *) rsl_str; } keystr[0] = *ptr; key = keystr; break; default: key = NULL; value = NULL; break; } if(key != NULL && value != NULL) { keys[i] = strdup(key); values[i] = strdup(value); i++; } ptr++; } } result = globus_usage_stats_send_array( usage_ent->job_handle, i, keys, values); } if (i > 0) { for (--i; i >= 0; i--) { if (keys[i] != NULL) { free(keys[i]); keys[i] = NULL; } if (values[i] != NULL) { free(values[i]); values[i] = NULL; } } } return; } void globus_i_gram_send_session_stats( globus_gram_job_manager_t * manager) { globus_result_t result; globus_list_t * list; globus_l_gram_usage_ent_t * usage_ent; char * keys[GLOBUS_L_GRAM_MAX_TAGCOUNT]; char * values[GLOBUS_L_GRAM_MAX_TAGCOUNT]; char * ptr; char * key; char keystr[2]; char valstr[2048]; char * value; int i = 0; char * save_taglist = NULL; int rc; globus_abstime_t now; static globus_abstime_t last_report = {0, 0}; globus_i_gram_usage_tracker_t * tracker; int count_pending = 0; int count_active = 0; int count_failed = 0; int count_done = 0; int count_unsubmitted = 0; int count_stage_in = 0; int count_stage_out = 0; globus_gram_job_manager_ref_t * ref; GlobusTimeAbstimeGetCurrent(now); tracker = manager->usagetracker; if(globus_l_gram_usage_handle_list == NULL) { return; } if(tracker->jm_id == NULL) { globus_uuid_t uuid; rc = globus_uuid_create(&uuid); if(rc == GLOBUS_SUCCESS) { tracker->jm_id = strdup(uuid.text); } } if (last_report.tv_sec >= now.tv_sec) { /* Too soon! */ return; } last_report.tv_sec = now.tv_sec; last_report.tv_nsec = now.tv_nsec; for (ref = globus_hashtable_first(&manager->request_hash); ref != NULL; ref = globus_hashtable_next(&manager->request_hash)) { switch(ref->job_state) { case GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING: count_pending++; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE: count_active++; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED: count_failed++; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE: count_done++; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_UNSUBMITTED: count_unsubmitted++; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_IN: count_stage_in++; break; case GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT: count_stage_out++; break; default: break; } } for(list = globus_l_gram_usage_handle_list; !globus_list_empty(list); list = globus_list_rest(list)) { usage_ent = (globus_l_gram_usage_ent_t *) globus_list_first(list); if(!usage_ent || usage_ent->jm_handle == NULL) { continue; } if(save_taglist == NULL || strcmp(save_taglist, usage_ent->session_taglist) != 0) { save_taglist = usage_ent->session_taglist; keystr[1] = 0; ptr = usage_ent->session_taglist; if (i > 0) { for (--i; i >= 0; i--) { if (keys[i]) { free(keys[i]); keys[i] = NULL; } if (values[i]) { free(values[i]); values[i] = NULL; } } } i = 0; while(ptr && *ptr) { switch(*ptr) { case GLOBUS_L_GRAM_USAGE_SESSION_ID: keystr[0] = *ptr; key = keystr; value = tracker->jm_id; break; case GLOBUS_L_GRAM_USAGE_JM_STARTTIME: snprintf(valstr, sizeof(valstr), "%ld.%06ld", tracker->jm_start_time.tv_sec, tracker->jm_start_time.tv_nsec/1000); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_STATUS__TIME: snprintf(valstr, sizeof(valstr), "%ld.%06ld", now.tv_sec, now.tv_nsec/1000); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_VERSION: keystr[0] = *ptr; key = keystr; snprintf(valstr, sizeof(valstr), "%d.%d (%s, %lu-%d) [%s]", local_version.major, local_version.minor, GLOBUS_FLAVOR_NAME, local_version.timestamp, local_version.branch_id, manager->config->globus_version ? manager->config->globus_version : "unknown"); value = valstr; break; case GLOBUS_L_GRAM_USAGE_LRM: keystr[0] = *ptr; key = keystr; value = manager->config->jobmanager_type; break; case GLOBUS_L_GRAM_USAGE_POLL_USED: keystr[0] = *ptr; key = keystr; value = manager->config->seg_module ? "0" : "1" ; break; case GLOBUS_L_GRAM_USAGE_AUDIT_USED: keystr[0] = *ptr; key = keystr; value = manager->config->auditing_dir ? "1" : "0"; break; case GLOBUS_L_GRAM_USAGE_RESTARTED_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", tracker->count_restarted); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_TOTAL_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", tracker->count_total_failed + tracker->count_total_done); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_TOTAL_FAILED_COUNT: snprintf(valstr, sizeof(valstr), "%d", tracker->count_total_failed); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_TOTAL_CANCELED_COUNT: snprintf(valstr, sizeof(valstr), "%d", tracker->count_total_canceled); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_TOTAL_DONE_COUNT: snprintf(valstr, sizeof(valstr), "%d", tracker->count_total_done); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_TOTAL_DRYRUN_COUNT: snprintf(valstr, sizeof(valstr), "%d", tracker->count_dryrun); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_PEAK_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", tracker->count_peak_jobs); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_CURRENT_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", tracker->count_current_jobs); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_UNSUBMITTED_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", count_unsubmitted); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_STAGE_IN_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", count_stage_in); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_PENDING_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", count_pending); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_ACTIVE_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", count_active); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_STAGE_OUT_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", count_stage_out); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_FAILED_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", count_failed); keystr[0] = *ptr; key = keystr; value = valstr; break; case GLOBUS_L_GRAM_USAGE_DONE_JOB_COUNT: snprintf(valstr, sizeof(valstr), "%d", count_done); keystr[0] = *ptr; key = keystr; value = valstr; break; default: key = NULL; value = NULL; break; } if(key != NULL && value != NULL) { keys[i] = strdup(key); values[i] = strdup(value); i++; } ptr++; } } result = globus_usage_stats_send_array( usage_ent->jm_handle, i, keys, values); } if (i > 0) { for (--i; i >= 0; i--) { if (keys[i]) { free(keys[i]); keys[i] = NULL; } if (values[i]) { free(values[i]); values[i] = NULL; } } } return; } /* globus_i_gram_send_session_stats() */ static void globus_l_gram_usage_parse_target( char * target) { char * ptr; globus_l_gram_usage_ent_t * usage_ent; char * entry = NULL; char * conf_taglist = NULL; usage_ent = (globus_l_gram_usage_ent_t *) globus_malloc(sizeof(globus_l_gram_usage_ent_t)); if(target && *target) { entry = globus_libc_strdup(target); } if(entry && (ptr = strchr(entry, '!')) != NULL) { *ptr = '\0'; conf_taglist = ptr + 1; } if(conf_taglist == NULL || strcasecmp(conf_taglist, "default") == 0) { usage_ent->job_taglist = globus_libc_strdup(GLOBUS_L_GRAM_DEFAULT_JOB_TAGLIST); usage_ent->session_taglist = globus_libc_strdup(GLOBUS_L_GRAM_DEFAULT_SESSION_TAGLIST); } else if(strcasecmp(conf_taglist, "all") == 0) { usage_ent->job_taglist = globus_libc_strdup( GLOBUS_L_GRAM_DEFAULT_JOB_TAGLIST GLOBUS_L_GRAM_PRIVATE_JOB_TAGLIST); usage_ent->session_taglist = globus_libc_strdup( GLOBUS_L_GRAM_DEFAULT_SESSION_TAGLIST GLOBUS_L_GRAM_PRIVATE_SESSION_TAGLIST); } else { usage_ent->job_taglist = globus_libc_strdup(conf_taglist); usage_ent->session_taglist = globus_libc_strdup(conf_taglist); } usage_ent->target = entry; globus_list_insert(&globus_l_gram_usage_handle_list, usage_ent); return; } globus_result_t globus_i_gram_usage_stats_destroy( globus_gram_job_manager_t * manager) { return GLOBUS_SUCCESS; } globus_result_t globus_i_gram_usage_stats_init( globus_gram_job_manager_t * manager) { globus_result_t result; char * target_str; char * ptr; char * target; globus_list_t * list; globus_l_gram_usage_ent_t * usage_ent; if(manager->config->usage_disabled) { return GLOBUS_SUCCESS; } globus_module_activate(GLOBUS_USAGE_MODULE); target_str = globus_libc_strdup(manager->config->usage_targets); target = target_str; ptr = NULL; while(target != NULL && (ptr = strchr(target, ',')) != NULL) { *ptr = '\0'; globus_l_gram_usage_parse_target(target); target = ptr + 1; } if(ptr == NULL) { globus_l_gram_usage_parse_target(target); } for(list = globus_l_gram_usage_handle_list; !globus_list_empty(list); list = globus_list_rest(list)) { usage_ent = (globus_l_gram_usage_ent_t *) globus_list_first(list); usage_ent->jm_handle = NULL; usage_ent->job_handle = NULL; result = globus_usage_stats_handle_init( &usage_ent->jm_handle, GLOBUS_L_GRAM_JM_USAGE_ID, GLOBUS_L_GRAM_JM_USAGE_VER, usage_ent->target); result = globus_usage_stats_handle_init( &usage_ent->job_handle, GLOBUS_L_GRAM_JOB_USAGE_ID, GLOBUS_L_GRAM_JOB_USAGE_VER, usage_ent->target); } if(target_str) { globus_free(target_str); } return result; } /* globus_i_gram_usage_stats_init() */ /** * Periodic usage stats callback implementation * * @param user_arg * Job manager state cast to void *. * * @return * void */ static void globus_l_gram_kickout_session_stats( void * user_arg) { globus_i_gram_send_session_stats( (globus_gram_job_manager_t *) user_arg); } /* globus_l_gram_kickout_session_stats() */ /** * Start sending periodic job manager session statistics to the usage stats * service * * @param manager * Job manager state. * * @return * Result of registering a callback handler to periodically send * usage stats reports. */ globus_result_t globus_i_gram_usage_start_session_stats( globus_gram_job_manager_t * manager) { globus_result_t result; globus_reltime_t delay; if(manager->config->usage_disabled) { return GLOBUS_SUCCESS; } globus_i_gram_send_session_stats(manager); GlobusTimeReltimeSet(delay, 60*60, 0); result = globus_callback_register_periodic( &manager->usagetracker->session_timer_handle, &delay, &delay, globus_l_gram_kickout_session_stats, manager); return result; } /* globus_i_gram_usage_start_session_stats() */ /** * Unregister the job status callbacks and send a final callback * * @param manager * Job manager state. * * @return * Result of unregistering the callback handle associated the * periodic job manager usage stats reports. */ globus_result_t globus_i_gram_usage_end_session_stats( globus_gram_job_manager_t * manager) { globus_result_t result; if(manager->config->usage_disabled) { return GLOBUS_SUCCESS; } result = globus_callback_unregister( manager->usagetracker->session_timer_handle, NULL, NULL, NULL); globus_i_gram_send_session_stats(manager); return result; } /* globus_i_gram_usage_end_session_stats() */ globus_gram_job_manager-13.53/config.sub0000755000076400007640000007305511312032604015270 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-06-18' # 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., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, 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 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 0;; * ) 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* | freebsd*-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) 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] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) 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-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | 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-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | 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-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # 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 ;; 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 ;; 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 ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; 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 ;; 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 ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; 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 ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; 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 ;; 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 ;; 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 ;; 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 ;; 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 ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-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* | -netbsd* | -openbsd* | -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* | -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*) # 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* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -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 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -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 ;; -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 ;; -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 ;; *-ibm) os=-aix ;; *-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 ;; -ptx*) vendor=sequent ;; -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 0 # 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_gram_job_manager-13.53/Makefile.am0000666000076400007640000001003111714563237015347 00000000000000include $(top_srcdir)/globus_automake_pre include $(top_srcdir)/globus_automake_pre_top SUBDIRS= pkgdata doxygen rvf scripts seg # Extra directories we install files into validationdir = $(datadir)/globus/$(PACKAGE) ## globusconfig = [ DATA ] globusconfigdir = ${sysconfdir}/globus globusconfig_DATA = globus-gram-job-manager.conf logrotatedir = ${sysconfdir}/logrotate.d # Where targets are installed noinst_LTLIBRARIES = libglobus_gram_job_manager.la sbin_PROGRAMS = globus-job-manager globus-gram-streamer globus-job-manager-lock-test bin_SCRIPTS = globus-personal-gatekeeper validation_DATA = globus-gram-job-manager.rvf # Mapping of source files to libraries and executables libglobus_gram_job_manager_la_SOURCES = \ globus_gram_job_manager.h \ globus_gram_job_manager_config.c \ globus_gram_job_manager.c \ globus_gram_job_manager_auditing.c \ globus_gram_job_manager_contact.c \ globus_gram_job_manager_gsi.c \ globus_gram_job_manager_history_file.c \ globus_gram_job_manager_query.c \ globus_gram_job_manager_request.c \ globus_gram_job_manager_rsl.c \ globus_gram_job_manager_script.c \ globus_gram_job_manager_seg.c \ globus_gram_job_manager_staging.c \ globus_gram_job_manager_state.c \ globus_gram_job_manager_state_file.c \ globus_gram_job_manager_validate.c \ globus_gram_job_manager_usagestats.c \ logging.c \ startup_socket.c \ tg_gateway.c globus_job_manager_SOURCES = main.c globus_job_manager_lock_test_SOURCES = lock_test.c # Compiler flags INCLUDES = $(GPT_INCLUDES) -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/rvf $(XML_CPPFLAGS) globus_job_manager_LDFLAGS = $(GPT_LDFLAGS) globus_job_manager_LDADD = \ ./libglobus_gram_job_manager.la \ ./rvf/libglobus_rvf.la \ $(GPT_PGM_LINKS) $(XML_LIBS) globus_gram_streamer_LDFLAGS = $(GPT_LDFLAGS) globus_gram_streamer_LDADD = \ ./libglobus_gram_job_manager.la \ ./rvf/libglobus_rvf.la \ $(GPT_PGM_LINKS) $(XML_LIBS) ## man1dir = [ DOC ] man1_MANS = globus-personal-gatekeeper.1 ## man3dir = [ DOC ] man8_MANS = globus-job-manager.8 ## man8dir = [ DOC ] man5_MANS = rsl.5 MANUAL_SOURCE = globus-personal-gatekeeper-manual.xml \ globus-job-manager-manual.xml \ manual.xml \ rsl.xml doc_DATA = GLOBUS_LICENSE # Files which we want to put in the source package EXTRA_DIST = globus-personal-gatekeeper.in \ $(validation_DATA) \ version.h.in \ configuration.dox \ globus_gram_job_manager_rsl.dox \ globus_gram_job_manager_script_interface.dox \ globus_gram_job_manager_script_tutorial.dox \ globus_job_manager_rsl_validation.dox \ job_execution_environment.dox \ $(MANUAL_SOURCE) \ $(man1_MANS) \ $(man5_MANS) \ $(man8_MANS) \ $(doc_DATA) \ main.dox \ dirt.sh \ globus-gram-job-manager.conf.in \ gram.logrotate.in \ libxml.m4 all: $(BUILT_SOURCES) globus_gram_job_manager_rsl.dox: globus-gram-job-manager.rvf perl $(top_srcdir)/scripts/create_rsl_documentation.pl < $< > $@ rsl.xml: globus-gram-job-manager.rvf perl $(top_srcdir)/scripts/create_rsl_documentation.pl -x < $< > $@ install-data-hook: mkdir -p $(DESTDIR)$(localstatedir)/lib/globus/gram_job_state chmod 1777 $(DESTDIR)$(localstatedir)/lib/globus/gram_job_state mkdir -p $(DESTDIR)$(logrotatedir) cp $(srcdir)/gram.logrotate $(DESTDIR)$(logrotatedir)/globus-job-manager mkdir -p $(DESTDIR)@LOGDIR@ chmod 1777 $(DESTDIR)@LOGDIR@ mkdir -p $(DESTDIR)$(sysconfdir)/globus/gram CLEANFILES = \ globus-personal-gatekeeper \ globus_gram_job_manager_rsl.dox if GENERATE_MANPAGES export XML_CATALOG_FILES := $(XML_CATALOG_PATH) $(man1_MANS) $(man5_MANS) $(man8_MANS): $(MANUAL_SOURCE) $(XMLLINT) --xinclude --dtdvalid http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd manual.xml > /dev/null $(XSLTPROC) --xinclude http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl manual.xml endif include $(top_srcdir)/globus_automake_post include $(top_srcdir)/globus_automake_post_top globus_gram_job_manager-13.53/globus_gram_job_manager_state_file.c0000666000076400007640000006415111763661603022517 00000000000000/* * Copyright 1999-2009 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_gram_job_manager.h" #include /** * Compute the name of the state file to use for this job request. * * Sets the value of the @a job_state_file member of the request structure. * * @param request * The request to create the state file for. * @param state_file * Pointer to set to the state file string. The caller is responsible for * freeing this. * * @retval GLOBUS_SUCCESS * Success. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Malloc failed. */ int globus_gram_job_manager_state_file_set( globus_gram_jobmanager_request_t * request, char ** state_file) { int rc = GLOBUS_SUCCESS; *state_file = globus_common_create_string( "%s/job.%s.%s", request->config->job_state_file_dir, request->config->hostname, request->uniq_id); if (*state_file == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto create_state_file_failed; } if ((access(*state_file, R_OK) != 0) && errno == ENOENT) { char * dirname_end; /* If it doesn't exist yet, we'll use a per-user state file dir * to reduce the size of the global state file dir (GT-157) */ free(*state_file); *state_file = globus_common_create_string( "%s/%s/%s/%s/job.%s", request->config->job_state_file_dir, request->config->logname, request->config->service_tag, request->config->jobmanager_type, request->uniq_id); if (*state_file == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto create_state_file_failed; } dirname_end = strrchr(*state_file, '/'); *dirname_end = '\0'; globus_i_gram_mkdir(*state_file); *dirname_end = '/'; } create_state_file_failed: return rc; } /* globus_gram_job_manager_state_file_set() */ int globus_gram_job_manager_state_file_write( globus_gram_jobmanager_request_t * request) { int rc = GLOBUS_SUCCESS; FILE * fp = NULL; char tmp_file[1024] = { 0 }; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.write_state_file.start " "level=TRACE " "gramid=%s " "path=\"%s\" " "\n", request->job_contact_path, request->job_state_file); /* * We want the file update to be atomic, so create a new temp file, * write the new information, close the new file, then rename the new * file on top of the old one. The rename is the atomic update action. */ strcpy( tmp_file, request->job_state_file ); strcat( tmp_file, ".tmp" ); fp = fopen( tmp_file, "w" ); if ( fp == NULL ) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_STATE_FILE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.write_state_file.end " "level=ERROR " "gramid=%s " "path=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", request->job_contact_path, tmp_file, -rc, "Error opening state file", errno, strerror(errno)); return rc; } rc = fprintf(fp, "%s\n", request->job_contact ? request->job_contact : " "); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_STATE_FILE; goto error_exit; } rc = fprintf(fp, "%4d\n", (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) ? (int) request->restart_state : (int) request->jobmanager_state); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%4d\n", (int) request->status); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%4d\n", request->failure_code); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n", request->job_id_string ? request->job_id_string : " "); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n", request->rsl_spec); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n", request->cache_tag); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n", request->config->jobmanager_type); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%d\n", request->two_phase_commit); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n", request->scratchdir ? request->scratchdir : " "); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%lu\n", (unsigned long) request->seg_last_timestamp); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%lu\n", (unsigned long) request->creation_time); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%lu\n", (unsigned long) request->queued_time); if (rc < 0) { goto error_exit; } rc = globus_gram_job_manager_staging_write_state(request, fp); if (rc < 0) { goto error_exit; } rc = globus_gram_job_manager_write_callback_contacts(request, fp); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n", request->gateway_user ? request->gateway_user : " "); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%d\n", request->exit_code); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%ld.%09ld %ld.%09ld %ld.%09ld " "%ld.%09ld %ld.%09ld %ld.%09ld %ld.%09ld " "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", request->job_stats.unsubmitted_timestamp.tv_sec, request->job_stats.unsubmitted_timestamp.tv_nsec, request->job_stats.file_stage_in_timestamp.tv_sec, request->job_stats.file_stage_in_timestamp.tv_nsec, request->job_stats.pending_timestamp.tv_sec, request->job_stats.pending_timestamp.tv_nsec, request->job_stats.active_timestamp.tv_sec, request->job_stats.active_timestamp.tv_nsec, request->job_stats.failed_timestamp.tv_sec, request->job_stats.failed_timestamp.tv_nsec, request->job_stats.file_stage_out_timestamp.tv_sec, request->job_stats.file_stage_out_timestamp.tv_nsec, request->job_stats.done_timestamp.tv_sec, request->job_stats.done_timestamp.tv_nsec, request->job_stats.restart_count, request->job_stats.callback_count, request->job_stats.status_count, request->job_stats.register_count, request->job_stats.unregister_count, request->job_stats.signal_count, request->job_stats.refresh_count, request->job_stats.file_clean_up_count, request->job_stats.file_stage_in_http_count, request->job_stats.file_stage_in_https_count, request->job_stats.file_stage_in_ftp_count, request->job_stats.file_stage_in_gsiftp_count, request->job_stats.file_stage_in_shared_http_count, request->job_stats.file_stage_in_shared_https_count, request->job_stats.file_stage_in_shared_ftp_count, request->job_stats.file_stage_in_shared_gsiftp_count, request->job_stats.file_stage_out_http_count, request->job_stats.file_stage_out_https_count, request->job_stats.file_stage_out_ftp_count, request->job_stats.file_stage_out_gsiftp_count); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n%s\n", request->job_stats.client_address ? request->job_stats.client_address : " ", request->job_stats.user_dn ? request->job_stats.user_dn : " "); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%4d\n", (int) request->expected_terminal_state); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n", request->config->service_tag); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%s\n", request->original_job_id_string ? request->original_job_id_string : ""); if (rc < 0) { goto error_exit; } rc = fprintf(fp, "%d\n", request->job_log_level); if (rc < 0) { goto error_exit; } /* * On some filsystems, write + rename is *not* atomic, so we explicitly * flush to disk here. fdatasync might be better, but only on systems with * POSIX realtime extensions */ fflush(fp); fsync(fileno(fp)); fclose( fp ); fp = NULL; rc = rename( tmp_file, request->job_state_file ); if (rc != 0) { rc = GLOBUS_FAILURE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.write_state_file.end " "level=ERROR " "gramid=%s " "path=%s " "status=-1 " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, request->job_state_file, "Error renaming temporary state file", errno, strerror(errno)); goto rename_failed; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.write_state_file.end " "level=TRACE " "gramid=%s " "path=%s " "status=0 " "\n", request->job_contact_path, request->job_state_file); return GLOBUS_SUCCESS; error_exit: globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.write_state_file.end " "level=ERROR " "gramid=%s " "path=\"%s\" " "status=%d " "msg=\"%s\"\n", request->job_contact_path, tmp_file, rc, "Error writing to state file"); if (fp) { fclose(fp); } rename_failed: if (tmp_file[0] != 0) { remove(tmp_file); } return rc; } /* globus_gram_job_manager_state_file_write() */ int globus_gram_job_manager_state_file_read( globus_gram_jobmanager_request_t * request) { FILE * fp; char * buffer = NULL; size_t file_len; struct stat statbuf; int rc = GLOBUS_SUCCESS; int i; unsigned long tmp_timestamp; request->old_job_contact = NULL; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.state_file_read.start " "level=TRACE " "gramid=%s " "path=%s " "\n", request->job_contact_path, request->job_state_file); if (stat(request->job_state_file, &statbuf) != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_STATE_FILE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.state_file_read.end " "level=ERROR " "gramid=%s " "path=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, request->job_state_file, "Error checking file status", -rc, errno, strerror(errno)); return rc; } if (statbuf.st_uid != getuid()) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_STATE_FILE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.state_file_read.end " "level=ERROR " "gramid=%s " "path=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, request->job_state_file, "State file not owned by me", -rc, errno, strerror(errno)); return rc; } file_len = (size_t) statbuf.st_size; buffer = malloc(file_len+1); if (buffer == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.state_file_read.end " "level=ERROR " "gramid=%s " "path=%s " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", request->job_contact_path, request->job_state_file, "Malloc failed", -rc, errno, strerror(errno)); goto exit; } fp = fopen( request->job_state_file, "r" ); if(!fp) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_STATE_FILE; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.state_file.read.end " "level=ERROR " "path=%s " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", request->job_state_file, -rc, "Error opening state file", errno, strerror(errno)); goto fopen_state_file_failed; } if(fgets( buffer, file_len, fp ) == NULL) { goto error_exit; } /* job contact string */ if (fgets( buffer, file_len, fp ) == NULL) { goto error_exit; } request->restart_state = atoi( buffer ); if (fgets( buffer, file_len, fp ) == NULL) { goto error_exit; } /* We don't know when the job status in the state file was obtained. * Set the time to 0 so that any new status will be used. */ globus_gram_job_manager_request_set_status_time(request, atoi( buffer ), 0); if (fgets( buffer, file_len, fp ) == NULL) { goto error_exit; } request->failure_code = atoi( buffer ); if(fgets( buffer, file_len, fp ) == NULL) { goto error_exit; } buffer[strlen(buffer)-1] = '\0'; if(strcmp(buffer, " ") != 0) { request->job_id_string = strdup( buffer ); } if (fgets( buffer, file_len, fp ) == NULL) { goto free_job_id_string; } buffer[strlen(buffer)-1] = '\0'; request->rsl_spec = strdup( buffer ); if (fgets( buffer, file_len, fp ) == NULL) { goto free_rsl_spec; } buffer[strlen(buffer)-1] = '\0'; request->cache_tag = strdup( buffer ); if (fgets( buffer, file_len, fp ) == NULL) { goto free_cache_tag; } buffer[strlen(buffer)-1] = '\0'; if (request->config && strcmp(buffer, request->config->jobmanager_type) != 0) { /* Job should be handled by another job manager */ rc = GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; goto free_cache_tag; } if (fgets( buffer, file_len, fp ) == NULL) { goto free_cache_tag; } buffer[strlen(buffer)-1] = '\0'; if((sscanf(buffer,"%d",&i)) < 1) { /* The last line we grabbed was the jobmanager_type. Now we * need to grab the two_phase_commit number. Older jobmanagers * don't print the jobmanager_type to the state file, hence * the check above. */ if(fgets( buffer, file_len, fp ) == NULL) { goto free_cache_tag; } buffer[strlen(buffer)-1] = '\0'; } request->two_phase_commit = atoi(buffer); if (fgets( buffer, file_len, fp ) == NULL) { goto free_cache_tag; } buffer[strlen(buffer)-1] = '\0'; if(strcmp(buffer, " ") != 0) { request->scratchdir = strdup(buffer); } if (fgets( buffer, file_len, fp ) == NULL) { goto free_scratchdir; } buffer[strlen(buffer)-1] = '\0'; sscanf(buffer, "%lu", &tmp_timestamp); request->seg_last_timestamp = (time_t) tmp_timestamp; if (fgets( buffer, file_len, fp ) == NULL) { goto free_scratchdir; } buffer[strlen(buffer)-1] = '\0'; sscanf(buffer, "%lu", &tmp_timestamp); request->creation_time = (time_t) tmp_timestamp; if (fgets( buffer, file_len, fp ) == NULL) { goto free_scratchdir; } buffer[strlen(buffer)-1] = '\0'; sscanf(buffer, "%lu", &tmp_timestamp); request->queued_time = (time_t) tmp_timestamp; request->stage_in_todo = NULL; request->stage_in_shared_todo = NULL; request->stage_out_todo = NULL; request->stage_stream_todo = NULL; rc = globus_gram_job_manager_staging_read_state(request,fp); if(rc != GLOBUS_SUCCESS) { goto free_scratchdir; } rc = globus_gram_job_manager_read_callback_contacts(request, fp); if(rc != GLOBUS_SUCCESS) { goto free_staging; } if (fgets( buffer, file_len, fp ) == NULL) { goto free_callback_contacts; } buffer[strlen(buffer)-1] = '\0'; if(strcmp(buffer, " ") != 0) { request->gateway_user = strdup(buffer); } else { request->gateway_user = NULL; } if (fgets( buffer, file_len, fp ) == NULL) { goto free_gateway_user; } buffer[strlen(buffer)-1] = 0; sscanf(buffer, "%d", &request->exit_code); if (fgets( buffer, file_len, fp ) == NULL) { goto free_gateway_user; } buffer[strlen(buffer)-1] = 0; sscanf(buffer, "%ld.%09ld %ld.%09ld %ld.%09ld " "%ld.%09ld %ld.%09ld %ld.%09ld %ld.%09ld " "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", &request->job_stats.unsubmitted_timestamp.tv_sec, &request->job_stats.unsubmitted_timestamp.tv_nsec, &request->job_stats.file_stage_in_timestamp.tv_sec, &request->job_stats.file_stage_in_timestamp.tv_nsec, &request->job_stats.pending_timestamp.tv_sec, &request->job_stats.pending_timestamp.tv_nsec, &request->job_stats.active_timestamp.tv_sec, &request->job_stats.active_timestamp.tv_nsec, &request->job_stats.failed_timestamp.tv_sec, &request->job_stats.failed_timestamp.tv_nsec, &request->job_stats.file_stage_out_timestamp.tv_sec, &request->job_stats.file_stage_out_timestamp.tv_nsec, &request->job_stats.done_timestamp.tv_sec, &request->job_stats.done_timestamp.tv_nsec, &request->job_stats.restart_count, &request->job_stats.callback_count, &request->job_stats.status_count, &request->job_stats.register_count, &request->job_stats.unregister_count, &request->job_stats.signal_count, &request->job_stats.refresh_count, &request->job_stats.file_clean_up_count, &request->job_stats.file_stage_in_http_count, &request->job_stats.file_stage_in_https_count, &request->job_stats.file_stage_in_ftp_count, &request->job_stats.file_stage_in_gsiftp_count, &request->job_stats.file_stage_in_shared_http_count, &request->job_stats.file_stage_in_shared_https_count, &request->job_stats.file_stage_in_shared_ftp_count, &request->job_stats.file_stage_in_shared_gsiftp_count, &request->job_stats.file_stage_out_http_count, &request->job_stats.file_stage_out_https_count, &request->job_stats.file_stage_out_ftp_count, &request->job_stats.file_stage_out_gsiftp_count); if (fgets( buffer, file_len, fp ) == NULL) { goto free_gateway_user; } buffer[strlen(buffer)-1] = '\0'; if(strcmp(buffer, " ") != 0) { request->job_stats.client_address = strdup(buffer); } else { request->job_stats.client_address = NULL; } if (fgets( buffer, file_len, fp ) == NULL) { goto free_client_address; } buffer[strlen(buffer)-1] = 0; if(strcmp(buffer, " ") != 0) { request->job_stats.user_dn = strdup(buffer); } else { request->job_stats.user_dn = NULL; } if (fgets( buffer, file_len, fp ) == NULL) { goto free_user_dn; } request->expected_terminal_state = atoi( buffer ); if (fgets( buffer, file_len, fp ) == NULL) { goto free_user_dn; } buffer[strlen(buffer)-1] = '\0'; if (request->config && strcmp(buffer, request->config->service_tag) != 0) { /* Job should be handled by another job manager */ rc = GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; goto free_user_dn; } if(fgets( buffer, file_len, fp ) == NULL) { goto free_user_dn; } buffer[strlen(buffer)-1] = '\0'; if(strcmp(buffer, " ") != 0) { request->original_job_id_string = strdup(buffer); } if(fgets( buffer, file_len, fp ) == NULL) { goto free_original_job_id_string; } buffer[strlen(buffer)-1] = '\0'; if(strcmp(buffer, " ") != 0) { request->job_log_level = atoi(buffer); } fclose(fp); free(buffer); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.state_file.read.end " "level=TRACE " "path=%s " "status=%d " "\n", request->job_state_file, 0); return GLOBUS_SUCCESS; free_original_job_id_string: if (request->original_job_id_string != NULL) { free(request->original_job_id_string); request->original_job_id_string = NULL; } free_user_dn: if (request->job_stats.user_dn) { free(request->job_stats.user_dn); } free_client_address: if (request->job_stats.client_address != NULL) { free(request->job_stats.client_address); request->job_stats.client_address = NULL; } free_gateway_user: if (request->gateway_user != NULL) { free(request->gateway_user); request->gateway_user = NULL; } free_callback_contacts: globus_gram_job_manager_contact_list_free(request); free_staging: globus_gram_job_manager_staging_free_all(request); free_scratchdir: if (request->scratchdir != NULL) { free(request->scratchdir); request->scratchdir = NULL; } free_cache_tag: if (request->cache_tag != NULL) { free(request->cache_tag); request->cache_tag = NULL; } free_rsl_spec: if (request->rsl_spec != NULL) { free(request->rsl_spec); request->rsl_spec = NULL; } free_job_id_string: if (request->job_id_string != NULL) { free(request->job_id_string); request->job_id_string = NULL; } error_exit: if (rc == GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.state_file.read.end " "level=ERROR " "path=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_state_file, -rc, "Error reading state file", globus_gram_protocol_error_string(rc)); fclose(fp); fopen_state_file_failed: if (buffer != NULL) { free(buffer); } exit: return rc; } /* globus_gram_job_manager_state_file_read() */ /** * Try to set an advisory write lock on a file descriptor * * @param fd * Open file descriptor to lock. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE * Another process has the file locked. * @retval GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE * System error locking the file. */ int globus_gram_job_manager_file_lock( int fd) { int rc; struct flock fl; fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; fl.l_start = 0; fl.l_len = 0; while( (rc = fcntl( fd, F_SETLK, &fl )) < 0 ) { if ( errno == EACCES || errno == EAGAIN ) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; break; } else if ( errno != EINTR ) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE; break; } } return rc; } /* globus_gram_job_manager_file_lock() */ globus_gram_job_manager-13.53/globus_gram_job_manager_staging.c0000666000076400007640000010214311625176770022031 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file globus_gram_job_manager_staging.c GRAM Job Manager Staging Tracking * * CVS Information: * * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/globus_gram_job_manager_staging.c,v $ * $Date: 2011/08/24 13:34:48 $ * $Revision: 1.18 $ * $Author: bester $ */ #include "globus_gram_job_manager.h" #include "globus_rsl_assist.h" #include static int globus_l_gram_job_manager_staging_add_pair( globus_gram_jobmanager_request_t * request, globus_rsl_value_t * from, globus_rsl_value_t * to, const char * type); static globus_bool_t globus_l_gram_job_manager_staging_match( void * datum, void * arg); static int globus_l_gram_staging_list_read_state( globus_gram_jobmanager_request_t * request, FILE * fp, char * buffer, globus_gram_job_manager_staging_type_t staging_type, globus_list_t ** staging_list); static void globus_l_gram_staging_list_free( globus_list_t ** staging_list); static int globus_l_staging_replace_stream( globus_gram_jobmanager_request_t * request, char * parameter, char * cached_destination); #endif int globus_gram_job_manager_staging_create_list( globus_gram_jobmanager_request_t * request) { int i; int rc; globus_rsl_value_t * from; globus_rsl_value_t * to; globus_list_t * list; globus_list_t * pairs; char * can_stage_list[] = { GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_PARAM, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_SHARED_PARAM, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_OUT_PARAM, NULL }; int errors_list[] = { GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_IN, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_IN_SHARED, GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_OUT, 0 }; if(request->jm_restart) { return GLOBUS_SUCCESS; } for(i = 0; can_stage_list[i] != NULL; i++) { list = globus_rsl_param_get_values(request->rsl, can_stage_list[i]); if(!list) { continue; } while(!globus_list_empty(list)) { pairs = globus_rsl_value_sequence_get_value_list( globus_list_first(list)); list = globus_list_rest(list); if(globus_list_size(pairs) != 2) { rc = errors_list[i]; goto failed_adding_exit; } from = globus_list_first(pairs); to = globus_list_first(globus_list_rest(pairs)); rc = globus_l_gram_job_manager_staging_add_pair( request, from, to, can_stage_list[i]); if(rc != GLOBUS_SUCCESS) { goto failed_adding_exit; } } } rc = globus_gram_job_manager_streaming_list_replace(request); failed_adding_exit: if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_staging_free_all(request); } return rc; } /* globus_gram_job_manager_staging_create_list() */ int globus_gram_job_manager_streaming_list_replace( globus_gram_jobmanager_request_t * request) { globus_list_t * old_list; int rc; /* We'll restore to the old list if this fails */ old_list = request->stage_stream_todo; request->stage_stream_todo = NULL; rc = globus_l_staging_replace_stream( request, GLOBUS_GRAM_PROTOCOL_STDOUT_PARAM, request->cached_stdout); if (rc != GLOBUS_SUCCESS) { goto bad_stdout; } rc = globus_l_staging_replace_stream( request, GLOBUS_GRAM_PROTOCOL_STDERR_PARAM, request->cached_stderr); if (rc != GLOBUS_SUCCESS) { goto bad_stderr; } if (rc == GLOBUS_SUCCESS) { globus_l_gram_staging_list_free(&old_list); old_list = NULL; } else { bad_stderr: bad_stdout: globus_l_gram_staging_list_free(&request->stage_stream_todo); request->stage_stream_todo = old_list; } return rc; } /* globus_gram_job_manager_streaming_list_replace() */ static int globus_l_staging_replace_one_stream( globus_gram_jobmanager_request_t * request, char * parameter, char * cached_destination, globus_list_t * list, globus_bool_t single) { globus_rsl_value_t from_cached; globus_rsl_value_t *to = NULL; globus_rsl_value_t *tag = NULL; char *evaled_to = NULL; char *evaled_tag = NULL; char *fname = NULL; unsigned long timestamp = GLOBUS_GASS_CACHE_TIMESTAMP_UNKNOWN; int rc = GLOBUS_SUCCESS; static const char gass_cache_scheme[] = "x-gass-cache://"; from_cached.type = GLOBUS_RSL_VALUE_LITERAL; from_cached.value.literal.string = cached_destination; /* * First element of the list is the destination, the second is the * (optional) tag. Both (if present) must be something that * evaluates to a string and not a sequence. */ to = globus_list_first(list); list = globus_list_rest(list); if (!globus_list_empty(list)) { tag = globus_list_first(list); list = globus_list_rest(list); } if (globus_rsl_value_is_sequence(to) || ((tag != NULL) && globus_rsl_value_is_sequence(tag)) || list != NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT; goto bad_value; } rc = globus_gram_job_manager_rsl_evaluate_value( &request->symbol_table, to, &evaled_to); if (rc != GLOBUS_SUCCESS) { goto bad_value; } /* If it evaluates to a string, and is not an x-gass-cache URL, * then tag must be NULL */ if (strncmp(evaled_to, gass_cache_scheme, sizeof(gass_cache_scheme)-1) != 0 && tag != NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT; free(evaled_to); goto bad_value; } if (tag != NULL) { /* If there's a tag, evaluate it and add it to the cache file * so that the file won't get erased when the job terminates */ rc = globus_gram_job_manager_rsl_evaluate_value( &request->symbol_table, tag, &evaled_tag); if (rc != GLOBUS_SUCCESS) { goto bad_value; } rc = globus_gass_cache_add( request->cache_handle, evaled_to, evaled_tag, GLOBUS_TRUE, ×tamp, &fname); if (rc != GLOBUS_GASS_CACHE_ADD_NEW && rc != GLOBUS_GASS_CACHE_ADD_EXISTS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDOUT; goto bad_value; } free(fname); rc = globus_gass_cache_add_done( request->cache_handle, evaled_to, evaled_tag, timestamp); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDOUT; goto bad_value; } } /* If there is more than one output destination, or this one is * a non-local destination, then add it to the streamout list */ if ((!single) || (strstr(evaled_to, "://") != NULL && strncmp(evaled_to, gass_cache_scheme, sizeof(gass_cache_scheme)-1) != 0)) { rc = globus_l_gram_job_manager_staging_add_pair( request, &from_cached, to, "filestreamout"); free(evaled_to); evaled_to = NULL; if (rc != GLOBUS_SUCCESS) { goto bad_value; } } else if (strstr(evaled_to, "://") == NULL) { /* If it's a local file, check that it is writable */ int tmpfd; tmpfd = open(evaled_to, O_WRONLY|O_CREAT|O_APPEND, S_IRUSR|S_IWUSR); if (tmpfd < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDOUT; free(evaled_to); goto bad_value; } else { close(tmpfd); } } if (evaled_to) { free(evaled_to); } if (rc != GLOBUS_SUCCESS) { bad_value: /* Normalize error types to match the RSL attribute that we are * processing */ if (strcmp(parameter, GLOBUS_GRAM_PROTOCOL_STDERR_PARAM) == 0) { switch (rc) { case GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDERR; break; case GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDOUT: rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDERR; break; default: break; } } } return rc; } /* globus_l_staging_replace_one_stream() */ static int globus_l_staging_replace_stream( globus_gram_jobmanager_request_t * request, char * parameter, char * cached_destination) { globus_list_t * list; globus_rsl_value_t *to; globus_rsl_value_t from_cached; globus_bool_t single; int rc = GLOBUS_SUCCESS; list = globus_rsl_param_get_values( request->rsl, parameter); if (list == NULL) { /* Attempting to replace something that was never in the job * RSL---too bad */ return GLOBUS_SUCCESS; } from_cached.type = GLOBUS_RSL_VALUE_LITERAL; from_cached.value.literal.string = cached_destination; /* The stdout and stderr attributes can occur in two forms: * - stdout = destination [tag] * - stdout = (destination [tag])+ * That is, either as a sequence of 1 or 2 values, or as a sequence of * sequences. * * In either form, if there is only one destination, and it's a local file * or x-gass-cache URL, we can safely write directly to that file and don't * need it to be staged after the job completes. Otherwise, we'll have to * write to the stdout (stderr) file in the job directory and copy it * during the STAGE_OUT state. */ if (! globus_rsl_value_is_sequence(globus_list_first(list))) { rc = globus_l_staging_replace_one_stream( request, parameter, cached_destination, list, GLOBUS_TRUE); } else { single = (globus_list_size(list) == 1); while (!globus_list_empty(list)) { globus_list_t *sequence_list; to = globus_list_first(list); list = globus_list_rest(list); if (!globus_rsl_value_is_sequence(to)) { /* Bare value instead of a sequence */ rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT; goto bad_value; } sequence_list = globus_rsl_value_sequence_get_value_list(to); rc = globus_l_staging_replace_one_stream( request, parameter, cached_destination, sequence_list, single); if (rc != GLOBUS_SUCCESS) { goto bad_value; } } } if (rc != GLOBUS_SUCCESS) { bad_value: /* Normalize error types to match the RSL attribute that we are * processing */ if (strcmp(parameter, GLOBUS_GRAM_PROTOCOL_STDERR_PARAM) == 0) { switch (rc) { case GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDERR; break; case GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDOUT: rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_STDERR; break; default: break; } } } return rc; } /* globus_gram_job_manager_staging_create_list() */ int globus_gram_job_manager_staging_remove( globus_gram_jobmanager_request_t * request, globus_gram_job_manager_staging_type_t type, char * from, char * to) { globus_gram_job_manager_staging_info_t query; globus_gram_job_manager_staging_info_t * item; globus_list_t ** list; globus_list_t * node; const char * typestr = ""; switch(type) { case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN: typestr = "file_stage_in"; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED: typestr = "file_stage_in_shared"; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT: typestr = "file_stage_out"; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS: typestr = "file_stream_out"; break; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.staging_remove.start " "level=DEBUG " "gramid=%s " "src=\"%s\" " "dst=\"%s\" " "type=%s " "\n", request->job_contact_path, from, to, typestr); query.evaled_from = from; query.evaled_to = to; query.type = type; switch(type) { case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN: list = &request->stage_in_todo; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED: list = &request->stage_in_shared_todo; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT: list = &request->stage_out_todo; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS: list = &request->stage_stream_todo; break; } node = globus_list_search_pred( *list, globus_l_gram_job_manager_staging_match, &query); if(node) { item = globus_list_remove(list, node); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.staging_remove.end " "level=TRACE " "gramid=%s " "msg=\"%s\" " "src=\"%s\" " "dst=\"%s\" " "type=%s " "status=%d " "\n", request->job_contact_path, "File staged", from, to, typestr, 0); if (item->type == GLOBUS_GRAM_JOB_MANAGER_STAGE_IN) { if (strncmp(item->evaled_from, "http://", 7) == 0) { request->job_stats.file_stage_in_http_count++; } else if (strncmp(item->evaled_from, "https://", 8) == 0) { request->job_stats.file_stage_in_https_count++; } else if (strncmp(item->evaled_from, "ftp://", 6) == 0) { request->job_stats.file_stage_in_ftp_count++; } else if (strncmp(item->evaled_from, "gsiftp://", 6) == 0) { request->job_stats.file_stage_in_gsiftp_count++; } } else if (item->type == GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED) { if (strncmp(item->evaled_from, "http://", 7) == 0) { request->job_stats.file_stage_in_shared_http_count++; } else if (strncmp(item->evaled_from, "https://", 8) == 0) { request->job_stats.file_stage_in_shared_https_count++; } else if (strncmp(item->evaled_from, "ftp://", 6) == 0) { request->job_stats.file_stage_in_shared_ftp_count++; } else if (strncmp(item->evaled_from, "gsiftp://", 6) == 0) { request->job_stats.file_stage_in_shared_gsiftp_count++; } } else if (item->type == GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT || item->type == GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS) { if (strncmp(item->evaled_to, "http://", 7) == 0) { request->job_stats.file_stage_out_http_count++; } else if (strncmp(item->evaled_to, "https://", 8) == 0) { request->job_stats.file_stage_out_https_count++; } else if (strncmp(item->evaled_to, "ftp://", 6) == 0) { request->job_stats.file_stage_out_ftp_count++; } else if (strncmp(item->evaled_to, "gsiftp://", 6) == 0) { request->job_stats.file_stage_out_gsiftp_count++; } } globus_rsl_value_free_recursive(item->from); globus_rsl_value_free_recursive(item->to); free(item->evaled_from); free(item->evaled_to); free(item); } else { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.staging_remove.end " "level=WARN " "gramid=%s " "msg=\"%s\" " "src=\"%s\" " "dst=\"%s\" " "type=%s " "status=%d " "msg=\"%s\" " "\n", request->job_contact_path, "File staged", from, to, typestr, 0, "Unexpected staging completion"); } return GLOBUS_SUCCESS; } /* globus_gram_job_manager_staging_remove() */ int globus_gram_job_manager_staging_write_state( globus_gram_jobmanager_request_t * request, FILE * fp) { globus_list_t * tmp_list; globus_gram_job_manager_staging_info_t * info; char * tmp_str; int rc; rc = fprintf(fp, "%d\n", globus_list_size(request->stage_in_todo)); if (rc < 0) { return GLOBUS_FAILURE; } tmp_list = request->stage_in_todo; while(!globus_list_empty(tmp_list)) { info = globus_list_first(tmp_list); tmp_list = globus_list_rest(tmp_list); tmp_str = globus_rsl_value_unparse(info->from); rc = fprintf(fp, "%s\n", tmp_str); free(tmp_str); if (rc < 0) { return GLOBUS_FAILURE; } tmp_str = globus_rsl_value_unparse(info->to); rc = fprintf(fp, "%s\n", tmp_str); free(tmp_str); if (rc < 0) { return GLOBUS_FAILURE; } } rc = fprintf(fp, "%d\n", globus_list_size(request->stage_in_shared_todo)); if (rc < 0) { return GLOBUS_FAILURE; } tmp_list = request->stage_in_shared_todo; while(!globus_list_empty(tmp_list)) { info = globus_list_first(tmp_list); tmp_list = globus_list_rest(tmp_list); tmp_str = globus_rsl_value_unparse(info->from); rc = fprintf(fp, "%s\n", tmp_str); free(tmp_str); if (rc < 0) { return GLOBUS_FAILURE; } tmp_str = globus_rsl_value_unparse(info->to); rc = fprintf(fp, "%s\n", tmp_str); free(tmp_str); if (rc < 0) { return GLOBUS_FAILURE; } } rc = fprintf(fp, "%d\n", globus_list_size(request->stage_out_todo)); if (rc < 0) { return GLOBUS_FAILURE; } tmp_list = request->stage_out_todo; while(!globus_list_empty(tmp_list)) { info = globus_list_first(tmp_list); tmp_list = globus_list_rest(tmp_list); tmp_str = globus_rsl_value_unparse(info->from); rc = fprintf(fp, "%s\n", tmp_str); free(tmp_str); if (rc < 0) { return GLOBUS_FAILURE; } tmp_str = globus_rsl_value_unparse(info->to); rc = fprintf(fp, "%s\n", tmp_str); free(tmp_str); if (rc < 0) { return GLOBUS_FAILURE; } } rc = fprintf(fp, "%d\n", globus_list_size(request->stage_stream_todo)); tmp_list = request->stage_stream_todo; while(!globus_list_empty(tmp_list)) { info = globus_list_first(tmp_list); tmp_list = globus_list_rest(tmp_list); tmp_str = globus_rsl_value_unparse(info->from); rc = fprintf(fp, "%s\n", tmp_str); free(tmp_str); if (rc < 0) { return GLOBUS_FAILURE; } tmp_str = globus_rsl_value_unparse(info->to); rc = fprintf(fp, "%s\n", tmp_str); free(tmp_str); if (rc < 0) { return GLOBUS_FAILURE; } } return GLOBUS_SUCCESS; } /* globus_gram_job_manager_staging_write_state() */ int globus_gram_job_manager_staging_read_state( globus_gram_jobmanager_request_t * request, FILE * fp) { int rc = GLOBUS_SUCCESS; char * buffer; size_t buffer_len; long offset; offset = ftell(fp); if (fseek(fp, 0, SEEK_END) < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto out; } buffer_len = ftell(fp) - offset; if (fseek(fp, offset, SEEK_SET) < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto out; } buffer = malloc(buffer_len+1); if (buffer == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } rc = globus_l_gram_staging_list_read_state( request, fp, buffer, GLOBUS_GRAM_JOB_MANAGER_STAGE_IN, &request->stage_in_todo); if (rc != GLOBUS_SUCCESS) { goto free_buffer_out; } rc = globus_l_gram_staging_list_read_state( request, fp, buffer, GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED, &request->stage_in_shared_todo); if (rc != GLOBUS_SUCCESS) { goto free_buffer_out; } rc = globus_l_gram_staging_list_read_state( request, fp, buffer, GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT, &request->stage_out_todo); if (rc != GLOBUS_SUCCESS) { goto free_buffer_out; } rc = globus_l_gram_staging_list_read_state( request, fp, buffer, GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS, &request->stage_stream_todo); free_buffer_out: free(buffer); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_staging_free_all(request); } out: return rc; } /* globus_gram_job_manager_staging_read_state() */ static int globus_l_gram_job_manager_staging_add_pair( globus_gram_jobmanager_request_t * request, globus_rsl_value_t * from, globus_rsl_value_t * to, const char * type) { int rc; globus_gram_job_manager_staging_info_t * info; info = calloc( 1, sizeof(globus_gram_job_manager_staging_info_t)); if(!info) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto info_calloc_failed; } info->from = globus_rsl_value_copy_recursive(from); info->to = globus_rsl_value_copy_recursive(to); if(strcmp(type, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_PARAM) == 0) { info->type = GLOBUS_GRAM_JOB_MANAGER_STAGE_IN; } else if(strcmp(type, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_IN_SHARED_PARAM)== 0) { info->type = GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED; } else if(strcmp(type, GLOBUS_GRAM_PROTOCOL_FILE_STAGE_OUT_PARAM) == 0) { info->type = GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT; } else if (strcmp(type, "filestreamout") == 0) { info->type = GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS; } rc = globus_gram_job_manager_rsl_evaluate_value( &request->symbol_table, info->from, &info->evaled_from); if(!info->evaled_from) { if(rc == GLOBUS_SUCCESS) { /* Not a literal after a successful eval */ switch(info->type) { case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_IN; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_IN_SHARED; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_OUT; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT; break; } } goto eval_from_failed; } rc = globus_gram_job_manager_rsl_evaluate_value( &request->symbol_table, info->to, &info->evaled_to); if(!info->evaled_to) { if(rc == GLOBUS_SUCCESS) { /* Not a literal after a successful eval */ switch(info->type) { case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_IN; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_IN_SHARED; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_FILE_STAGE_OUT; break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS: rc = GLOBUS_GRAM_PROTOCOL_ERROR_RSL_STDOUT; break; } } goto eval_to_failed; } switch(info->type) { case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN: globus_list_insert(&request->stage_in_todo, info); break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_IN_SHARED: globus_list_insert(&request->stage_in_shared_todo, info); break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_OUT: globus_list_insert(&request->stage_out_todo, info); break; case GLOBUS_GRAM_JOB_MANAGER_STAGE_STREAMS: if (strcmp(info->evaled_to, "/dev/null") == 0) { globus_rsl_value_free_recursive(info->from); globus_rsl_value_free_recursive(info->to); free(info->evaled_from); free(info->evaled_to); free(info); } else { globus_list_insert(&request->stage_stream_todo, info); } break; } return GLOBUS_SUCCESS; eval_to_failed: free(info->evaled_from); eval_from_failed: free(info); info_calloc_failed: return rc; } /* globus_l_gram_job_manager_staging_add_url() */ static globus_bool_t globus_l_gram_job_manager_staging_match( void * datum, void * arg) { globus_gram_job_manager_staging_info_t * item; globus_gram_job_manager_staging_info_t * query; item = datum; query = arg; globus_assert(item->type == query->type); if((strcmp(item->evaled_from, query->evaled_from) == 0) && (strcmp(item->evaled_to, query->evaled_to) == 0)) { return GLOBUS_TRUE; } else { return GLOBUS_FALSE; } } /* globus_l_gram_job_manager_staging_match() */ static void globus_l_gram_staging_list_free( globus_list_t ** staging_list) { globus_gram_job_manager_staging_info_t * info; while (!globus_list_empty(*staging_list)) { info = globus_list_remove(staging_list, *staging_list); globus_rsl_value_free_recursive(info->from); globus_rsl_value_free_recursive(info->to); free(info->evaled_from); free(info->evaled_to); free(info); } } void globus_gram_job_manager_staging_free_all( globus_gram_jobmanager_request_t * request) { globus_l_gram_staging_list_free(&request->stage_in_todo); globus_l_gram_staging_list_free(&request->stage_in_shared_todo); globus_l_gram_staging_list_free(&request->stage_out_todo); globus_l_gram_staging_list_free(&request->stage_stream_todo); } /* globus_gram_job_manager_staging_free_all() */ /** * Read a list of staging pairs from the state file * * @param request * Job request associated with the state file (used for * RSL evaluation) * @param fp * State file opened for reading * @param buffer * Buffer containing the state file data * @param staging_type * Type of staging list to read * @param staging_list * List to insert the staging work into. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE * Error reading state file * @retval GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED * Out of memory */ static int globus_l_gram_staging_list_read_state( globus_gram_jobmanager_request_t * request, FILE * fp, char * buffer, globus_gram_job_manager_staging_type_t staging_type, globus_list_t ** staging_list) { int rc = GLOBUS_SUCCESS; int i, tmp_list_size; globus_gram_job_manager_staging_info_t * info; if (fscanf(fp, "%[^\n]%*c", buffer) < 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto out; } tmp_list_size = atoi(buffer); for(i = 0; i < tmp_list_size; i++) { info = calloc( 1, sizeof(globus_gram_job_manager_staging_info_t)); if (info == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto out; } info->type = staging_type; if(fscanf(fp, "%[^\n]%*c", buffer) < 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto free_info_out; } rc = globus_gram_job_manager_rsl_parse_value( buffer, &info->from); if (rc != GLOBUS_SUCCESS) { goto free_info_out; } if(fscanf(fp, "%[^\n]%*c", buffer) < 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto free_info_from_out; } rc = globus_gram_job_manager_rsl_parse_value( buffer, &info->to); if (rc != GLOBUS_SUCCESS) { goto free_info_from_out; } rc = globus_gram_job_manager_rsl_evaluate_value( &request->symbol_table, info->from, &info->evaled_from); if (rc != GLOBUS_SUCCESS) { goto free_info_to_out; } rc = globus_gram_job_manager_rsl_evaluate_value( &request->symbol_table, info->to, &info->evaled_to); if (rc != GLOBUS_SUCCESS) { goto free_info_evaled_from_out; } globus_list_insert(staging_list, info); } if (rc != GLOBUS_SUCCESS) { free_info_evaled_from_out: free(info->evaled_from); free_info_to_out: free(info->to); free_info_from_out: free(info->from); free_info_out: free(info); } out: return rc; } /* globus_l_gram_staging_list_read_state() */ globus_gram_job_manager-13.53/globus_automake_post_top0000644000076400007640000000063512055152374020346 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_gram_job_manager-13.53/globus_gram_job_manager_seg.c0000666000076400007640000015547111754777371021176 00000000000000/* * Copyright 1999-2010 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_gram_job_manager.h" #include "globus_scheduler_event_generator.h" #include "globus_scheduler_event_generator_app.h" #include #include #include typedef struct globus_gram_seg_resume_s { globus_gram_job_manager_t * manager; globus_list_t * events; } globus_gram_seg_resume_t; static globus_bool_t globus_l_condor_regexes_compiled = GLOBUS_FALSE; static regex_t globus_l_condor_outer_re; static regex_t globus_l_condor_inner_re; globus_result_t globus_l_gram_seg_event_callback( void * user_arg, const globus_scheduler_event_t * event); static void globus_l_gram_fork_poll_callback( void * user_arg); static int globus_l_gram_deliver_event( globus_gram_jobmanager_request_t * request, globus_scheduler_event_t * event); static void globus_l_seg_resume_callback( void * user_arg); static int globus_l_condor_parse_log( const char * data, globus_gram_job_manager_ref_t * ref, globus_fifo_t * events); static int globus_l_condor_read_log( globus_gram_job_manager_t *manager, const char *path, size_t last_size, char **data); static void globus_l_gram_condor_poll_callback( void * user_arg); globus_result_t globus_gram_job_manager_init_seg( globus_gram_job_manager_t * manager) { globus_result_t result = GLOBUS_SUCCESS; int rc; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg.start level=TRACE module=%s\n", manager->config->seg_module ? manager->config->seg_module : "fork"); GlobusGramJobManagerLock(manager); if (manager->config->seg_module == NULL && strcmp(manager->config->jobmanager_type, "fork") == 0) { globus_reltime_t delay; GlobusTimeReltimeSet(delay, 1, 0); result = globus_callback_register_periodic( &manager->fork_callback_handle, &delay, &delay, globus_l_gram_fork_poll_callback, manager); if (result != GLOBUS_SUCCESS) { char * errstr; char * errstr_escaped; errstr = globus_error_print_friendly(globus_error_peek(result)); errstr_escaped = globus_gram_prepare_log_string( errstr); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.seg.end level=WARN status=%d " "reason=\"%s\"\n", -1, errstr_escaped ? errstr_escaped : ""); if (errstr_escaped) { free(errstr_escaped); } if (errstr) { free(errstr); } goto failed_periodic; } } else if (strcmp(manager->config->jobmanager_type, "condor") == 0) { globus_reltime_t delay; GlobusTimeReltimeSet(delay, 5, 0); result = globus_callback_register_periodic( &manager->fork_callback_handle, &delay, &delay, globus_l_gram_condor_poll_callback, manager); if (result != GLOBUS_SUCCESS) { char * errstr; char * errstr_escaped; errstr = globus_error_print_friendly(globus_error_peek(result)); errstr_escaped = globus_gram_prepare_log_string( errstr); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.seg.end level=WARN status=%d " "reason=\"%s\"\n", -1, errstr_escaped ? errstr_escaped : ""); if (errstr_escaped) { free(errstr_escaped); } if (errstr) { free(errstr); } goto failed_periodic; } } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg.activate.start level=TRACE module=%s\n", manager->config->seg_module); rc = globus_module_activate(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.seg.activate.end level=ERROR error=%d " "reason=\"Error activating SEG\"\n", rc); goto failed_activate; } globus_scheduler_event_generator_set_event_handler( globus_l_gram_seg_event_callback, manager); globus_scheduler_event_generator_set_timestamp( manager->seg_last_timestamp); setenv("JOB_MANAGER_SEG_SCHEDULER", manager->config->seg_module, 1); rc = globus_scheduler_event_generator_load_module( "job_manager"); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.seg.end level=ERROR " "error=%d " "module=%s " "reason=\"Error loading job_manager SEG " "module\"\n", rc, manager->config->seg_module); free(manager->config->seg_module); manager->config->seg_module = NULL; goto failed_load; } } manager->seg_started = GLOBUS_TRUE; failed_load: failed_activate: failed_periodic: GlobusGramJobManagerUnlock(manager); return result; } /* globus_gram_job_manager_init_seg() */ globus_result_t globus_gram_job_manager_shutdown_seg( globus_gram_job_manager_t * manager) { if (! manager->seg_started) { return GLOBUS_SUCCESS; } if (manager->fork_callback_handle != GLOBUS_NULL_HANDLE) { globus_callback_unregister( manager->fork_callback_handle, NULL, NULL, NULL); manager->fork_callback_handle = GLOBUS_NULL_HANDLE; } else { globus_module_deactivate(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE); } manager->seg_started = GLOBUS_FALSE; return GLOBUS_SUCCESS; } /* globus_gram_job_manager_shutdown_seg() */ globus_result_t globus_l_gram_seg_event_callback( void * user_arg, const globus_scheduler_event_t * event) { int rc; globus_gram_job_manager_t * manager = user_arg; globus_gram_jobmanager_request_t * request; globus_result_t result = GLOBUS_SUCCESS; globus_scheduler_event_t * new_event; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg.event.start level=TRACE segid=\"%s\" " "state=%d event_ts=%ld\n", event->job_id, (int) event->event_type, (long int) event->timestamp); if (event->event_type == GLOBUS_SCHEDULER_EVENT_RAW) { rc = GLOBUS_SUCCESS; goto raw_event; } result = globus_scheduler_event_copy(&new_event, event); if (result != GLOBUS_SUCCESS) { goto copy_failed; } GlobusGramJobManagerLock(manager); /* Find the job request associated by this job id */ rc = globus_gram_job_manager_add_reference_by_jobid( manager, event->job_id, "SEG event", &request); if (rc != GLOBUS_SUCCESS) { if (manager->seg_pause_count > 0) { /* New submit script is running. Avoid race by adding this to the * manager-wide queue */ globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg.event.queue level=TRACE segid=\"%s\"\n", event->job_id); rc = globus_fifo_enqueue(&manager->seg_event_queue, new_event); } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg.event.end level=TRACE segid=\"%s\" " "reason=\"Event ID doesn't match known job id\"\n", event->job_id); } } if (rc != GLOBUS_SUCCESS) { GlobusGramJobManagerUnlock(manager); goto manager_event_queue_failed; } else if (request == NULL) { /* Ignore unwanted event */ GlobusGramJobManagerUnlock(manager); goto done; } else { if (event->timestamp > manager->seg_last_timestamp) { manager->seg_last_timestamp = event->timestamp; } GlobusGramJobManagerUnlock(manager); rc = globus_l_gram_deliver_event( request, new_event); } if (rc != GLOBUS_SUCCESS) { (void) globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "SEG event"); manager_event_queue_failed: globus_scheduler_event_destroy(new_event); copy_failed: raw_event: ; } done: result = GLOBUS_SUCCESS; return result; } /* globus_l_gram_seg_event_callback() */ void globus_gram_job_manager_seg_handle_event( globus_gram_jobmanager_request_t * request) { globus_scheduler_event_t * event; char * subjob_id_ptr = NULL; size_t subjob_id_len; globus_bool_t found_subjob_id; event = globus_fifo_dequeue(&request->seg_event_queue); if (event->timestamp > request->seg_last_timestamp) { /* * GRAM-145: GRAM5 Job Manager fails to save SEG timestamps in job * state files * * We'll update the SEG timestamp here so that if the job manager * is restarted it (potentially) ignore events that have already been * noticed in the job state file. */ request->seg_last_timestamp = event->timestamp; } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.handle_seg_event.start " "level=DEBUG " "state=%d " "gramid=%s " "jobid=\"%s\" " "\n", event->event_type, request->job_contact_path, event->job_id); found_subjob_id = GLOBUS_FALSE; subjob_id_len = strlen(event->job_id); while (!found_subjob_id) { subjob_id_ptr = strstr(request->job_id_string, event->job_id); if (subjob_id_ptr == NULL) { break; } if (subjob_id_ptr == request->job_id_string || (*(subjob_id_ptr - 1) == ',')) { /* request->job_id_string starts with this subjob_id, or this * subjob_id happens after a comma. If it ends with a comma or * \0, then we've found a match. */ if (subjob_id_ptr[subjob_id_len] == ',') { found_subjob_id = GLOBUS_TRUE; if (event->event_type == GLOBUS_SCHEDULER_EVENT_DONE || event->event_type == GLOBUS_SCHEDULER_EVENT_FAILED) { /* Remove this sub job id from the list by moving * after the comma up until \0 to subjob_id_ptr */ memmove(subjob_id_ptr, subjob_id_ptr + subjob_id_len + 1, strlen(subjob_id_ptr + subjob_id_len + 1) + 1); } } else if (subjob_id_ptr[subjob_id_len] == 0) { /* This is the final subjob in the job_id_string */ found_subjob_id = GLOBUS_TRUE; if (event->event_type == GLOBUS_SCHEDULER_EVENT_DONE || event->event_type == GLOBUS_SCHEDULER_EVENT_FAILED) { /* Don't need to do memmove here, just null terminate at * either the initial part of the string if subjob_id is * the only one in the list, or at the comma otherwise */ if (subjob_id_ptr != request->job_id_string) { *(subjob_id_ptr - 1) = '\0'; } else { request->job_id_string[0] = '\0'; } } } } } /* If this is a terminal event (done or failed), we'll update the expected * terminal state (in the case of a multi-subjob case) and the exit code * if the job's exit code is currently 0 * * Thus, if any subjob fails or exits with a non-0 exit code, we will * propogate that in the job state change notification. */ if (event->event_type == GLOBUS_SCHEDULER_EVENT_DONE || event->event_type == GLOBUS_SCHEDULER_EVENT_FAILED) { if (request->expected_terminal_state == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE) { request->expected_terminal_state = event->event_type; } if (event->event_type == GLOBUS_SCHEDULER_EVENT_DONE && request->exit_code == 0) { request->exit_code = event->exit_code; } } /* If the last job terminated or any job moved to active, we'll update the * job status and potentially send notifications. */ if (event->event_type != GLOBUS_SCHEDULER_EVENT_DONE && event->event_type != GLOBUS_SCHEDULER_EVENT_FAILED) { if (globus_i_gram_job_manager_script_valid_state_change( request, event->event_type)) { globus_gram_job_manager_request_set_status( request, event->event_type); request->unsent_status_change = GLOBUS_TRUE; } } else if (*request->job_id_string == '\0') { if (globus_i_gram_job_manager_script_valid_state_change( request, request->expected_terminal_state)) { if ((request->expected_terminal_state == GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE) && globus_gram_job_manager_rsl_need_stage_out(request)) { globus_gram_job_manager_request_set_status( request, GLOBUS_GRAM_PROTOCOL_JOB_STATE_STAGE_OUT); } else { globus_gram_job_manager_request_set_status( request, request->expected_terminal_state); } request->unsent_status_change = GLOBUS_TRUE; } } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.handle_seg_event.end " "level=DEBUG " "state=%d " "gramid=%s " "jobid=\"%s\" " "\n", event->event_type, request->job_contact_path, event->job_id); globus_scheduler_event_destroy(event); (void) globus_gram_job_manager_remove_reference( request->manager, request->job_contact_path, "SEG event"); } /* globus_gram_job_manager_seg_handle_event() */ void globus_gram_job_manager_seg_pause( globus_gram_job_manager_t * manager) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg_pause.start " "level=TRACE " "count=%d " "\n", manager->seg_pause_count+1); GlobusGramJobManagerLock(manager); manager->seg_pause_count++; GlobusGramJobManagerUnlock(manager); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg_pause.end " "level=TRACE " "count=%d " "\n", manager->seg_pause_count); } /* globus_gram_job_manager_seg_pause() */ void globus_gram_job_manager_seg_resume( globus_gram_job_manager_t * manager) { globus_result_t result; globus_scheduler_event_t * event; globus_gram_seg_resume_t * resume; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg_resume.start " "level=TRACE " "count=%d " "\n", manager->seg_pause_count-1); GlobusGramJobManagerLock(manager); manager->seg_pause_count--; if (manager->seg_pause_count == 0 && !globus_fifo_empty(&manager->seg_event_queue)) { resume = malloc(sizeof(globus_gram_seg_resume_t)); if (resume != NULL) { globus_reltime_t delay; GlobusTimeReltimeSet(delay, 0, 0); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg_resume.info " "level=TRACE " "message=\"%s\" " "event_count=%d " "\n", "Creating resume callback struct", globus_fifo_size(&manager->seg_event_queue)); resume->manager = manager; resume->events = globus_fifo_convert_to_list( &manager->seg_event_queue); result = globus_callback_register_oneshot( NULL, &delay, globus_l_seg_resume_callback, resume); if (result != GLOBUS_SUCCESS) { while (!globus_list_empty(resume->events)) { event = globus_list_remove(&resume->events, resume->events); globus_scheduler_event_destroy(event); } } } } GlobusGramJobManagerUnlock(manager); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg_resume.end " "level=TRACE " "count=%d " "\n", manager->seg_pause_count); } /* globus_gram_job_manager_seg_resume() */ static void globus_l_seg_resume_callback( void * user_arg) { globus_gram_seg_resume_t * resume = user_arg; globus_scheduler_event_t * event; globus_gram_jobmanager_request_t * request; int rc; globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg.resume_callback.start " "level=TRACE " "\n"); while (!globus_list_empty(resume->events)) { event = globus_list_remove(&resume->events, resume->events); GlobusGramJobManagerLock(resume->manager); rc = globus_gram_job_manager_add_reference_by_jobid( resume->manager, event->job_id, "SEG event", &request); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg.resume_callback.end " "level=TRACE " "status=%d " "msg=\"%s\" " "\n", 0, "Ignoring unknown job id"); GlobusGramJobManagerUnlock(resume->manager); globus_scheduler_event_destroy(event); } else { if (event->timestamp > request->manager->seg_last_timestamp) { request->manager->seg_last_timestamp = event->timestamp; } GlobusGramJobManagerUnlock(resume->manager); rc = globus_l_gram_deliver_event( request, event); globus_gram_job_manager_log( NULL, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg.resume_callback.end " "level=TRACE " "status=%d " "msg=\"%s\" " "\n", -rc, "Delivered event"); } } } /* globus_l_seg_resume_callback() */ static int globus_l_gram_deliver_event( globus_gram_jobmanager_request_t * request, globus_scheduler_event_t * event) { int rc; globus_reltime_t delay_time; GlobusGramJobManagerRequestLock(request); globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg_deliver_event.start " "level=TRACE " "gramid=%s " "jobid=\"%s\" " "state=%d " "jmstate=%s\n", request->job_contact_path, event->job_id, event->event_type, globus_i_gram_job_manager_state_strings[ request->jobmanager_state]); /* Keep the state file's timestamp up to date so that * anything scrubbing the state files of old and dead * processes leaves it alone */ if(request->job_state_file) { utime(request->job_state_file, NULL); } rc = globus_fifo_enqueue(&request->seg_event_queue, event); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.seg_deliver_event.end " "level=ERROR " "gramid=%s " "jobid=\"%s\" " "state=%d " "jmstate=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, event->job_id, event->event_type, globus_i_gram_job_manager_state_strings[ request->jobmanager_state], -rc, "Fifo enqueue failed", globus_gram_protocol_error_string(rc)); goto event_enqueue_failed; } if (event->event_type == GLOBUS_SCHEDULER_EVENT_DONE || event->event_type == GLOBUS_SCHEDULER_EVENT_FAILED) { (void) globus_gram_job_manager_unregister_job_id( request->manager, event->job_id); } if (request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2) { GlobusTimeReltimeSet(delay_time, 0, 0); request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL1; rc = globus_gram_job_manager_state_machine_register( request->manager, request, &delay_time); if (rc != GLOBUS_SUCCESS) { request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_POLL2; } } rc = GLOBUS_SUCCESS; globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.seg_deliver_event.end " "level=TRACE " "gramid=%s " "jobid=\"%s\" " "state=%d " "jmstate=%s " "status=%d " "\n", request->job_contact_path, event->job_id, event->event_type, globus_i_gram_job_manager_state_strings[request->jobmanager_state], 0); event_enqueue_failed: GlobusGramJobManagerRequestUnlock(request); return rc; } /* globus_l_gram_deliver_event() */ static void globus_l_gram_fork_poll_callback( void * user_arg) { int rc; globus_gram_job_manager_t * manager = user_arg; globus_list_t * l; globus_scheduler_event_t * event; globus_list_t * events = NULL; globus_gram_jobmanager_request_t * request; int pid_count = 0; int done_count = 0; globus_list_t * job_id_list; globus_list_t * tmp; /* Walk the job id list, checking to see if the process has completed */ rc = globus_gram_job_manager_get_job_id_list( manager, &job_id_list); for (tmp = job_id_list; tmp != NULL; tmp = globus_list_rest(tmp)) { char * tok_end = NULL; char * pid_string; char * job_id_string; char * job_id_string_copy; job_id_string = globus_list_first(tmp); job_id_string_copy = strdup(job_id_string); if (job_id_string_copy == NULL) { continue; } pid_count = 0; done_count = 0; for (tok_end = NULL, pid_string = strtok_r(job_id_string, ",", &tok_end); pid_string != NULL; pid_string = strtok_r(NULL, ",", &tok_end)) { char * end = NULL; unsigned long pid; pid_count++; errno = 0; pid = strtoul(pid_string, &end, 10); if ((pid == ULONG_MAX && errno != 0) || strlen(end) != 0) { continue; } if (kill((pid_t) pid, 0) < 0) { done_count++; } } if (pid_count == done_count && pid_count > 0) { /* Synthesize done event */ event = malloc(sizeof(globus_scheduler_event_t)); event->event_type = GLOBUS_SCHEDULER_EVENT_DONE; event->job_id = job_id_string_copy; event->timestamp = time(NULL); event->exit_code = 0; event->failure_code = 0; event->raw_event = NULL; globus_list_insert(&events, event); } else { free(job_id_string_copy); } free(job_id_string); } globus_list_free(job_id_list); /* Queue events in the request-specific SEG event queue */ for (l = events; l != NULL; l = globus_list_rest(l)) { event = globus_list_first(l); GlobusGramJobManagerLock(manager); rc = globus_gram_job_manager_add_reference_by_jobid( manager, event->job_id, "SEG event", &request); GlobusGramJobManagerUnlock(manager); if (rc == GLOBUS_SUCCESS) { rc = globus_l_gram_deliver_event( request, event); if (rc != GLOBUS_SUCCESS) { goto destroy_event; } } if (rc != GLOBUS_SUCCESS) { destroy_event: globus_scheduler_event_destroy(event); } } globus_list_free(events); } /* globus_l_gram_fork_poll_callback() */ /** * @brief * Condor SEG-like periodic callback * * @details * This function is called periodically to check for condor state changes by * polling the condor log files for the jobs. This code assumes that * - The condor log files can be located in $job_state_file_dir/condor.$uniq_id * - The condor log files are in (pseudo) XML format * - The condor log files are owned by the user whose job is being logged * - The condor log files are removed when the job is cleaned up * * This function uses this algorithm to process the logs: * - Note current poll timestamp, last poll timestamp * - For each file that matches the file pattern * -- Check ownership, if not owned by user, skip file * -- Check if modified since last poll timestamp, if not changed, skip file * -- Lock File * -- Parse log file to generate SEG events (see globus_l_condor_parse_log()) * - set last poll timestamp to current poll timestamp */ static void globus_l_gram_condor_poll_callback( void * user_arg) { int rc; time_t last_poll_time; time_t poll_time; double poll_length; globus_reltime_t delay; globus_gram_job_manager_t * manager = user_arg; globus_scheduler_event_t * event; globus_fifo_t events; char * condor_log_data; globus_gram_job_manager_ref_t * ref; uint64_t uniq1, uniq2; char * path = NULL; GlobusGramJobManagerLock(manager); poll_time = time(NULL); last_poll_time = manager->seg_last_timestamp; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.condor_poll.start " "level=TRACE " "poll_time=%d " "last_poll=%d " "\n", poll_time, last_poll_time); rc = globus_fifo_init(&events); if (rc != GLOBUS_SUCCESS) { poll_time = last_poll_time; } for (ref = globus_hashtable_first(&manager->request_hash); ref != NULL; ref = globus_hashtable_next(&manager->request_hash)) { if (ref->request && ref->request->job_id_string && *ref->request->job_id_string == 0) { /* Skip jobs which have no outstanding subjobs to poll */ continue; } rc = sscanf(ref->key, "/%" SCNu64 "/%" SCNu64 "/", &uniq1, &uniq2); if (rc != 2) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.condor_poll.info " "level=WARN " "msg=\"%s\" " "key=\"%s\" " "\n", "Unexpected key format", ref->key); continue; } path = globus_common_create_string("%s/condor.%"PRIu64".%"PRIu64, manager->config->job_state_file_dir, uniq1, uniq2); if (path == NULL) { continue; } rc = globus_l_condor_read_log( manager, path, ref->seg_last_size, &condor_log_data); /* condor_log_data is null if the file hasn't changed since * seg_last_size or an error happened. */ if (rc != GLOBUS_SUCCESS || condor_log_data == NULL) { goto read_failed; } rc = globus_l_condor_parse_log( condor_log_data, ref, &events); free(condor_log_data); read_failed: free(path); path = NULL; } /* * Adjust poll interval based on polling time. If things are going slowly, * wait for a multiple of the poll time, otherwise reset the clock to * 5 seconds to avoid globus_callback scheduling this to run fewer than 5 * seconds from now. */ poll_length = difftime(time(NULL), poll_time); if (poll_length > 1.0) { GlobusTimeReltimeSet(delay, (time_t) (poll_length * 5), 0); } else { GlobusTimeReltimeSet(delay, (time_t) 5, 0); } globus_callback_adjust_period(manager->fork_callback_handle, &delay); GlobusGramJobManagerUnlock(manager); while (!globus_fifo_empty(&events)) { event = globus_fifo_dequeue(&events); globus_l_gram_seg_event_callback(manager, event); globus_scheduler_event_destroy(event); } globus_fifo_destroy(&events); GlobusGramJobManagerLock(manager); if (poll_time > manager->seg_last_timestamp) { manager->seg_last_timestamp = poll_time; } if (globus_l_condor_regexes_compiled) { regfree(&globus_l_condor_outer_re); regfree(&globus_l_condor_inner_re); globus_l_condor_regexes_compiled = GLOBUS_FALSE; } GlobusGramJobManagerUnlock(manager); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.condor_poll.end " "level=TRACE " "\n"); } /* globus_i_gram_condor_poll_callback() */ /** * @brief Generate SEG events for condor log events in a data buffer * * @details * This function uses a couple of regular expressions to pull out the * data from a (pseudo)XML condor log. This parser is adapted from the * condor SEG implement from GT4. The log messages look something like this * <c> * <<b v="t|f"/>|<s>STRING</s>|<i>INTEGER</i>|<r>REAL</r> * </c> * * We are only interested in attributes directly related to SEG events: * - EventTypeNumber * - EventTime * - Cluster * - Proc * - Subproc * - TerminatedNormally * - ReturnValue * * The parser pulls out values for all of the children of a c element, then * creates an event from it and pushes it onto the events fifo. */ static int globus_l_condor_parse_log( const char * data, globus_gram_job_manager_ref_t * ref, globus_fifo_t * events) { regmatch_t matches[8]; const char * p; int event_type_number; const char * event_time; int cluster; int proc; int subproc; globus_bool_t terminated_normally; int return_value = 0; struct tm event_tm; time_t event_stamp; int rc; globus_off_t parsed_length = 0; globus_scheduler_event_t * event; enum condor_attr_e { DONTCARE, EVENT_TYPE_NUMBER, EVENT_TIME, CLUSTER, PROC, SUBPROC, TERMINATED_NORMALLY, RETURN_VALUE } condor_attr; typedef enum { CONDOR_STRING, CONDOR_INTEGER, CONDOR_BOOLEAN, CONDOR_REAL } condor_parse_type_t; union { condor_parse_type_t type; struct { condor_parse_type_t type; const char * s; size_t len; } s; struct { condor_parse_type_t type; int i; } i; struct { condor_parse_type_t type; globus_bool_t b; } b; struct { condor_parse_type_t type; float r; } r; } pu; p = data; parsed_length = 0; if (!globus_l_condor_regexes_compiled) { rc = regcomp(&globus_l_condor_outer_re, "^([[:space:]]*((<[^/]||]{2,}>|[^<])*)[[:space:]]*)", REG_EXTENDED); assert (rc == 0); rc = regcomp(&globus_l_condor_inner_re, "^([[:space:]]*" "[[:space:]]*" "(<(b) v=\"([tf])\"/>|<([sire])>([^<]*))" "[[:space:]]*)", REG_EXTENDED); assert(rc == 0); globus_l_condor_regexes_compiled = GLOBUS_TRUE; } while ((rc = regexec( &globus_l_condor_outer_re, p, (int) (sizeof(matches)/sizeof(matches[0])), matches, 0)) == 0) { const char * e = p + matches[0].rm_eo; regoff_t event_length = matches[0].rm_eo - matches[0].rm_so; p = p + matches[2].rm_so; while ((rc = regexec(&globus_l_condor_inner_re, p, (int) (sizeof(matches)/sizeof(matches[0])), matches, 0)) == 0) { size_t matchlen; const char * match; /* Regular expression match indices as xpath strings * 1: a * 2: a/@n * 3: a/b|a/s/|a/i|a/r * 4: a/b * 5: a/b/@v * 6: a/s/local-name()|a/i/local-name()|a/r/local-name() * 7: a/s/text()|a/i/text()|a/r/text() */ matchlen = (size_t) (matches[2].rm_eo - matches[2].rm_so); match = p + matches[2].rm_so; if (strncmp(match, "EventTypeNumber", matchlen) == 0) { condor_attr = EVENT_TYPE_NUMBER; } else if (strncmp(match, "EventTime", matchlen) == 0) { condor_attr = EVENT_TIME; } else if (strncmp(match, "Cluster", matchlen) == 0) { condor_attr = CLUSTER; } else if (strncmp(match, "Proc", matchlen) == 0) { condor_attr = PROC; } else if (strncmp(match, "Subproc", matchlen) == 0) { condor_attr = SUBPROC; } else if (strncmp(match, "TerminatedNormally", matchlen) == 0) { condor_attr = TERMINATED_NORMALLY; } else if (strncmp(match, "ReturnValue", matchlen) == 0) { condor_attr = RETURN_VALUE; } else { condor_attr = DONTCARE; } matchlen = (size_t) (matches[4].rm_eo - matches[4].rm_so); match = p + matches[4].rm_so; if (matches[4].rm_so != -1) { if (strncmp(match, "b", matchlen) == 0) { pu.type = CONDOR_BOOLEAN; matchlen = (size_t) (matches[5].rm_eo - matches[5].rm_so); match = p + matches[5].rm_so; if (strncmp(match, "t", matchlen) == 0) { pu.b.b = GLOBUS_TRUE; } else { pu.b.b = GLOBUS_FALSE; } } } matchlen = (size_t) (matches[6].rm_eo - matches[6].rm_so); match = p + matches[6].rm_so; if (matches[6].rm_so != -1) { if (strncmp(match, "s", matchlen) == 0) { pu.type = CONDOR_STRING; pu.s.s = p + matches[7].rm_so; pu.s.len = (size_t) (matches[7].rm_eo - matches[7].rm_so); } else if (strncmp(match, "i", matchlen) == 0) { pu.type = CONDOR_INTEGER; pu.i.i = atoi(p + matches[7].rm_so); } else if (strncmp(match, "r", matchlen) == 0) { pu.type = CONDOR_REAL; sscanf(p + matches[7].rm_so, "%f", &pu.r.r); } else if (strncmp(match, "e", matchlen) == 0) { /* ? */ pu.type = CONDOR_STRING; pu.s.s = p + matches[7].rm_so; pu.s.len = (size_t) (matches[7].rm_eo - matches[7].rm_so); } } switch (condor_attr) { case EVENT_TYPE_NUMBER: globus_assert (pu.type == CONDOR_INTEGER); event_type_number = pu.i.i; break; case EVENT_TIME: globus_assert (pu.type == CONDOR_STRING); event_time = pu.s.s; globus_strptime( (char *) event_time, "%Y-%m-%dT%H:%M:%S", &event_tm); event_stamp = mktime(&event_tm); break; case CLUSTER: globus_assert (pu.type == CONDOR_INTEGER); cluster = pu.i.i; break; case PROC: globus_assert (pu.type == CONDOR_INTEGER); proc = pu.i.i; break; case SUBPROC: globus_assert (pu.type == CONDOR_INTEGER); subproc = pu.i.i; break; case TERMINATED_NORMALLY: globus_assert (pu.type == CONDOR_BOOLEAN); terminated_normally = pu.b.b; break; case RETURN_VALUE: globus_assert (pu.type == CONDOR_INTEGER); return_value = pu.i.i; break; case DONTCARE: default: break; } p = p + matches[1].rm_eo; } p = e; parsed_length += event_length; event = NULL; switch (event_type_number) { case 0: /* SubmitEvent */ event = calloc(1, sizeof(globus_scheduler_event_t)); event->event_type = GLOBUS_SCHEDULER_EVENT_PENDING; event->job_id = globus_common_create_string("%03d.%03d.%03d", cluster, proc, subproc); event->timestamp = event_stamp; globus_fifo_enqueue(events, event); break; case 1: /* ExecuteEvent */ event = calloc(1, sizeof(globus_scheduler_event_t)); event->event_type = GLOBUS_SCHEDULER_EVENT_ACTIVE; event->job_id = globus_common_create_string("%03d.%03d.%03d", cluster, proc, subproc); event->timestamp = event_stamp; globus_fifo_enqueue(events, event); break; case 5: /* JobTerminatedEvent */ if (terminated_normally) { event = calloc(1, sizeof(globus_scheduler_event_t)); event->event_type = GLOBUS_SCHEDULER_EVENT_DONE; event->job_id = globus_common_create_string("%03d.%03d.%03d", cluster, proc, subproc); event->timestamp = event_stamp; event->exit_code = return_value; globus_fifo_enqueue(events, event); } else { case 9: /* JobAbortedEvent */ event = calloc(1, sizeof(globus_scheduler_event_t)); event->event_type = GLOBUS_SCHEDULER_EVENT_FAILED; event->job_id = globus_common_create_string("%03d.%03d.%03d", cluster, proc, subproc); event->timestamp = event_stamp; event->failure_code = return_value; globus_fifo_enqueue(events, event); } break; } if (event && event->timestamp > ref->seg_last_timestamp) { ref->seg_last_timestamp = event->timestamp; } } ref->seg_last_size += parsed_length; return 0; } /* globus_l_condor_parse_log() */ static int globus_l_condor_read_log( globus_gram_job_manager_t *manager, const char *path, size_t last_size, char **data) { int condor_log_fd; char *condor_log_data; struct stat st; struct flock flock_data; int rc = GLOBUS_SUCCESS; *data = NULL; condor_log_fd = open(path, O_RDONLY); if (condor_log_fd < 0) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.condor_poll.info " "level=TRACE " "message=\"%s\" " "errno=%d " "errstr=\"%s\" " "\n", "open failed", errno, strerror(errno)); rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_STATE_FILE; goto open_failed; } rc = fstat(condor_log_fd, &st); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.condor_poll.info " "level=TRACE " "message=\"%s\" " "errno=%d " "errstr=\"%s\" " "\n", "fstat failed", errno, strerror(errno)); rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto fstat_failed; } if (st.st_uid != getuid()) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.condor_poll.info " "level=TRACE " "message=\"%s\" " "uid.me=%ld " "uid.file=%ld " "\n", "uid mismatch", (long) getuid(), (long) st.st_uid); rc = GLOBUS_GRAM_PROTOCOL_ERROR_READING_STATE_FILE; goto uid_mismatch; } if (st.st_size <= last_size) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.condor_poll.info " "level=TRACE " "message=\"%s\" " "file=\"%s\" " "size.last_poll=%lld " "size.file=%lld " "\n", "file hasn't grown since last poll", path, (long long) last_size, (long long) st.st_size); goto not_grown; } flock_data.l_type = F_RDLCK; flock_data.l_whence = SEEK_SET; flock_data.l_start = 0; flock_data.l_len = 0; flock_data.l_pid = getpid(); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.condor_poll.info " "level=TRACE " "message=\"%s\" " "file=\"%s\" " "\n", "Checking file for new events", path); do { rc = fcntl(condor_log_fd, F_SETLKW, &flock_data); if (rc != 0 && errno != EINTR) { goto fcntl_lock_failed; } } while (rc == -1); { ssize_t read_res; size_t amt_to_read = st.st_size - last_size; size_t amt_read = 0; off_t off_rc; condor_log_data = malloc(amt_to_read + 1); if (condor_log_data == NULL) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.condor_poll.info " "level=WARN " "message=\"%s\" " "filename=\"%s\" " "size=%llu " "errno=%d " "reason=%s\n", "Error allocating memory for condor log", path, (unsigned long long) st.st_size, errno, strerror(errno)); rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto malloc_data_failed; } condor_log_data[amt_to_read] = 0; off_rc = lseek(condor_log_fd, (off_t) last_size, SEEK_SET); if (off_rc < 0) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.condor_poll.info " "level=WARN " "message=\"%s\" " "filename=\"%s\" " "size=%llu " "errno=%d " "reason=%s\n", "Error seeking in condor log", path, (unsigned long long) st.st_size, errno, strerror(errno)); rc = GLOBUS_GRAM_PROTOCOL_ERROR_TEMP_SCRIPT_FILE_FAILED; goto seek_failed; } while (amt_to_read > amt_read) { read_res = read( condor_log_fd, condor_log_data + amt_read, amt_to_read - amt_read); if (read_res < 0 && errno == EINTR) { continue; } else if (read_res > 0) { amt_read += read_res; } else { /* Some other error or short read */ break; } } if (amt_to_read != amt_read) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.condor_poll.info " "level=WARN " "message=\"%s\" " "filename=\"%s\" " "size=%llu " "amt_read=%llu " "errno=%d " "reason=%s\n", "Error reading condor log", path, (unsigned long long) st.st_size, (unsigned long long) amt_read, errno, strerror(errno)); goto read_failed; } *data = condor_log_data; rc = GLOBUS_SUCCESS; } if (rc != GLOBUS_SUCCESS) { read_failed: seek_failed: free(condor_log_data); } malloc_data_failed: fcntl_lock_failed: not_grown: uid_mismatch: fstat_failed: close(condor_log_fd); open_failed: return rc; } int globus_gram_job_manager_seg_parse_condor_id( globus_gram_jobmanager_request_t * request, char ** condor_idp) { char * condor_name; char * condor_data; globus_fifo_t events; int rc = GLOBUS_SUCCESS; time_t old_last_timestamp; globus_off_t old_last_size; char * condor_id; globus_gram_job_manager_ref_t * ref; globus_scheduler_event_t * event; *condor_idp = NULL; GlobusGramJobManagerLock(request->manager); ref = globus_hashtable_lookup( &request->manager->request_hash, request->job_contact_path); if (!ref) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_JOB_CONTACT_NOT_FOUND; goto no_ref; } condor_name = globus_common_create_string( "%s/condor.%s", request->config->job_state_file_dir, request->uniq_id); if (condor_name == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto name_malloc_fail; } rc = globus_l_condor_read_log( request->manager, condor_name, 0, &condor_data); if (rc != GLOBUS_SUCCESS || condor_data == NULL) { goto read_failed; } rc = globus_fifo_init(&events); if (rc != GLOBUS_SUCCESS) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto fifo_init_failed; } /* Don't want to affect the ref timestamp for these events, just * pull out the jobid value */ old_last_timestamp = ref->seg_last_timestamp; old_last_size = ref->seg_last_size; globus_l_condor_parse_log( condor_data, ref, &events); ref->seg_last_timestamp = old_last_timestamp; ref->seg_last_size = old_last_size; /* If there's any event in this file, then we'll assume that's the * job id base for this job and construct the subjob ids based on the * rsl count attribute */ if (!globus_fifo_empty(&events)) { event = globus_fifo_peek(&events); if (event->job_id != NULL) { int cluster; int count; int i; char *p; size_t subjob_len; rc = globus_gram_job_manager_rsl_attribute_get_int_value( request->rsl, GLOBUS_GRAM_PROTOCOL_COUNT_PARAM, &count); if (rc != GLOBUS_SUCCESS) { goto bad_count; } sscanf(event->job_id, "%d", &cluster); subjob_len = globus_libc_printf_length( "%03d.%03d.%03d,", cluster, count, 0); condor_id = malloc(subjob_len * count + 1); if (condor_id == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto condor_id_malloc_failed; } condor_id[0] = 0; p = condor_id; for (i = 0; i < count; i++) { int chars; chars = sprintf(p, "%03d.%03d.%03d,", cluster, i, 0); p += chars; } *(p-1) = 0; *condor_idp = condor_id; } } condor_id_malloc_failed: bad_count: /* * Should probably put these directly into the request's SEG event queue, * but for simplicity, just discard these here and let the regular poll * callback handle them. */ while (!globus_fifo_empty(&events)) { event = globus_fifo_dequeue(&events); globus_scheduler_event_destroy(event); } globus_fifo_destroy(&events); fifo_init_failed: free(condor_data); read_failed: free(condor_name); name_malloc_fail: no_ref: GlobusGramJobManagerUnlock(request->manager); return rc; } /* globus_gram_job_manager_seg_parse_condor_id() */ globus_gram_job_manager-13.53/ltmain.sh0000644000076400007640000060342611312032604015126 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_gram_job_manager-13.53/globus_job_manager_rsl_validation.dox0000666000076400007640000000711111620260407022732 00000000000000/** @page globus_gram_job_manager_rsl_validation_file RSL Validation File Format The idea behind the RSL Validation file is to provide a mechanism for job manager scheduler interfaces to implement RSL extensions, while having the job manager still be able to decide whether a job request contains a valid RSL string. In addition to indicating what RSL attributes are valid, the RSL validation file contains information about when the RSL attribute may be used, it's default value, and the format of the attribute's value. @section validation_file_format File Format @subsection validation_comments Comments The RSL validation file may contain comments. Comments are indicated in the file by a line beginning with the # character. Comments continue until end-of-line. Comments are discarded by the RSL Validation File parser. Example: @code # I am a comment. Ignore me. @endcode @subsection validation_records ValidationRecords The RSL validition file consists of a set of ValidationRecords. Each ValidationRecord consists of a number of ValidationProperties associated with a single RSL attribute. ValidationRecords are separated by a blank line in the RSL validation file. @subsection validation_properties Validation Properties A ValidationProperty is defined in the RSL validation file by a PropertyName and a PropertyValue. The syntax of a validation property is simply the PropertyName followed by a colon character, followed by a PropertyValue. If a PropertyValue begins with a double-quote, then it may span multiple lines. Double-quote characters within a multiline PropertyValue must be escaped by a preceding backslash character. An unquoted PropertyValue ends at the first newline character. Example: @code Attribute: directory Description: "Specifies the path of the directory the jobmanager will use as the default directory for the requested job." @endcode @subsection rsl_validation_record_types Defined PropertyNames The following PropertyNames are understood by this version of the RSL validation file parser. Any unknown PropertyName will cause the ValidationProprty to be ignored by the parser. @par Attribute The name of the RSL parameter to which this record refers. @par Description A textual description of what the RSL parameter means. @par Default The default value of the RSL parameter if it is not found in the RSL. The default value is only used if the DefaultWhen value matches the current validation mode. @par Values A string containing whitespace-separated list of enumerated values which are valid for this RSL attribute. For example, for the "dryrun" parameter, this may be "yes no". @par RequiredWhen Some subset of the "when strings" (@ref when_strings "see below"), indicating when the RSL parameter is required for the RSL to be valid. @par DefaultWhen Some subset of the "when strings" (@ref when_strings "see below") indicating when then RSL's default value will be used if the RSL attribute is not present in the RSL. @par ValidWhen Some subset of the "when strings" (@ref when_strings "see below") indicating when then RSL attribute may be used. @subsection when_strings "When" Strings The set of when strings understood by the RSL validation file parser are @par GLOBUS_GRAM_JOB_SUBMIT The RSL attribute pertains to job submission. @par GLOBUS_GRAM_JOB_MANAGER_RESTART The RSL attribute pertains to job manager restart. @par GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE The RSL attribute pertains to the STDIO_UPDATE signal. */ globus_gram_job_manager-13.53/scripts/0000775000076400007640000000000012145177165015065 500000000000000globus_gram_job_manager-13.53/scripts/create_rsl_documentation.pl0000666000076400007640000000626711735076151022430 00000000000000#! /usr/bin/env perl if ($ARGV[0] eq '-x') { shift(@ARGV); %values = &read_input(); &print_xml(%values); } else { %values = &read_input(); &print_html(%values); } sub print_html { print < rsl 5 University of Chicago rsl GRAM5 RSL Attributes Description EOF foreach(sort keys %values) { my $shortname; my $default_value = ""; $shortname = lc($_); $shortname =~ s/_//g; next if($values{$_}{Publish} eq "false"); if (exists $values{$_}{Default}) { $default_value = " [Default: " . $values{$_}{Default} . "]"; } print < $_ $values{$_}{Description}$default_value EOF } print < EOF } sub read_input { my %result; my $record = ""; while(<>) { s/#.*//; if($_ ne "\n") { $record .= $_; } else { &insert_record(\%result, $record); $record = ""; } } &insert_record(\%result, $record); return %result; } sub insert_record { my $hash = shift; my $data = shift; my %result; my $attribute; my $value; my $in_multiline = 0; foreach (split(/\n/, $data)) { if($in_multiline) { $value .= $_; if($value =~ m/[^\\]"/) { $value =~ s/\s+/ /g; $in_multiline = 0; $value =~ s/\\"/"/g; $value =~ s/^"//; $value =~ s/"$//; } else { next; } } else { ($attribute, $value) = split(/:/, $_, 2); if($value =~ m/^\s*".*[^"]$/) { # multiline value $in_multiline = 1; } elsif ($value =~ m/^\s*"[^"]*"$/) { $value =~ s/^\s*"/ /; $value =~ s/"$//; } $value =~ s/^\s*//; if($in_multiline) { if($value =~ m/[^\\]"/) { $value =~ s/\s+/ /g; $in_multiline = 0; $value =~ s/\\"/"/g; $value =~ s/^"//; $value =~ s/"$//; } } } $result{$attribute} = $value; } $attribute = $result{Attribute}; foreach (keys %result) { $hash->{$attribute}{$_} = $result{$_}; } } globus_gram_job_manager-13.53/scripts/Makefile.am0000666000076400007640000000020010441622753017026 00000000000000include $(top_srcdir)/globus_automake_pre EXTRA_DIST = create_rsl_documentation.pl include $(top_srcdir)/globus_automake_post globus_gram_job_manager-13.53/scripts/Makefile.in0000664000076400007640000003035112145177133017047 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 = scripts 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_CLEAN_FILES = 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@ AUDITDIR = @AUDITDIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ 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@ GENERATE_MANPAGES_FALSE = @GENERATE_MANPAGES_FALSE@ GENERATE_MANPAGES_TRUE = @GENERATE_MANPAGES_TRUE@ GLOBUS_FLAVOR_NAME = @GLOBUS_FLAVOR_NAME@ GLOBUS_TOOLKIT_VERSION = @GLOBUS_TOOLKIT_VERSION@ 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@ LOGDIR = @LOGDIR@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJECT_MODE = @OBJECT_MODE@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ 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@ REBUILD_PARSER_FALSE = @REBUILD_PARSER_FALSE@ REBUILD_PARSER_TRUE = @REBUILD_PARSER_TRUE@ REBUILD_SCANNER_FALSE = @REBUILD_SCANNER_FALSE@ REBUILD_SCANNER_TRUE = @REBUILD_SCANNER_TRUE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITHOUT_FLAVORS_FALSE = @WITHOUT_FLAVORS_FALSE@ WITHOUT_FLAVORS_TRUE = @WITHOUT_FLAVORS_TRUE@ XML2_CONFIG = @XML2_CONFIG@ XMLLINT = @XMLLINT@ XML_CATALOG_PATH = @XML_CATALOG_PATH@ XML_CPPFLAGS = @XML_CPPFLAGS@ XML_LIBS = @XML_LIBS@ XSLTPROC = @XSLTPROC@ 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 EXTRA_DIST = create_rsl_documentation.pl 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 scripts/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign scripts/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: 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 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 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-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 check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am 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_gram_job_manager-13.53/depcomp0000755000076400007640000003710012145177133014665 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: globus_gram_job_manager-13.53/configuration.dox0000666000076400007640000001257711674135507016717 00000000000000/** @page globus_gram_job_manager_configuration Job Manager Configuration The Job Manager is generally configured using the setup-globus-gram-job-manager setup script. This section of the Job Manager manual describes all options which may be passed to the GRAM Job Manager in the configuration file $GLOBUS_LOCATION/etc/globus-job-manager.conf. @section globus_gram_job_manager_configuration_opts Configuration File Options @par -k Indicate that the job manager was built with the kerberos GSSAPI instead of GSI. This disables checks for a delegated GSI credential. @par -home GLOBUS_LOCATION Set the GLOBUS_LOCATION environment variable to the specified Globus-Location. @par -target-globus-location GLOBUS_LOCATION Set the GLOBUS_LOCATION environment variable to the execution node's GLOBUS_LOCATION, if different than the GRAM node's GLOBUS_LOCATION @par -type JOB_MANAGER_TYPE Set the type of scheduler interface to use for this job manager. A similarly named Perl module in the $GLOBUS_LOCATION/lib/perl/Globus/GRAM/JobManager/ directory is needed. @par -history PATH Set the path to the directory to store job history files. @par -cache-location PATH Set the path for the GASS cache. This path must be unique for each user. RSL substitutions (such as $(HOME) and $(LOGNAME)) may be used in this path. See @ref globus_gram_job_manager_rsl_subs for a list of available RSL substitutions. @par -extra-envvars VAR1[=VAL],VAR2,... The Job manager will attempt to get the listed VARs from its environment and set them the same for the job's environment. For example, -extra-envvars LD_LIBRARY_PATH,GLOBUS_TCP_PORT_RANGE @par -scratch-dir-base PATH Set the default scratch directory root for the job manager. Job-specific scratch directories will be created as a subdirectory of this directory. RSL substitutions (such as $(HOME) and $(LOGNAME)) may be used in this path. See @ref globus_gram_job_manager_rsl_subs for a list of available RSL substitutions. If this option is not present in the configuration file, then the job manager will create scratch directories as subdirectories of the user's home directory. @par -condor-arch ARCH Set the condor architecture for this job manager to be the specified ARCH. This is optional when the job manager type is @a condor. @par -condor-os OSNAME Set the condor operating system name for this job manager to be the specified OSNAME. This is optional when the job manager type is @a condor. @par -globus-gatekeeper-host HOST Set the name of the gatekeeper host. This will be made available in the GLOBUS_GATEKEEPER_HOST RSL substitution. @par -globus-gatekeeper-port PORT Set the TCP port of the gatekeeper. This will be made available in the GLOBUS_GATEKEEPER_PORT RSL substitution. @par -globus-gatekeeper-subject SUBJECT Set the GSI subject name of the gatekeeper. This will be made available in the GLOBUS_GATEKEEPER_SUBJECT RSL substitution. @par -globus-host-manufacturer MANUFACTURER Set the manufacturer name of the host machine. This will be made available in the GLOBUS_HOST_MANUFACTURER RSL substitution. @par -globus-host-cputype CPUTYPE Set the cpu type of the host machine. This will be made available in the GLOBUS_HOST_CPUTYPE RSL substitution. @par -globus-host-osname OSNAME Set the operating system name of the host machine. This will be made available in the GLOBUS_HOST_OSNAME RSL substitution. @par -globus-host-osversion OSVERSION Set the operating system version of the host machine. This will be made available in the GLOBUS_HOST_OSVERSION RSL substitution. @par -globus-tcp-port-range RANGE Set the range of TCP port numbers which the job manager will use. This will also be made available in the GLOBUS_TCP_PORT_RANGE environment variable and RSL substitution. @par -globus-tcp-source-range RANGE Set the range of TCP source port numbers which the job manager will use. This will also be made available in the GLOBUS_TCP_SOURCE_RANGE environment variable and RSL substitution. @par -state-file-dir PATH Set the path to store job manager state files (used for restarting a job manager which fails). If this is not set, then job state files will be stored in the $GLOBUS_LOCATION/tmp/gram_job_state directory. @par -x509-cert-dir PATH Set the path to the X.509 trusted certificate directory on the job execution hosts. If not present, then the trusted certificate directory used by the job manager (usually set by the Gatekeeper) will be used @par -seg-module MODULE Use the named module as a way to interact with the scheduler instead of polling for job status. @par -audit-directory DIRECTORY Store job auditing records in DIRECTORY. This directory should be sticky and group writable but not group readable. Audit records can be uploaded to a database by using the globus-gram-audit command. @par -globus-toolkit-version VERSION-STRING Use the string VERSION-STRING as the toolkit version in audit records. @par -enable-syslog Send log messages to the system log. @par -stdio-log LOG_DIRECTORY Obsolete way to set the directory for writing log messages. Messages will be written to LOG_DIRECTORY/gram_DATE.log. Use -log-pattern instead @par -log-pattern PATTERN RSL-substituted pattern for naming log files. Possible variables are HOME, LOGNAME, DATE. The -stdio-log is equivalent to -log-pattern $(HOME)/gram_$(DATE).log @par -log-levels [FATAL|ERROR|WARN|DEBUG|INFO|TRACE] List of log levels to enable site-wide. These may be joined by the '|' character. */ globus_gram_job_manager-13.53/globus-personal-gatekeeper.in0000777000076400007640000003323711753256311021104 00000000000000#!/bin/sh # # 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. # PACKAGE=@PACKAGE@ VERSION=@VERSION@ DIRT_TIMESTAMP=1028570784 DIRT_BRANCH_ID=23 @GLOBUS_SCRIPT_INITIALIZER@ . ${libexecdir}/globus-script-initializer globus_source ${libexecdir}/globus-sh-tools.sh short_usage="globus-personal-gatekeeper [-help] [-start] [-list] [-killall] ..." long_usage () { ${GLOBUS_SH_CAT-cat} >&2 <] [-auditdir ] [-port ] [-log[=DIRECTORY]] [-seg] [-acctfile file] Starts a new gatekeeper, mapping default service to a jobmanager. By default, the jobmanager is configured with jmtype=fork. The option -port can be used to restrict the gatekeeper to use a particular port. The default is to let the system choose a port. The -log switch causes the job manager to write log messages to files in DIRECTORY. If -seg is used, then the Scheduler Event Generator will be used to poll job state. The -auditdir switch tells the jobmanager where to store the audit-records. The -acctfile switch tells the gatekeeper where to log accounting records. -list Scans for active personal gatekeepers. If found, an authentication test is made to determine if the gatekeeper is still functioning. If the authentictation test succeeds, the contact to that gatekeeper is printed out. -directory Returns the temporary directory used by the personal gatekeeper associated with . The directory contains grid-mapfile, log file, etc. -kill Finds and kills the personal gatekeeper associated with . -killall Finds all personal gatekeepers running on the local host and kills them. EOF } globus_source ${libexecdir}/globus-args-parser-header $* debug=: verify_setup () { hours="" ${debug} "verifying setup..." if test "$1" != 'kill'; then hours="-hours 1" fi ${bindir}/grid-proxy-info -exists $hours if [ $? -ne 0 ]; then echo "ERROR: no valid proxy, or lifetime to small (one hour)" >&2 exit 1 fi ${debug} "done." } get_jm_arg_value() { desired="$1" shift while [ "$#" -gt 0 ]; do if [ "$1" = "$desired" ]; then echo "$2" break fi shift; done } killem () { found=false foundit=false if test -z "${GLOBUS_SH_WHOAMI}"; then if test -z "${LOGNAME}"; then user=$USER else user=$LOGNAME fi else user=`${GLOBUS_SH_WHOAMI}` fi for dir in `ls -1d ${file_location}/${file_prefix}* 2> /dev/null` do if [ -n "${dir}" ]; then found=true if [ -r ${dir}/gatekeeper.log ]; then contact="`${GLOBUS_SH_GREP-grep} 'GRAM contact' ${dir}/gatekeeper.log | ${GLOBUS_SH_TAIL-tail} -1 | ${GLOBUS_SH_SED-sed} 's/^.*GRAM contact: //'`" ${debug} "found contact= [${contact}]" fi dokill=false if [ -z "$1" ]; then dokill=true else if [ "$1" = "$contact" ]; then dokill=true foundit=true fi fi if [ $dokill = true ]; then echo "killing gatekeeper: \"${contact}\"" if [ -r ${dir}/gatekeeper.pid ]; then pid=`${GLOBUS_SH_CAT-cat} ${dir}/gatekeeper.pid` ${GLOBUS_SH_KILL-kill} -9 $pid & fi cd statedir="${TMPDIR:-/tmp}/${user}/`echo \"${dir}\" | sed -e 's|.*/||'`" if [ -r ${dir}/jobmanager.conf ]; then host=`${bindir}/globus-hostname | ${GLOBUS_SH_CUT-cut} -d. -f1` args=`cat "${dir}/jobmanager.conf"` service_tag="`eval get_jm_arg_value -service-tag $args`" if [ "$service_tag" = "" ]; then service_tag=untagged fi lrm="`eval get_jm_arg_value -type $args`" tagged="$HOME/.globus/job/$host/$lrm.$service_tag" pidfile="$tagged.pid" sockfile="$tagged.sock" lockfile="$tagged.lock" credfile="$tagged.cred" jmpid="" if [ -r "$pidfile" ]; then read jmpid < "$pidfile" fi if [ "$jmpid" != "" ]; then kill $jmpid fi [ -e "$pidfile" ] && ${GLOBUS_SH_RM-rm} "$pidfile" [ -e "$sockfile" ] && ${GLOBUS_SH_RM-rm} "$sockfile" [ -e "$lockfile" ] && ${GLOBUS_SH_RM-rm} "$lockfile" [ -e "$credfile" ] && ${GLOBUS_SH_RM-rm} "$credfile" fi ${GLOBUS_SH_RM-rm} -rf ${dir} & ${GLOBUS_SH_RM-rm} -rf "${statedir}" & fi fi done if [ $found = false ]; then echo "No personal gatekeepers found on this host." fi if [ -n "$1" -a ${foundit} = false ]; then echo "Could not find the personal gatekeeper you specified." fi } findit () { foundit=false for dir in `ls -1d ${file_location}/${file_prefix}* 2>/dev/null` do if [ -n "${dir}" ]; then found=true if [ -r ${dir}/gatekeeper.log ]; then contact="`${GLOBUS_SH_GREP-grep} 'GRAM contact' ${dir}/gatekeeper.log | ${GLOBUS_SH_TAIL-tail} -1 | ${GLOBUS_SH_SED-sed} 's/^.*GRAM contact: //'`" if [ "$1" = "$contact" ]; then foundit=true echo "${dir}" fi fi fi done if [ ${foundit} = false ]; then echo "Could not find the personal gatekeeper you specified." fi } listem () { found=false foundold=false for dir in `ls -1d ${file_location}/${file_prefix}* 2> /dev/null` do if [ -n "${dir}" ]; then found=true if [ -r ${dir}/gatekeeper.log ]; then contact="`${GLOBUS_SH_GREP-grep} 'GRAM contact' ${dir}/gatekeeper.log | ${GLOBUS_SH_TAIL-tail} -1 | ${GLOBUS_SH_SED-sed} 's/^.*GRAM contact: //'`" ${debug} "found contact= [${contact}]" ${bindir}/globusrun -a -r "${contact}" 1>/dev/null 2>/dev/null if [ $? -eq 0 ]; then echo "${contact}" else ${debug} "could not authenticate to the contact -- old" foundold=true fi fi fi done if [ $found = false ]; then echo "" echo "no personal gatekeepers found on this host" fi if [ $foundold = true ]; then echo "" echo "Found old non-functioning personal gatekeeper(s). Please use" echo "this command with the -killall option to clean them up." fi } cleanup () { if [ ${docleanup} = true ]; then ${GLOBUS_SH_RM-rm} -rf ${scratch} ${GLOBUS_SH_RM-rm} -rf ${statefiledir} docleanup=false fi } jmtype=fork port= docleanup=false startnew=false host=`${bindir}/globus-hostname| ${GLOBUS_SH_CUT-cut} -d. -f1` file_location="$HOME/.globus/." file_prefix="gram.$host" log=never seg=0 startargs='' single='' logdir="" valgrind=0 while [ -n "$1" ]; do case "$1" in -kill) verify_setup kill killem "$2" exit 0 ;; -killall) verify_setup kill killem "" exit 0 ;; -list) listem exit 0 ;; -directory) findit "$2" exit 0 ;; -start) startnew=true shift while [ -n "$1" ]; do case $1 in -jmtype) jmtype="$2" shift ;; -log*) logdir=`expr "$1" : "-log=\(.*\)"` if [ "$logdir" = "" ]; then logdir="$HOME" fi ;; -single) single="$1" ;; -valgrind) valgrind=1 ;; -port) port="$2" shift ;; -seg) seg=1 ;; -auditdir) auditdir="$2" shift ;; -acctfile) acctfile="$2" shift; ;; *) startargs="$startargs $1" ;; esac shift done break ;; -debug) debug=echo ;; *) globus_args_unrecognized_option "$1" ;; esac shift done if [ $startnew != true ]; then globus_args_short_usage exit 1 fi if test -z "${GLOBUS_SH_WHOAMI}"; then if test -z "${LOGNAME}"; then user=$USER else user=$LOGNAME fi else user=`${GLOBUS_SH_WHOAMI}` fi if test -z "${user}"; then echo "ERROR: globus-personal-gatekeeper: can not determine user name" >&2 exit 1 fi verify_setup scratch="${file_location}/${file_prefix}.$$" statefiledir="${TMPDIR:-/tmp}/${user}/${file_prefix}.$$" trap cleanup 0 1 2 3 6 9 12 15 docleanup=true ${GLOBUS_SH_MKDIR-mkdir} -p ${scratch} ${GLOBUS_SH_MKDIR-mkdir} -p "${statefiledir}" if test $? != 0; then echo "Error making state file dir (${statefiledir})." 1>&2 exit 1 fi for file in gridmap services.conf gatekeeper.conf jobmanager.conf gatekeeper.log ; do ${GLOBUS_SH_RM-rm} -f ${scratch}/${file} done subject=`${bindir}/grid-proxy-info -identity` ${GLOBUS_SH_CAT-cat} > ${scratch}/gridmap <&2 exit 1 fi ${GLOBUS_SH_CAT-cat} > ${scratch}/jobmanager < ${scratch}/jobmanager < ${scratch}/gatekeeper.conf <> ${scratch}/gatekeeper.conf fi if [ ! -z "${acctfile}" ]; then echo "-acctfile $acctfile" >> ${scratch}/gatekeeper.conf fi host_info=`${libexecdir}/config.guess` host_cputype=`echo $host_info | ${GLOBUS_SH_AWK-awk} -F'-' '{print $1}'` host_manufacturer=`echo $host_info | ${GLOBUS_SH_AWK-awk} -F'-' '{print $2}'` host_osname=`${GLOBUS_SH_UNAME-uname} -s` host_osversion=`${GLOBUS_SH_UNAME-uname} -r` if [ "$logdir" != "" ]; then log_line=`echo "-stdio-log \"$logdir\""` log_levels="-log-levels 'FATAL|ERROR'" fi if [ -x "${bindir}/globus-version" ]; then globus_toolkit_version="`${bindir}/globus-version`" else globus_toolkit_version="Unknown" fi ${GLOBUS_SH_CAT-cat} > ${scratch}/jobmanager.conf <> ${scratch}/jobmanager.conf <> ${scratch}/jobmanager.conf fi echo "-globus-job-dir ${TMPDIR:-/tmp}" >> ${scratch}/jobmanager.conf docleanup=false ${sbindir}/globus-gatekeeper -c ${scratch}/gatekeeper.conf -test \ 1>/dev/null 2>/dev/null x=$? if [ $x -ne 0 ]; then echo "ERROR: gatekeeper was not properly configured" >&2 docleanup=true exit 1 fi ${sbindir}/globus-gatekeeper -c ${scratch}/gatekeeper.conf < /dev/null > /dev/null 2>/dev/null & x=$? pid=$! if [ $x -ne 0 ]; then echo "ERROR: gatekeeper did not start up properly" >&2 docleanup=true exit 1 fi echo "$pid" > ${scratch}/gatekeeper.pid contact= shallexit= count=0 while [ ${count} -lt 10 -a -z "${contact}" -a -z "${shallexit}" ]; do ${GLOBUS_SH_SLEEP-sleep} 1 contact="`${GLOBUS_SH_GREP-grep} 'GRAM contact' ${scratch}/gatekeeper.log`" shallexit="`${GLOBUS_SH_GREP-grep} FAILED_PLEASE_EXIT ${scratch}/gatekeeper.log`" count=`${GLOBUS_SH_EXPR-expr} ${count} + 1` done if [ ${count} -ge 10 -o -n "${shallexit}" ]; then echo "ERROR: gatekeeper did not start up properly" >&2 docleanup=true exit 1 else host=`echo "$contact" | ${GLOBUS_SH_CUT-cut} -d: -f5` port=`echo "$contact" | ${GLOBUS_SH_CUT-cut} -d: -f6` ${GLOBUS_SH_CAT-cat} >> ${scratch}/jobmanager.conf </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) $(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) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(globusconfigdir)" "$(DESTDIR)$(validationdir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-libtool clean-noinstLTLIBRARIES \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-docDATA install-globusconfigDATA install-man \ install-validationDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: install-binSCRIPTS install-sbinPROGRAMS install-info: install-info-recursive install-man: install-man1 install-man5 install-man8 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-binSCRIPTS uninstall-docDATA \ uninstall-globusconfigDATA uninstall-info-am uninstall-man \ uninstall-sbinPROGRAMS uninstall-validationDATA uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES clean-recursive clean-sbinPROGRAMS \ 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-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-data-hook install-docDATA install-exec \ install-exec-am install-globusconfigDATA install-info \ install-info-am install-man install-man1 install-man5 \ install-man8 install-sbinPROGRAMS install-strip \ install-validationDATA 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-binSCRIPTS uninstall-docDATA \ uninstall-globusconfigDATA uninstall-info-am uninstall-man \ uninstall-man1 uninstall-man5 uninstall-man8 \ uninstall-sbinPROGRAMS uninstall-validationDATA all: $(BUILT_SOURCES) globus_gram_job_manager_rsl.dox: globus-gram-job-manager.rvf perl $(top_srcdir)/scripts/create_rsl_documentation.pl < $< > $@ rsl.xml: globus-gram-job-manager.rvf perl $(top_srcdir)/scripts/create_rsl_documentation.pl -x < $< > $@ install-data-hook: mkdir -p $(DESTDIR)$(localstatedir)/lib/globus/gram_job_state chmod 1777 $(DESTDIR)$(localstatedir)/lib/globus/gram_job_state mkdir -p $(DESTDIR)$(logrotatedir) cp $(srcdir)/gram.logrotate $(DESTDIR)$(logrotatedir)/globus-job-manager mkdir -p $(DESTDIR)@LOGDIR@ chmod 1777 $(DESTDIR)@LOGDIR@ mkdir -p $(DESTDIR)$(sysconfdir)/globus/gram @GENERATE_MANPAGES_TRUE@export XML_CATALOG_FILES := $(XML_CATALOG_PATH) @GENERATE_MANPAGES_TRUE@$(man1_MANS) $(man5_MANS) $(man8_MANS): $(MANUAL_SOURCE) @GENERATE_MANPAGES_TRUE@ $(XMLLINT) --xinclude --dtdvalid http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd manual.xml > /dev/null @GENERATE_MANPAGES_TRUE@ $(XSLTPROC) --xinclude http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl manual.xml 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-binSCRIPTS link-docDATA link-globusconfigDATA link-sbinPROGRAMS link-validationDATA : unlink: unlink-recursive unlink-binSCRIPTS unlink-docDATA unlink-globusconfigDATA unlink-sbinPROGRAMS unlink-validationDATA : .PHONY: link unlink link-recursive unlink-recursive link-am unlink-am filelist-amlink-binSCRIPTS unlink-binSCRIPTS filelist-binSCRIPTS link-docDATA unlink-docDATA filelist-docDATA link-globusconfigDATA unlink-globusconfigDATA filelist-globusconfigDATA filelist-man1 filelist-man5 filelist-man8 link-sbinPROGRAMS unlink-sbinPROGRAMS filelist-sbinPROGRAMS link-validationDATA unlink-validationDATA filelist-validationDATA filelist: filelist-recursive filelist-binSCRIPTS filelist-docDATA filelist-globusconfigDATA filelist-man1 filelist-man5 filelist-man8 filelist-sbinPROGRAMS filelist-validationDATA : link-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ mydir=`pwd`; \ target_p=$(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ 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; \ else 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 :; fi; fi; \ done unlink-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ target_p=$(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ 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-binSCRIPTS: @list='$(bin_SCRIPTS)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo "$(bindir)/$$p" | sed -e 's!^$(prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_pgm.filelist"; \ done 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-globusconfigDATA: $(globusconfig_DATA) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(globusconfigdir) @list='$(globusconfig_DATA)'; for p in $$list; do \ mydir=`pwd`; \ target_p=$(DESTDIR)$(globusconfigdir)/$$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-globusconfigDATA: @$(NORMAL_UNINSTALL) @list='$(globusconfig_DATA)'; for p in $$list; do \ target_p=$(DESTDIR)$(globusconfigdir)/$$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-globusconfigDATA: @list='$(globusconfig_DATA)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ dirname='globusconfig'; \ origp="$$p" ; \ p="`echo $(globusconfigdir)/$$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 filelist-man1: $(man1_MANS) $(man_MANS) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(man1dir)/$$inst | sed -e 's!^$(prefix)!!'`"; \ echo $$p >> "$${filelistdir}/noflavor_doc.filelist"; \ done filelist-man5: $(man5_MANS) $(man_MANS) @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(man5dir)/$$inst | sed -e 's!^$(prefix)!!'`"; \ echo $$p >> "$${filelistdir}/noflavor_doc.filelist"; \ done filelist-man8: $(man8_MANS) $(man_MANS) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo $(man8dir)/$$inst | sed -e 's!^$(prefix)!!'`"; \ echo $$p >> "$${filelistdir}/noflavor_doc.filelist"; \ done link-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ mydir=`pwd`; \ target_p=$(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ 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; \ else :; fi; \ done unlink-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ target_p=$(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ 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-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ if test "$(GPT_LINKTYPE)" = "shared"; then \ filelisttype="pgm"; \ else \ filelisttype="pgm_static"; \ fi; \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ p="`echo "$(sbindir)/$$p" | sed -e 's!^$(exec_prefix)!!'`"; \ echo "$$p" >> "$${filelistdir}/${GLOBUS_FLAVOR_NAME}_$${filelisttype}.filelist"; \ done link-validationDATA: $(validation_DATA) @$(NORMAL_INSTALL) @$(mkinstalldirs) $(DESTDIR)$(validationdir) @list='$(validation_DATA)'; for p in $$list; do \ mydir=`pwd`; \ target_p=$(DESTDIR)$(validationdir)/$$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-validationDATA: @$(NORMAL_UNINSTALL) @list='$(validation_DATA)'; for p in $$list; do \ target_p=$(DESTDIR)$(validationdir)/$$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-validationDATA: @list='$(validation_DATA)'; for p in $$list; do \ filelistdir="`echo $(FILELIST_FILE) | sed -e 's!/[^/]*$$!!'`"; \ dirname='validation'; \ origp="$$p" ; \ p="`echo $(validationdir)/$$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_gram_job_manager-13.53/startup_socket.c0000666000076400007640000022716712145172466016554 00000000000000/* * Copyright 1999-2009 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_DONT_DOCUMENT_INTERNAL /** * @file start_socket.c Job Manager Socket Transfer Code * * CVS Information: * $Source: /home/globdev/CVS/globus-packages/gram/jobmanager/source/startup_socket.c,v $ * $Date: 2013/05/16 15:03:18 $ * $Revision: 1.19.2.9 $ * $Author: bester $ */ #include "globus_common.h" #include "globus_gram_job_manager.h" #include "globus_gsi_credential.h" #include "globus_xio.h" #include #include #include #include /* If there exists a system which doesn't define the RFC 2292 extensions * CMSG_SPACE and CMSG_LEN, add macro definitions in the #ifndef sections * below */ #ifndef CMSG_SPACE #error "CMSG_SPACE not defined, unknown padding needed for struct cmsghdr" #endif #ifndef CMSG_LEN #error "CMSG_LEN not defined, unknown data padding needed for struct cmsghdr" #endif static const char * globus_l_gatekeeper_env[] = { "REMOTE_ADDR", "REQUEST_METHOD", "SCRIPT_NAME", "CONTENT_LENGTH", "GATEWAY_INTERFACE", "SSL_CLIENT_CERT", NULL }; static globus_result_t globus_l_gram_create_handle( int sock, globus_xio_handle_t * handle); static void globus_l_gram_startup_socket_callback( 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); static int globus_l_create_starter_connect_socket( globus_gram_job_manager_t * manager, int * sockptr); static int globus_l_encode_gatekeeper_env( struct iovec *iov); static int globus_l_decode_gatekeeper_env( const char *p, size_t len, char **remote_addr, size_t *content_length, globus_gsi_cred_handle_t *cred_handle); static int globus_l_blocking_send_length_and_fds( int fd, int msg_length, int * fds, int fd_count); static int globus_l_blocking_writev( int fd, struct iovec * iov, int iovcnt); static int globus_l_blocking_read( int fd, void *buf, int len); static void globus_l_remove_proxy( gss_buffer_t buffer); globus_xio_driver_t globus_i_gram_job_manager_file_driver; globus_xio_stack_t globus_i_gram_job_manager_file_stack; #endif /** * Acquire the lock file for the job manager * * The globus_gram_job_manager_startup_lock() attempts to lock the job * manager's lock file. If successful then this job manager must become the * main job manager to manage jobs for this particular resource. * * This function can fail in two main ways: if the lock fails because another * process owns a lock, it returns GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE; * otherwise, it returns GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE. * * @param manager * Pointer to job manager state * @param lock_fd * Pointer to set to the lock file descriptor. * * @retval GLOBUS_SUCCESS * Success * @retval GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE * Error locking state file * @retval GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE * Old job manager alive */ int globus_gram_job_manager_startup_lock( globus_gram_job_manager_t * manager, int * lock_fd) { int rc = 0; int lockfd = -1; int i; int flags; enum { GRAM_RETRIES = 100 }; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.startup_lock.start " "level=DEBUG " "path=\"%s\" " "\n", manager->lock_path); /* Create and lock lockfile */ for (i = 0, lockfd = -1; lockfd < 0 && i < GRAM_RETRIES; i++) { lockfd = open(manager->lock_path, O_RDWR|O_CREAT, S_IRWXU); } if (lockfd < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup_lock.end " "level=ERROR " "status=%d " "path=\"%s\" " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", -rc, manager->lock_path, "Error opening state lock file", errno, strerror(errno)); goto lockfd_open_failed; } flags = fcntl(lockfd, F_GETFD); if (flags < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup_lock.end " "level=ERROR " "status=%d " "path=\"%s\" " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", -rc, manager->lock_path, "Error getting file descriptor flags", errno, strerror(errno)); goto fcntl_lockfd_failed; } flags |= FD_CLOEXEC; if (fcntl(lockfd, F_SETFD, flags) < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup_lock.end " "level=ERROR " "status=%d " "path=\"%s\" " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", -rc, manager->lock_path, "Error setting close-on-exec flag for lock file", errno, strerror(errno)); goto fcntl_lockfd_failed; } rc = globus_gram_job_manager_file_lock(lockfd); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.startup_lock.end " "level=DEBUG " "status=%d " "path=\"%s\" " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", -rc, manager->lock_path, "Unable to lock file, perhaps another job manager is running", errno, strerror(errno)); goto lock_failed; } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.startup_lock.end " "level=DEBUG " "path=\"%s\" " "status=%d " "\n", manager->lock_path, rc); } if (rc != GLOBUS_SUCCESS) { lock_failed: fcntl_lockfd_failed: close(lockfd); lockfd = -1; } lockfd_open_failed: *lock_fd = lockfd; return rc; } /* globus_gram_job_manager_startup_lock() */ /** * Create socket to handle startup messages from other job managers * * Creates a UNIX domain socket, binds it to a well-known user-and lrm-specific * filename, and then creates and registers an XIO handle for select. * * @param manager * Manager to create the socket for. * @param handle * Pointer to XIO handle to be set to the socket descriptor. * @param socket_fd * Pointer to file descriptor pointing to the UNIX domain socket. */ int globus_gram_job_manager_startup_socket_init( globus_gram_job_manager_t * manager, globus_xio_handle_t * handle, int * socket_fd) { static unsigned char byte[1]; int sock = -1; int rc = 0; globus_result_t result; struct sockaddr_un addr; mode_t old_umask; int i; int rcvbuf; int flags; int save_errno; FILE * fp; enum { GRAM_RETRIES = 100 }; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.startup_socket_init.start level=DEBUG\n"); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.startup_socket_init.write_pid.start " "level=TRACE " "path=\"%s\" " "\n", manager->pid_path); fp = fopen(manager->pid_path, "w"); if (fp == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_STATE_FILE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup_socket_init.write_pid.end " "level=ERROR " "path=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", manager->pid_path, -rc, "Error opening pid file", errno, strerror(errno)); goto open_pid_failed; } rc = fprintf(fp, "%ld\n", (long) getpid()); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_STATE_FILE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup_socket_init.write_pid.end " "level=ERROR " "path=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", manager->pid_path, -rc, "Error writing to pid file", errno, strerror(errno)); goto write_pid_failed; } rc = fclose(fp); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_WRITING_STATE_FILE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup_socket_init.write_pid.end " "level=ERROR " "path=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", manager->pid_path, -rc, "Error writing to pid file", errno, strerror(errno)); goto close_pid_failed; } fp = NULL; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.startup_socket_init.write_pid.end " "level=TRACE " "path=\"%s\" " "status=%d " "\n", manager->pid_path, 0); /* create and bind socket */ globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.startup_socket_init.create_socket.start " "level=TRACE " "path=\"%s\" " "\n", manager->socket_path); memset(&addr, 0, sizeof(struct sockaddr_un)); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, manager->socket_path, sizeof(addr.sun_path)-1); sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup_socket_init.create_socket.end " "level=ERROR " "path=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", manager->socket_path, -rc, "Error creating socket", errno, strerror(errno)); goto socket_failed; } rcvbuf = 10 * GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE; rc = setsockopt(sock, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup_socket_init.create_socket.end " "level=ERROR " "path=\"%s\" " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", manager->socket_path, -rc, "Error setting socket buffer size", errno, strerror(errno)); goto setsockopt_failed; } old_umask = umask(S_IRWXG|S_IRWXO); (void ) remove(addr.sun_path); for (rc = -1, i = 0; rc < 0 && i < GRAM_RETRIES; i++) { rc = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); if (rc < 0) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.startup_socket_init.create_socket " "level=WARN " "path=\"%s\" " "tries=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", manager->socket_path, i+1, "Error binding socket to filesystem", errno, strerror(errno)); remove(addr.sun_path); } } save_errno = errno; (void) umask(old_umask); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_LOCKING_STATE_LOCK_FILE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup.socket.create_socket.end " "level=ERROR " "status=%d " "path=\"%s\" " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", -rc, manager->socket_path, "Error binding socket to filesystem", save_errno, strerror(save_errno)); goto bind_failed; } flags = fcntl(sock, F_GETFD); if (flags < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup.socket.create_socket.end " "level=ERROR " "status=%d " "path=\"%s\" " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", -rc, manager->socket_path, "Error getting socket flags", errno, strerror(errno)); goto fcntl_failed; } flags |= FD_CLOEXEC; if (fcntl(sock, F_SETFD, flags) < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup.socket.create_socket.end " "level=ERROR " "status=%d " "path=\"%s\" " "msg=\"%s\" " "errno=%d " "reason=\"%s\"\n", -rc, manager->socket_path, "Error getting socket flags", errno, strerror(errno)); goto fcntl_failed; } listen(sock, 8); result = globus_l_gram_create_handle( sock, handle); if (result != GLOBUS_SUCCESS) { char * errstr; char * errstr_escaped; errstr = globus_error_print_friendly(globus_error_peek(result)); errstr_escaped = globus_gram_prepare_log_string(errstr); rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_FAILED_ALLOW_ATTACH; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup.socket.create_socket.end " "level=ERROR " "status=%d " "path=\"%s\" " "msg=\"%s\" " "reason=\"%s\"\n", -rc, manager->socket_path, "Error creating xio handle from socket", errstr_escaped ? errstr_escaped : ""); if (errstr) { free(errstr); } if (errstr_escaped) { free(errstr_escaped); } goto create_handle_failed; } result = globus_xio_register_read( *handle, byte, 0, 0, NULL, globus_l_gram_startup_socket_callback, manager); if (result != GLOBUS_SUCCESS) { char * errstr; char * errstr_escaped; rc = GLOBUS_GRAM_PROTOCOL_ERROR_JM_FAILED_ALLOW_ATTACH; errstr = globus_error_print_friendly(globus_error_peek(result)); errstr_escaped = globus_gram_prepare_log_string(errstr); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.startup.socket.create_socket.end " "level=ERROR " "status=%d " "path=\"%s\" " "msg=\"%s\" " "reason=\"%s\"\n", -rc, manager->socket_path, "Error registering socket for reading", errstr_escaped ? errstr_escaped : ""); if (errstr) { free(errstr); } if (errstr_escaped) { free(errstr_escaped); } goto register_read_failed; } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE, "event=gram.startup.socket.create_socket.end " "level=TRACE " "status=%d " "path=\"%s\" " "\n", 0, manager->socket_path); if (rc != GLOBUS_SUCCESS) { register_read_failed: globus_xio_close(*handle, NULL); *handle = NULL; create_handle_failed: fcntl_failed: bind_failed: setsockopt_failed: close(sock); sock = -1; socket_failed: close_pid_failed: fp = NULL; write_pid_failed: if (fp != NULL) { fclose(fp); } remove(manager->pid_path); } open_pid_failed: *socket_fd = sock; if (rc == GLOBUS_SUCCESS) { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.startup_socket_init.end " "level=DEBUG " "status=0 " "path=\"%s\" " "\n", manager->socket_path); } else { globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.startup_socket_init.end " "level=DEBUG " "status=%d " "reason=\"%s\" " "\n", -rc, globus_gram_protocol_error_string(rc)); } return rc; } /* globus_gram_job_manager_startup_socket_init() */ /* * This is the for job managers running on system where * gss_export_sec_context() works. In those cases, the * gatekeeper will exit after sending the context and http * message and expect the jobmanager to import the context and * wrap its replies. For systems without that, the v2 function * below is used. */ int globus_gram_job_manager_starter_send( globus_gram_job_manager_t * manager, int http_body_fd, int context_fd, int response_fd, gss_cred_id_t cred) { int sock; char byte[1]; int rc = 0; struct iovec iov[1]; int fdarray[3]; gss_buffer_desc cred_buffer; OM_uint32 major_status, minor_status; enum { GRAM_RETRIES = 100 }; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.send_job.start " "level=DEBUG " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "\n", http_body_fd, context_fd, response_fd); /* create socket */ rc = globus_l_create_starter_connect_socket(manager, &sock); if (rc != GLOBUS_SUCCESS) { goto socket_failed; } /* Export credential to be sent to active job manager */ major_status = gss_export_cred( &minor_status, cred, GSS_C_NO_OID, 1, &cred_buffer); if (GSS_ERROR(major_status)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "status=%d " "reason=\"%s\" " "\n", http_body_fd, context_fd, response_fd, -rc, "Error exporting proxy"); goto export_cred_failed; } /* Shouldn't be the case, as we're using the mech-specific * form, which is the path to the proxy on disk */ if (cred_buffer.length > GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "status=%d " "reason=\"%s\" " "\n", http_body_fd, context_fd, response_fd, -rc, "Proxy larger than protocol allows"); goto cred_too_big; } fdarray[0] = http_body_fd; fdarray[1] = context_fd; fdarray[2] = response_fd; rc = globus_l_blocking_send_length_and_fds( sock, (int) cred_buffer.length, fdarray, 3); if (rc != GLOBUS_SUCCESS) { goto sendmsg_failed; } iov[0].iov_base = cred_buffer.value; iov[0].iov_len = cred_buffer.length; rc = globus_l_blocking_writev(sock, iov, 1); if (rc < cred_buffer.length) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", http_body_fd, context_fd, response_fd, -rc, "Error sending datagram", errno, strerror(errno)); goto sendmsg_failed; } rc = globus_l_blocking_read(sock, byte, 1); if (rc <= 0 || byte[0] != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", http_body_fd, context_fd, response_fd, -rc, "Error receiving ack", errno, strerror(errno)); } else { rc = GLOBUS_SUCCESS; } iov[0].iov_base = &byte; iov[0].iov_len = 1; byte[0]++; rc = globus_l_blocking_writev(sock, iov, 1); if (rc != 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", http_body_fd, context_fd, response_fd, -rc, "Error sending ack", errno, strerror(errno)); } else { rc = GLOBUS_SUCCESS; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.send_job.end " "level=DEBUG " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "status=%d " "\n", http_body_fd, context_fd, response_fd, 0); } sendmsg_failed: cred_too_big: if (rc != GLOBUS_SUCCESS) { globus_l_remove_proxy(&cred_buffer); } gss_release_buffer( &minor_status, &cred_buffer); export_cred_failed: close(sock); socket_failed: return rc; } /* globus_gram_job_manager_starter_send() */ int globus_gram_job_manager_starter_send_v2( globus_gram_job_manager_t * manager, gss_cred_id_t cred) { int sock; char byte[1]; int rc = 0; int fdarray[2]; gss_buffer_desc cred_buffer; OM_uint32 major_status, minor_status; int msg_total; char * content_length_str; size_t content_length; unsigned char cred_length_buffer[4]; unsigned char env_length_buffer[4]; struct iovec iov[5]; char * cgi_env; enum { GRAM_RETRIES = 100 }; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.send_job.start " "level=DEBUG " "\n"); content_length_str = getenv("CONTENT_LENGTH"); sscanf(content_length_str, "%zu", &content_length); rc = globus_l_create_starter_connect_socket(manager, &sock); if (rc != GLOBUS_SUCCESS) { goto socket_failed; } /* Export credential to be sent to active job manager */ major_status = gss_export_cred( &minor_status, cred, GSS_C_NO_OID, 1, &cred_buffer); if (GSS_ERROR(major_status)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_OPENING_USER_PROXY; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "status=%d " "reason=\"%s\" " "\n", -rc, "Error exporting proxy"); goto export_cred_failed; } /* Shouldn't be the case, as we're using the mech-specific * form, which is the path to the proxy on disk */ if (cred_buffer.length > GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "status=%d " "reason=\"%s\" " "\n", -rc, "Proxy larger than protocol allows"); goto cred_too_big; } globus_l_encode_gatekeeper_env(&iov[4]); cgi_env = iov[4].iov_base; /* Message format * "msg2" * 4 bytes: length of credential in network byte order * credential blob * 4 bytes: length of environment in network byte order * sequence of name=value pairs that form the environment * passed from the gatekeeper, separated by \0 * REMOTE_ADDR=%s * REQUEST_METHOD=%s * SCRIPT_NAME=%s * CONTENT_LENGTH=%s * GATEWAY_INTERFACE=%s * SSL_CLIENT_CERT=%s * SSL_CLIENT_CERT_CHAIN%d=%s */ msg_total = 4 /* "msg2" */ + 4 /* cred length */ + cred_buffer.length + 4 /* env length */ + iov[4].iov_len; /* fds from/to gatekeeper's socket to the client */ fdarray[0] = 0; fdarray[1] = 1; rc = globus_l_blocking_send_length_and_fds(sock, msg_total, fdarray, 2); if (rc != GLOBUS_SUCCESS) { goto sendmsg_failed; } iov[0].iov_base = "msg2"; iov[0].iov_len = 4; iov[1].iov_base = cred_length_buffer; iov[1].iov_len = 4; iov[2].iov_base = cred_buffer.value; iov[2].iov_len = cred_buffer.length; iov[3].iov_base = env_length_buffer; iov[3].iov_len = 4; /*iov[4] set above*/ /* network order 4-byte size of the credential token */ cred_length_buffer[0] = (cred_buffer.length >> 24) & 0xff; cred_length_buffer[1] = (cred_buffer.length >> 16) & 0xff; cred_length_buffer[2] = (cred_buffer.length >> 8) & 0xff; cred_length_buffer[3] = (cred_buffer.length) & 0xff; env_length_buffer[0] = (iov[4].iov_len >> 24) & 0xff; env_length_buffer[1] = (iov[4].iov_len >> 16) & 0xff; env_length_buffer[2] = (iov[4].iov_len >> 8) & 0xff; env_length_buffer[3] = (iov[4].iov_len) & 0xff; rc = globus_l_blocking_writev(sock, iov, 5); if (rc < msg_total) { goto sendmsg_failed; } rc = globus_l_blocking_read(sock, byte, 1); if (rc <= 0 || byte[0] != 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", -rc, "Error receiving ack", errno, strerror(errno)); goto ack_failed; } else { rc = GLOBUS_SUCCESS; } iov[0].iov_base = byte; iov[0].iov_len = 1; byte[0]++; rc = globus_l_blocking_writev(sock, iov, 1); if (rc < 1) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "status=%d " "msg=\"%s\" " "errno=%d " "reason=\"%s\" " "\n", -rc, "Error sending ack", errno, strerror(errno)); } else { rc = GLOBUS_SUCCESS; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.send_job.end " "level=DEBUG " "status=%d " "\n", 0); } ack_failed: sendmsg_failed: if (cgi_env) { free(cgi_env); } cred_too_big: if (rc != GLOBUS_SUCCESS) { globus_l_remove_proxy(&cred_buffer); } gss_release_buffer( &minor_status, &cred_buffer); export_cred_failed: close(sock); socket_failed: return rc; } /* globus_gram_job_manager_starter_send_v2() */ /* This is the accept/read handler for the inter-jobmanager communication. * It accepts, reads, acks, and checks the ack from the first to make * sure that it understands this process is now managing the file descriptors * and proxy associated with the job. */ static void globus_l_gram_startup_socket_callback( 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_gram_job_manager_t * manager = user_arg; int * sent_fds; unsigned char message_length_buffer[4]; int message_length; struct msghdr message; void * message_buffer; struct iovec iov[1]; gss_buffer_desc cred_buffer; struct cmsghdr * control_message = NULL; int http_body_fd = -1; int context_fd = -1; int response_fd = -1; int rc; gss_ctx_id_t context; char * contact = NULL; int job_state_mask; globus_gram_jobmanager_request_t * request; OM_uint32 major_status, minor_status; gss_cred_id_t cred; char byte[1] = {0}; void * cmsgbuf = NULL; const int MAX_NEW_PER_SELECT = 1; int accepted; globus_bool_t done = GLOBUS_FALSE; int tries; char * old_job_contact = NULL; globus_gram_jobmanager_request_t * old_job_request = NULL; globus_bool_t version_only = GLOBUS_FALSE; static unsigned char cred_buffer_value[GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE+16*1024]; gss_name_t name; gss_buffer_desc output_name; struct linger linger; char * gt3_failure_message = NULL; char * peername = NULL; size_t content_length; int newsock; globus_sockaddr_t addr; globus_socklen_t addrlen = sizeof(addr); globus_gsi_cred_handle_t peer_cred_handle = NULL; cred_buffer.value = cred_buffer_value; for (accepted = 0; !done && accepted < MAX_NEW_PER_SELECT; accepted++) { int flags; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.new_request.start " "level=DEBUG " "fd=%d " "\n", manager->socket_fd); newsock = accept( manager->socket_fd, (struct sockaddr *) &addr, &addrlen); if (newsock < 0) { break; } flags = fcntl(newsock, F_GETFL); flags &= ~O_NONBLOCK; fcntl(newsock, F_SETFL, flags); /* Don't define cmsgbuf as a static char[]---CMSG_SPACE isn't * guaranteed to be a constant expression, and alignment issues can * occur with some compilers. */ if (cmsgbuf == NULL) { /* Big enough to handle either of the sets of descriptors, * three for old gatekeeper (http_body_fd, context_fd, and * response_fd) or two for new (in, out) */ cmsgbuf = calloc(1, CMSG_SPACE(3 * sizeof(int))); } /* First we'll receive the message side + ancillary data, then * read into a buffer of that size to get the actual data */ iov[0].iov_base = message_length_buffer; iov[0].iov_len = 4; /* Message metadata */ message.msg_name = NULL; message.msg_namelen = 0; message.msg_iov = iov; message.msg_iovlen = 1; message.msg_control = cmsgbuf; message.msg_controllen = CMSG_SPACE(3 * sizeof(int)); message.msg_flags = 0; /* Attempt to receive file descriptors */ tries = 10; while (tries > 0) { rc = recvmsg(newsock, &message, 0); if (rc <= 0 && (errno == EAGAIN || errno == EINTR)) { tries--; globus_libc_usleep(10000); } else { break; } } if (rc < 4) { int level; char * levelstr; done = GLOBUS_TRUE; rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; if (manager->done) { level = GLOBUS_GRAM_JOB_MANAGER_LOG_TRACE; levelstr = "TRACE"; } else if (accepted == 0) { level = GLOBUS_GRAM_JOB_MANAGER_LOG_WARN; levelstr = "WARN"; } else { level = GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG; levelstr = "DEBUG"; } globus_gram_job_manager_log( manager, level, "event=gram.new_request.end " "level=%s " "fd=%d " "msg=\"%s\" " "status=%d " "errno=%d " "reason=\"%s\" " "\n", levelstr, newsock, "recvmsg failed", -rc, errno, strerror(errno)); goto failed_receive; } for (control_message = CMSG_FIRSTHDR(&message); control_message != NULL; control_message = CMSG_NXTHDR(&message, control_message)) { if (control_message->cmsg_level == SOL_SOCKET && control_message->cmsg_type == SCM_RIGHTS) { sent_fds = (int *) CMSG_DATA(control_message); break; } } message_length = message_length_buffer[0] << 24; message_length += message_length_buffer[1] << 16; message_length += message_length_buffer[2] << 8; message_length += message_length_buffer[3]; message_buffer = malloc(message_length); if (message_buffer == NULL) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILED; goto failed_malloc; } rc = globus_l_blocking_read(newsock, message_buffer, message_length); if (rc < message_length) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; goto failed_read; } if ((message_length > 4) && (strncmp((char *) message_buffer, "msg2", 4) == 0)) { unsigned char * p = message_buffer + 4; int env_length; if ((p + 4) > (((unsigned char *)message_buffer) + message_length)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; goto failed_read; } cred_buffer.length = *(p++) << 24; cred_buffer.length += *(p++) << 16; cred_buffer.length += *(p++) << 8; cred_buffer.length += *(p++); if ((p + cred_buffer.length) > (((unsigned char *) message_buffer) + message_length)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; goto failed_read; } cred_buffer.value = p; p += cred_buffer.length; if ((p + 4) > (((unsigned char *) message_buffer) + message_length)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; goto failed_read; } env_length = *(p++) << 24; env_length += *(p++) << 16; env_length += *(p++) << 8; env_length += *(p++); if ((p + env_length) > (((unsigned char *) message_buffer) + message_length)) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; goto failed_read; } globus_l_decode_gatekeeper_env( (char*)p, env_length, &peername, &content_length, &peer_cred_handle); http_body_fd = sent_fds[0]; response_fd = sent_fds[1]; } else { struct stat stat; cred_buffer.length = message_length; cred_buffer.value = message_buffer; http_body_fd = sent_fds[0]; context_fd = sent_fds[1]; response_fd = sent_fds[2]; rc = fstat(http_body_fd, &stat); if (rc < 0) { done = GLOBUS_TRUE; rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.new_request.end " "level=ERROR " "fd=%d " "status=%d " "msg=\"%s\" " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "errno=%d " "reason=\"%s\" " "\n", newsock, -rc, "Failed determining message length", http_body_fd, context_fd, response_fd, errno, strerror(errno)); goto ackfailed; } content_length = (size_t) stat.st_size; } linger.l_onoff = 1; linger.l_linger = 5; setsockopt( response_fd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); byte[0] = 0; errno = 0; do { rc = write(newsock, byte, 1); if (rc < 0 && (errno == EINTR || errno == EAGAIN)) { rc = 0; } else if (rc < 0) { break; } } while (rc < 1); if (rc < 0) { done = GLOBUS_TRUE; rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.new_request.end " "level=ERROR " "fd=%d " "status=%d " "msg=\"%s\" " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "errno=%d " "reason=\"%s\" " "\n", newsock, -rc, "Failed sending ack", http_body_fd, context_fd, response_fd, errno, strerror(errno)); goto ackfailed; } errno = 0; rc = -1; tries = 10; do { rc = read(newsock, byte, 1); if (rc < 0 && (errno == EINTR || errno == EAGAIN)) { rc = 0; tries--; } else if (rc < 0) { tries--; } } while (rc < 1 && tries >= 0); if (rc < 0 || byte[0] != 1) { done = GLOBUS_TRUE; globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.new_request.end " "level=ERROR " "fd=%d " "status=%d " "msg=\"%s\" " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "errno=%d " "reason=\"%s\" " "rc=%d " "byte=%d " "\n", newsock, -GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED, "Failed receiving ack", http_body_fd, context_fd, response_fd, errno, strerror(errno), (int) rc, (int) byte[0]); rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; goto ackfailed; } { char * p; if (cred_buffer.length > GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; goto ackfailed; } p = cred_buffer.value; *(p + cred_buffer.length) = 0; major_status = gss_import_cred( &minor_status, &cred, GSS_C_NO_OID, 1, &cred_buffer, 0, NULL); } { globus_l_remove_proxy(&cred_buffer); } if (GSS_ERROR(major_status)) { char * errstr; char * errstr_escaped; globus_gss_assist_display_status_str( &errstr, "Import cred failed: ", major_status, minor_status, 0); errstr_escaped = globus_gram_prepare_log_string(errstr); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_ERROR, "event=gram.new_request.end " "level=ERROR " "fd=%d " "status=%d " "http_body_fd=%d " "context_fd=%d " "response_fd=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", newsock, -rc, http_body_fd, context_fd, response_fd, "Error importing credential", errstr_escaped ? errstr_escaped : ""); if (errstr) { free(errstr); } if (errstr_escaped) { free(errstr_escaped); } done = GLOBUS_TRUE; goto failed_import_cred; } /* Load request data */ rc = globus_gram_job_manager_request_load( manager, http_body_fd, context_fd, cred, peername, peer_cred_handle, content_length, &request, &context, &contact, &job_state_mask, &old_job_contact, &old_job_request, &version_only, >3_failure_message); if (rc != GLOBUS_SUCCESS) { if (rc == GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE && old_job_request) { if (old_job_request->two_phase_commit != 0) { /* * Condor-G expects waiting for commit message on restarts. */ rc = GLOBUS_GRAM_PROTOCOL_ERROR_WAITING_FOR_COMMIT; } else if (old_job_request->status == GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED ) { rc = old_job_request->failure_code; } else { rc = GLOBUS_SUCCESS; } globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.new_request.info " "level=DEBUG " "gramid=%s " "msg=\"%s\" " "response=%d " "job_state=%d " "job_manager_state=%s " "job_manager_restart_state=%s " "\n", old_job_request->job_contact_path, "Restarting already restarted request", rc, old_job_request->status, globus_i_gram_job_manager_state_strings[ old_job_request->jobmanager_state], globus_i_gram_job_manager_state_strings[ old_job_request->restart_state]); } else if(rc != GLOBUS_GRAM_PROTOCOL_ERROR_OLD_JM_ALIVE) { assert(old_job_request == NULL); globus_i_gram_send_job_failure_stats(manager, rc); globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.new_request.info " "level=DEBUG " "gramid=%s " "msg=\"%s\" " "response=%d " "\n", old_job_contact ? old_job_contact : "", globus_gram_protocol_error_string(rc), rc); } rc = globus_gram_job_manager_reply( NULL, manager, rc, (old_job_contact == NULL && old_job_request) ? old_job_request->job_contact : old_job_contact, response_fd, context, gt3_failure_message); if (gt3_failure_message) { free(gt3_failure_message); } done = GLOBUS_TRUE; rc = globus_gram_job_manager_gsi_update_credential( manager, NULL, cred); cred = GSS_C_NO_CREDENTIAL; if (old_job_request) { /* This occurs when a client tries to restart a job that * we found during the load_all when this process started, or * one which had a two-phase end time out. * * We'll return information to the client about the job and * make sure the job manager knows about the client * contact/mask. * * If it is in a STOP state or two-phase end state, then we * need to fake the restart by setting the state to just after * two-phase commit and let the restart logic in the state * machine pick it up from there. * * Additionally, in the STOP state, we need to register the * state machine. */ GlobusGramJobManagerRequestLock(old_job_request); globus_gram_job_manager_contact_add( old_job_request, contact, job_state_mask); if (old_job_request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_STOP) { if (old_job_request->jm_restart) { free(old_job_request->jm_restart); } old_job_request->jm_restart = strdup( old_job_request->job_contact); /* In GLOBUS_GRAM_JOB_MANAGER_STATE_START, * the state machine jumps to the current restart state * based on the value in the state file after receiving * a two-phase commit signal */ old_job_request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_START; old_job_request->unsent_status_change = GLOBUS_TRUE; /* If the job is in another state, we'll assume that it's * already being handled by the state machine */ globus_gram_job_manager_state_machine_register( old_job_request->manager, old_job_request, NULL); } else if (old_job_request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END || old_job_request->jobmanager_state == GLOBUS_GRAM_JOB_MANAGER_STATE_FAILED_TWO_PHASE) { if (old_job_request->jm_restart) { free(old_job_request->jm_restart); } old_job_request->jm_restart = strdup(old_job_request->job_contact); /* In GLOBUS_GRAM_JOB_MANAGER_STATE_START, * the state machine jumps to the current restart state * based on the value in the state file. */ old_job_request->jobmanager_state = GLOBUS_GRAM_JOB_MANAGER_STATE_START; } GlobusGramJobManagerRequestUnlock(old_job_request); globus_gram_job_manager_remove_reference( old_job_request->manager, old_job_request->job_contact_path, "jm_restart"); } goto request_load_failed; } if (!version_only) { major_status = gss_inquire_cred( &minor_status, cred, &name, NULL, NULL, NULL); /* Don't care too much if this fails, as the user_dn will be * set to NULL in that case */ if (major_status == GSS_S_COMPLETE) { major_status = gss_display_name( &minor_status, name, &output_name, NULL); if (request->job_stats.user_dn == NULL) { request->job_stats.user_dn = strdup(output_name.value); } gss_release_name(&minor_status, &name); gss_release_buffer(&minor_status, &output_name); } } rc = globus_gram_job_manager_gsi_update_credential( manager, NULL, cred); cred = GSS_C_NO_CREDENTIAL; /* How much do I care about this error? */ if (rc != GLOBUS_SUCCESS || version_only) { globus_gram_job_manager_reply( request, manager, rc, NULL, response_fd, context, NULL); done = GLOBUS_TRUE; goto update_cred_failed; } if (!version_only) { globus_sockaddr_t peer_address; socklen_t peer_address_len; char * peer_str = NULL; if (peername != NULL) { peer_str = peername; peername = NULL; } else { peer_address_len = sizeof(peer_address); rc = getpeername( response_fd, (struct sockaddr *) &peer_address, &peer_address_len); if (rc == GLOBUS_SUCCESS) { rc = globus_libc_addr_to_contact_string( &peer_address, GLOBUS_LIBC_ADDR_NUMERIC, &peer_str); } } globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.job.start " "level=DEBUG " "gramid=%s " "peer=%s " "\n", request->job_contact_path, peer_str ? peer_str : "\"\""); if (request->job_stats.client_address == NULL) { request->job_stats.client_address = peer_str; } else if (peer_str) { free(peer_str); } /* Start state machine and send response */ rc = globus_gram_job_manager_request_start( manager, request, response_fd, contact, job_state_mask); if (rc != GLOBUS_SUCCESS) { globus_gram_job_manager_request_log( request, GLOBUS_GRAM_JOB_MANAGER_LOG_DEBUG, "event=gram.job.end " "level=DEBUG " "gramid=%s " "status=%d " "msg=\"%s\" " "reason=\"%s\" " "\n", request->job_contact_path, -rc, "Request start failed", globus_gram_protocol_error_string(rc)); globus_gram_job_manager_request_free(request); request = NULL; } } update_cred_failed: request_load_failed: if (contact) { free(contact); } if (old_job_contact != NULL) { free(old_job_contact); } if (cred != GSS_C_NO_CREDENTIAL) { gss_release_cred( &minor_status, &cred); cred = GSS_C_NO_CREDENTIAL; } if (peername != NULL) { free(peername); } if (peer_cred_handle != NULL) { globus_gsi_cred_handle_destroy(peer_cred_handle); } ackfailed: failed_import_cred: if (http_body_fd != -1) { close(http_body_fd); if (response_fd == http_body_fd) { response_fd = -1; } http_body_fd = -1; } if (context_fd != -1) { close(context_fd); context_fd = -1; } if (response_fd != -1) { close(response_fd); response_fd = -1; } failed_read: free(message_buffer); failed_malloc: failed_receive: ; } if (cmsgbuf != NULL) { free(cmsgbuf); } if (http_body_fd != -1) { close(http_body_fd); if (response_fd == http_body_fd) { response_fd = -1; } http_body_fd = -1; } if (context_fd != -1) { close(context_fd); context_fd = -1; } if (response_fd != -1) { close(response_fd); response_fd = -1; } if (newsock != -1) { close(newsock); newsock = -1; } result = globus_xio_register_read( handle, buffer, 0, 0, NULL, globus_l_gram_startup_socket_callback, manager); } /* globus_l_gram_startup_socket_callback() */ static globus_result_t globus_l_gram_create_handle( int sock, globus_xio_handle_t * handle) { globus_xio_attr_t attr; globus_result_t result; result = globus_xio_attr_init(&attr); if (result != GLOBUS_SUCCESS) { goto attr_init_failed; } result = globus_xio_attr_cntl( attr, globus_i_gram_job_manager_file_driver, GLOBUS_XIO_FILE_SET_HANDLE, sock); if (result != GLOBUS_SUCCESS) { goto attr_cntl_failed; } result = globus_xio_handle_create( handle, globus_i_gram_job_manager_file_stack); if (result != GLOBUS_SUCCESS) { goto handle_create_failed; } result = globus_xio_open( *handle, NULL, attr); if (result != GLOBUS_SUCCESS) { globus_xio_close(*handle, NULL); *handle = NULL; } handle_create_failed: attr_cntl_failed: globus_xio_attr_destroy(attr); attr_init_failed: return result; } /* globus_l_gram_create_handle() */ static int globus_l_create_starter_connect_socket( globus_gram_job_manager_t * manager, int * sockptr) { int rc; struct sockaddr_un addr; int sock = -1; char * msg = ""; int sndbuf; int save_errno = 0; /* create socket */ memset(&addr, 0, sizeof(struct sockaddr_un)); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, manager->socket_path, sizeof(addr.sun_path)-1); sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; save_errno = errno; msg = "Error creating datagram socket"; goto socket_failed; } sndbuf = GLOBUS_GRAM_PROTOCOL_MAX_MSG_SIZE; rc = setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf)); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; save_errno = errno; msg = "Error setting datagram socket buffer"; goto setsockopt_failed; } rc = connect(sock, (struct sockaddr *) &addr, sizeof(addr)); if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_NO_RESOURCES; save_errno = errno; msg = "Error making datagram connection to Job Manager"; setsockopt_failed: close(sock); sock = -1; socket_failed: globus_gram_job_manager_log( manager, GLOBUS_GRAM_JOB_MANAGER_LOG_WARN, "event=gram.send_job.end " "level=WARN " "status=%d " "errno=%d " "msg=\"%s\" " "reason=\"%s\" " "path=\"%s\" " "\n", -rc, save_errno, msg, strerror(save_errno), addr.sun_path); } *sockptr = sock; return rc; } /* globus_l_create_starter_connect_socket() */ static int globus_l_encode_gatekeeper_env( struct iovec *iov) { int envno; char *p; char cert_chain_name[] = "SSL_CLIENT_CERT_CHAINXX"; int rc; iov->iov_len = 0; for (envno = 0; globus_l_gatekeeper_env[envno] != NULL; envno++) { const char * tmpstr = getenv(globus_l_gatekeeper_env[envno]); if (tmpstr != NULL) { iov->iov_len += strlen(globus_l_gatekeeper_env[envno]) + strlen(tmpstr) + 2; } } for (envno = 0; envno < 100; envno++) { const char * tmpstr; sprintf(cert_chain_name, "SSL_CLIENT_CERT_CHAIN%d", envno); tmpstr = getenv(cert_chain_name); if (tmpstr != NULL) { iov->iov_len += strlen(cert_chain_name) + strlen(tmpstr) + 2; } } iov->iov_base = malloc(iov->iov_len); p = iov->iov_base; for (envno = 0; globus_l_gatekeeper_env[envno] != NULL; envno++) { const char * tmpstr = getenv(globus_l_gatekeeper_env[envno]); if (tmpstr != NULL) { rc = sprintf(p, "%s=%s", globus_l_gatekeeper_env[envno], tmpstr); p += rc; *(p++) = 0; } } for (envno = 0; envno < 100; envno++) { const char * tmpstr; sprintf(cert_chain_name, "SSL_CLIENT_CERT_CHAIN%d", envno); tmpstr = getenv(cert_chain_name); if (tmpstr != NULL) { rc = sprintf(p, "%s=%s", cert_chain_name, tmpstr); p += rc; *(p++) = 0; } } return GLOBUS_SUCCESS; } static int globus_l_decode_gatekeeper_env( const char *p, size_t len, char **remote_addr, size_t *content_length, globus_gsi_cred_handle_t *cred_handle) { const char * endp = p + len; const char * cert_pem; X509 * cert; BIO * b = NULL; STACK_OF(X509) * chain = NULL; chain = sk_X509_new_null(); globus_gsi_cred_handle_init(cred_handle, NULL); b = BIO_new(BIO_s_mem()); while (p < endp) { if (strncmp(p, "REMOTE_ADDR=", 12) == 0) { *remote_addr = globus_common_create_string("%s", p+13); } else if (strncmp(p, "CONTENT_LENGTH", 14) == 0) { sscanf(p+15, "%zu", content_length); } /* SSL_CLIENT_CERT_CHAIN must be before SSL_CLIENT_CERT */ else if (strncmp(p, "SSL_CLIENT_CERT_CHAIN", 21) == 0) { int chain_index; sscanf(p + 21, "%d", &chain_index); cert_pem = strchr(p, '=') + 1; BIO_write(b, cert_pem, strlen(cert_pem)); cert = PEM_read_bio_X509(b, NULL, 0, NULL); sk_X509_insert(chain, cert, chain_index); } else if (strncmp(p, "SSL_CLIENT_CERT", 15) == 0) { cert_pem = p + 16; BIO_write(b, cert_pem, strlen(cert_pem)); cert = PEM_read_bio_X509(b, NULL, 0, NULL); globus_gsi_cred_set_cert(*cred_handle, cert); X509_free(cert); cert = NULL; } p += strlen(p) + 1; } globus_gsi_cred_set_cert_chain(*cred_handle, chain); sk_X509_pop_free(chain, X509_free); BIO_free(b); return GLOBUS_SUCCESS; } /* globus_l_decode_gatekeeper_env() */ /** * Send a unix domain message containing an integer and an array of * file descriptors. The integer is encoded as as a 4 byte binary * value in network byte order. The file descriptors are sent as * ancillary data in the message. * * @param fd * File descriptor to send the message on * @param msg_length * Integer to send as the data payload of the message in encoded form. * @param fds * Array of file descriptors to send via message control rights header. * @param fd_count * Number of elements in the @a fds array. * * @return This function returns GLOBUS_SUCCESS when the message is * sent successfully, or a GRAM protocol error if an error occurs. */ static int globus_l_blocking_send_length_and_fds( int fd, int msg_length, int * fds, int fd_count) { struct msghdr message; struct cmsghdr * cmsg; void *cmsgbuf; unsigned char msg_length_buf[4]; struct iovec iov[1]; int *fdptr; int i, rc; cmsgbuf = calloc(1, CMSG_SPACE(fd_count * sizeof(int))); msg_length_buf[0] = (msg_length >> 24) & 0xff; msg_length_buf[1] = (msg_length >> 16) & 0xff; msg_length_buf[2] = (msg_length >> 8) & 0xff; msg_length_buf[3] = (msg_length) & 0xff; /* Credential we send along with the descriptors */ iov[0].iov_base = msg_length_buf; iov[0].iov_len = 4; /* Message metadata */ message.msg_name = NULL; message.msg_namelen = 0; message.msg_iov = iov; message.msg_iovlen = 1; message.msg_flags = 0; message.msg_control = cmsgbuf; message.msg_controllen = CMSG_SPACE(fd_count*sizeof(int)); cmsg = CMSG_FIRSTHDR(&message); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(fd_count * sizeof(int)); fdptr = (int *)CMSG_DATA(cmsg); for (i = 0; i < fd_count; i++) { fdptr[i] = fds[i]; } /* Send message length and fds */ while ((rc = sendmsg(fd, &message, 0)) < message.msg_iov[0].iov_len) { if (rc < 0 && (errno == EAGAIN || errno == EINTR)) { continue; } else if (rc < 0) { rc = GLOBUS_GRAM_PROTOCOL_ERROR_PROTOCOL_FAILED; goto sendmsg_failed; } message.msg_iov[0].iov_base = ((char *)message.msg_iov[0].iov_base) + rc; message.msg_iov[0].iov_len -= rc; message.msg_control = NULL; message.msg_controllen = 0; } rc = GLOBUS_SUCCESS; sendmsg_failed: free(cmsgbuf); return rc; } /* globus_l_blocking_send_length_and_fds() */ /** * @brief Blocking writev * * Write an array of data to a file descriptor, looping and blocking until the * entire array is written or an error occurs. Note: this function * destructively modifies iov, so if there are pointers to data on the heap, * they must be retained elsewhere for proper memory management. * * @param fd * The file descriptor to write to. * @param iov * The array of struct iovec containing the data to write * @param iovcnt * Number of elements in the @a iov array. * * @return This function */ static int globus_l_blocking_writev( int fd, struct iovec * iov, int iovcnt) { int i, rc = 0, amt_written = 0, total; for (i = 0, total = 0; i < iovcnt; i++) { total += iov[i].iov_len; } do { rc = writev(fd, iov, iovcnt); if (rc < 0) { if (errno == EINTR || errno == EAGAIN) { globus_libc_usleep(10000); rc = 0; } else { break; } } else { amt_written += rc; for (i = 0; rc > 0 && i < iovcnt; i++) { if (rc > iov[i].iov_len) { rc -= iov[i].iov_len; iov[i].iov_base = ((char *) iov[i].iov_base) + iov[i].iov_len; iov[i].iov_len = 0; } else { iov[i].iov_len -= rc; iov[i].iov_base = ((char *) iov[i].iov_base) + rc; rc = 0; break; } } } } while (amt_written < total); return amt_written; } /* globus_l_blocking_writev() */ /** * Read a known-size message from a file descriptor, handling * partial reads, EINTR, and EAGAIN * * @param fd * File descriptor to read from * @param buf * Buffer (of at least @a len bytes) to read into. * @param len * Total expected amount of data to read into @a buffer. * * @return * This function returns the total number of bytes read into @a buffer. * This may be less than @a len if an unexpected error occurs while reading * the file descriptor. */ static int globus_l_blocking_read( int fd, void *buf, int len) { int amt_read = 0, rc; do { rc = read(fd, ((char *)buf)+amt_read, len-amt_read); if (rc < 0 && (errno == EINTR || errno == EAGAIN)) { globus_libc_usleep(10000); rc = 0; } else if (rc < 0) { break; } amt_read += rc; } while (amt_read < len && rc >= 0); return amt_read; } /* globus_l_blocking_read() */ /** * Remove a proxy named by a buffer in GSS_IMPEXP_MECH_SPECIFIC form * The token may not be NULL-terminated, so we will NULL-terminate explicitly * before trying to remove it. * * @param token * A GSSAPI cred token which is in GSS_IMPEXP_MECH_SPECIFIC form * X509_USER_PROXY=path-to-proxy * * @return void */ static void globus_l_remove_proxy( gss_buffer_t token) { char * p; char * q; size_t len; q = memchr(token->value, '=', token->length); if (q == NULL) { return; } len = token->length - (q - (char *) token->value); p = malloc(len); if (p == NULL) { return; } memcpy(p, q+1, len-1); p[len-1] = 0; (void) remove(p); free(p); } /* globus_l_remove_proxy() */ globus_gram_job_manager-13.53/globus-job-manager-manual.xml0000666000076400007640000006544211714563237021003 00000000000000 globus-job-manager 8 University of Chicago globus-job-manager Execute and monitor jobs globus-job-manager -type LRM -conf CONFIG_PATH -help -globus-host-manufacturer MANUFACTURER -globus-host-cputype CPUTYPE -globus-host-osname OSNAME -globus-host-osversion OSVERSION -globus-gatekeeper-host HOST -globus-gatekeeper-port PORT -globus-gatekeeper-subject SUBJECT -home GLOBUS_LOCATION -target-globus-location TARGET_GLOBUS_LOCATION -condor-arch ARCH -condor-os OS -history HISTORY_DIRECTORY -scratch-dir-base SCRATCH_DIRECTORY -enable-syslog -stdio-log LOG_DIRECTORY -log-pattern PATTERN -log-levels LEVELS -state-file-dir STATE_DIRECTORY -globus-tcp-port-range PORT_RANGE -globus-tcp-source-range SOURCE_RANGE -x509-cert-dir TRUSTED_CERTIFICATE_DIRECTORY -cache-location GASS_CACHE_DIRECTORY -k -extra-envvars VAR=VAL,... -seg-module SEG_MODULE -audit-directory AUDIT_DIRECTORY -globus-toolkit-version TOOLKIT_VERSION -disable-streaming -disable-usagestats -usagestats-targets TARGET -service-tag SERVICE_TAG Description The globus-job-manager program is a servivce which starts and controls GRAM jobs which are executed by a local resource management system, such as LSF or Condor. The globus-job-manager program is typically started by the globus-gatekeeper program and not directly by a user. It runs until all jobs it is managing have terminated or its delegated credentials have expired. Typically, users interact with the globus-job-manager program via client applications such as globusrun, globus-job-submit, or tools such as CoG jglobus or Condor-G. The full set of command-line options to globus-job-manager consists of: Display a help message to standard error and exit Execute jobs using the local resource manager named LRM. Read additional command-line arguments from the file CONFIG_PATH. If present, this must be the first command-line argument to the globus-job-manager program. Indicate the manufacturer of the system which the jobs will execute on. This parameter sets the value of the $(GLOBUS_HOST_MANUFACTURER) RSL substitution to MANUFACTURER Indicate the CPU type of the system which the jobs will execute on. This parameter sets the value of the $(GLOBUS_HOST_CPUTYPE) RSL substitution to CPUTYPE Indicate the operating system type of the system which the jobs will execute on. This parameter sets the value of the $(GLOBUS_HOST_OSNAME) RSL substitution to OSNAME Indicate the operating system version of the system which the jobs will execute on. This parameter sets the value of the $(GLOBUS_HOST_OSVERSION) RSL substitution to OSVERSION Indicate the host name of the machine which the job was submitted to. This parameter sets the value of the $(GLOBUS_GATEKEEPER_HOST) RSL substitution to HOST Indicate the TCP port number of gatekeeper to which jobs are submitted to. This parameter sets the value of the $(GLOBUS_GATEKEEPER_PORT) RSL substitution to PORT Indicate the X.509 identity of the gatekeeper to which jobs are submitted to. This parameter sets the value of the $(GLOBUS_GATEKEEPER_SUBJECT) RSL substitution to SUBJECT Indicate the path where the Globus Toolkit(r) is installed on the service node. This is used by the job manager to locate its support and configuration files. Indicate the path where the Globus Toolkit(r) is installed on the execution host. If this is omitted, the value specified as a parameter to is used. This parameter sets the value of the $(GLOBUS_LOCATION) RSL substitution to TARGET_GLOBUS_LOCATION Configure the job manager to write job history files to HISTORY_DIRECTORY. These files are described in the FILES section below. Configure the job manager to use SCRATCH_DIRECTORY as the default scratch directory root if a relative path is specified in the job RSL's scratch_dir attribute. Configure the job manager to write log messages via syslog. Logging is further controlled by the argument to the parameter described below. Configure the job manager to write log messages to files named by the string PATTERN. The PATTERN string may contain job-independent RSL substitutions such as $(HOME), $(LOGNAME), etc, as well as the special RSL substition $(DATE) which will be resolved at log time to the date in YYYYMMDD form. Configure the job manager to write log messages to files in the LOG_DIRECTORY directory. This is a backward-compatible parameter, equivalent to -log-pattern LOG_DIRECTORY/gram_$(DATE).log. Configure the job manager to write log messages of certain levels to syslog and/or log files. The available log levels are FATAL, ERROR, WARN, INFO, DEBUG, and TRACE. Multiple values can be combined with the | character. The default value of logging when enabled is FATAL|ERROR. Configure the job manager to write state files to STATE_DIRECTORY. If not specified, the job manager uses the default of $GLOBUS_LOCATION/tmp/gram_job_state/. This directory must be writable by all users and be on a file system which supports POSIX advisory file locks. Configure the job manager to restrict its TCP/IP communication to use ports in the range described by PORT_RANGE. This value is also made available in the job environment via the GLOBUS_TCP_PORT_RANGE environment variable. Configure the job manager to restrict its TCP/IP communication to use source ports in the range described by SOURCE_RANGE. This value is also made available in the job environment via the GLOBUS_TCP_SOURCE_RANGE environment variable. Configure the job manager to search TRUSTED_CERTIFICATE_DIRECTORY for its list of trusted CA certificates and their signing policies. This value is also made available in the job environment via the X509_CERT_DIR environment variable. Configure the job manager to use the path GASS_CACHE_DIRECTORY for its temporary GASS-cache files. This value is also made available in the job environment via the GLOBUS_GASS_CACHE_DEFAULT environment variable. Configure the job manager to assume it is using Kerberos for authentication instead of X.509 certificates. This disables some certificate-specific processing in the job manager. Configure the job manager to define a set of environment variables in the job environment beyond those defined in the base job environment. The format of the parameter to this argument is a comma-separated sequence of VAR=VAL pairs, where VAR is the variable name and VAL is the variable's value. If the value is not specified, then the value of the variable in the job manager's environment is used. This option may be present multiple times on the command-line or the job manager configuration file to append multiple environment settings. Configure the job manager to use the schedule event generator module named by SEG_MODULE to detect job state changes events from the local resource manager, in place of the less efficient polling operations used in GT2. To use this, one instance of the globus-job-manager-event-generator must be running to process events for the LRM into a generic format that the job manager can parse. Configure the job manager to write audit records to the directory named by AUDIT_DIRECTORY. This records can be loaded into a database using the globus-gram-audit program. Configure the job manager to use TOOLKIT_VERSION as the version for audit and usage stats records. Configure the job manager to use SERVICE_TAG as a unique identifier to allow multiple GRAM instances to use the same job state directories without interfering with each other's jobs. If not set, the value untagged will be used. Configure the job manager to disable file streaming. This is propagated to the LRM script interface but has no effect in GRAM5. Disable sending of any usage stats data, even if is present in the configuration. Send usage packets to a data collection service for analysis. The TARGET string consists of a comma-separated list of HOST:PORT combinations, each contaiing an optional list of data to send. See Usage Stats Packets for more information about the tags. Special tag strings of all (which enables all tags) and default may be used, or a sequence of characters for the various tags. If this option is not present in the configuration, then the default of usage-stats.globus.org:4810 is used. Set the architecture specification for condor jobs to be ARCH in job classified ads generated by the GRAM5 codnor LRM script. This is required for the condor LRM but ignored for all others. Set the operating system specification for condor jobs to be OS in job classified ads generated by the GRAM5 codnor LRM script. This is required for the condor LRM but ignored for all others. Environment If the following variables affect the execution of globus-job-manager HOME User's home directory. LOGNAME User's name. JOBMANAGER_SYSLOG_ID String to prepend to syslog audit messages. JOBMANAGER_SYSLOG_FAC Facility to log syslog audit messages as. JOBMANAGER_SYSLOG_LVL Priority level to use for syslog audit messages. GATEKEEPER_JM_ID Job manager ID to be used in syslog audit records. GATEKEEPER_PEER Peer information to be used in syslog audit records GLOBUS_ID Credential information to be used in syslog audit records GLOBUS_JOB_MANAGER_SLEEP Time (in seconds) to sleep when the job manager is started. [For debugging purposes only] GRID_SECURITY_HTTP_BODY_FD File descriptor of an open file which contains the initial job request and to which the initial job reply should be sent. This file descriptor is inherited from the globus-gatekeeper. X509_USER_PROXY Path to the X.509 user proxy which was delegated by the client to the globus-gatekeeper program to be used by the job manager. GRID_SECURITY_CONTEXT_FD File descriptor containing an exported security context that the job manager should use to reply to the client which submitted the job. GLOBUS_USAGE_TARGETS Default list of usagestats services to send usage packets to. GLOBUS_TCP_PORT_RANGE Default range of allowed TCP ports to listen on. The command-line option overrides this. GLOBUS_TCP_SOURCE_RANGE Default range of allowed TCP ports to bind to. The command-line option overrides this. Files $HOME/.globus/job/HOSTNAME/LRM.TAG.red Job manager delegated user credential. $HOME/.globus/job/HOSTNAME/LRM.TAG.lock Job manager state lock file. $HOME/.globus/job/HOSTNAME/LRM.TAG.pid Job manager pid file. $HOME/.globus/job/HOSTNAME/LRM.TAG.sock Job manager socket for inter-job manager communications. $HOME/.globus/job/HOSTNAME/JOB_ID/ Job-specific state directory. $HOME/.globus/job/HOSTNAME/JOB_ID/stdin Standard input which has been staged from a remote URL. $HOME/.globus/job/HOSTNAME/JOB_ID/stdout Standard output which will be staged from a remote URL. $HOME/.globus/job/HOSTNAME/JOB_ID/stderr Standard error which will be staged from a remote URL. $HOME/.globus/job/HOSTNAME/JOB_ID/x509_user_proxy Job-specific delegated credential. $GLOBUS_LOCATION/tmp/gram_job_state/job.HOSTNAME.JOB_ID Job state file. $GLOBUS_LOCATION/tmp/gram_job_state/job.HOSTNAME.JOB_ID.lock Job state lock file. In most cases this will be a symlink to the job manager lock file. $GLOBUS_LOCATION/etc/globus-job-manager.conf Default location of the global job manager configuration file. $GLOBUS_LOCATION/etc/grid-services/jobmanager-LRM Default location of the LRM-specific gatekeeper configuration file. $GLOBUS_LOCATION/etc/globus/gram/job--manager.rvf Default location of the site-specific job manager RSL validation file. $GLOBUS_LOCATION/etc/globus/gram/lrm.rvf Default location of the site-specific job manager RSL validation file for the named lrm. See Also globusrun1, globus-gatekeeper8, globus-personal-gatekeeper1, globus-gram-audit8 globus_gram_job_manager-13.53/configure0000775000076400007640000254123612145177134015236 00000000000000#! /bin/sh # From configure.in Revision: 1.13.2.6 . # 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 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 OPENSSL_CFLAGS OPENSSL_LIBS XSLTPROC XMLLINT XML_CATALOG_PATH GLOBUS_TOOLKIT_VERSION REBUILD_PARSER_TRUE REBUILD_PARSER_FALSE REBUILD_SCANNER_TRUE REBUILD_SCANNER_FALSE XML2_CONFIG XML_CPPFLAGS XML_LIBS GENERATE_MANPAGES_TRUE GENERATE_MANPAGES_FALSE LOGDIR AUDITDIR 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 --disable-xmltest Do not try to compile and run a test LIBXML program 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] --with-openssl=PATH Specify the root of the openssl installation --with-xml-catalog=PATH Look for XML catalog in PATH --with-xml-prefix=PFX Prefix where libxml is installed (optional) --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional) 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 ppc64|s390x|sparc64|x86_64) libdir=\"$libdir64\" ;; *) libdir=\"$libdir32\" ;; esac " perl_libdir_choice=" if (\`uname -m\` =~ /^(ppc64|s390x|sparc64|x86_64)\$/) { \$libdir = \"$libdir64\"; } else { \$libdir = \"$libdir32\"; } " ;; 1:*linux*:*lib) libdir32="${libdir}" libdir64="${libdir}64" libdir_choice=" case \`uname -m\` in ppc64|s390x|sparc64|x86_64) libdir=\"$libdir64\" ;; *) libdir=\"$libdir32\" ;; esac " perl_libdir_choice=" if (\`uname -m\` =~ /^(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 3558 "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:5048:" \ "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:6111: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6115: \$? = $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:6379: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6383: \$? = $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:6483: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6487: \$? = $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 7952 "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:11292: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11296: \$? = $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:11396: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11400: \$? = $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 11932 "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:12990: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12994: \$? = $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:13094: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13098: \$? = $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 14543 "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:15321: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15325: \$? = $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:15589: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15593: \$? = $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:15693: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15697: \$? = $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 17162 "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 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 pkgconffile="" # 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="../" lac_doxygen_file_patterns="*.dox" lac_doxygen_input_filter= 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 lac_doxygen_examples="../" # Check whether --with-openssl or --without-openssl was given. if test "${with_openssl+set}" = set; then withval="$with_openssl" case $withval in no|yes) ;; *) openssl="$withval" ;; esac fi; if test "${openssl}" != ""; then PKG_CONFIG_PATH=${openssl}/lib/pkgconfig export PKG_CONFIG_PATH fi echo "$as_me:$LINENO: checking OpenSSL CFLAGS" >&5 echo $ECHO_N "checking OpenSSL CFLAGS... $ECHO_C" >&6 if test "$OPENSSL_CFLAGS" = ""; then if pkg-config openssl --exists > /dev/null 2>&1 ; then OPENSSL_CFLAGS="`pkg-config openssl --cflags`" elif test -r "${openssl}/include/openssl/ssl.h" ; then OPENSSL_CFLAGS="-I ${openssl}/include" fi fi echo "$as_me:$LINENO: result: using '$OPENSSL_CFLAGS'" >&5 echo "${ECHO_T}using '$OPENSSL_CFLAGS'" >&6 CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}" 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 () { SSL_library_init(); ; 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 { { echo "$as_me:$LINENO: error: Unable to compile with SSL" >&5 echo "$as_me: error: Unable to compile with SSL" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: checking OpenSSL LIBS" >&5 echo $ECHO_N "checking OpenSSL LIBS... $ECHO_C" >&6 if test "$OPENSSL_LIBS" = ""; then if pkg-config openssl --exists > /dev/null 2>&1 ; then OPENSSL_PKGCONF_DEPENDENCIES="openssl" OPENSSL_LIBS="`pkg-config openssl --libs`" else OPENSSL_LIBS="-L${openssl}/lib -lssl -lcrypto" fi fi echo "$as_me:$LINENO: result: using '$OPENSSL_LIBS'" >&5 echo "${ECHO_T}using '$OPENSSL_LIBS'" >&6 LIBS="${LIBS} ${OPENSSL_LIBS}" 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 () { SSL_library_init(); ; 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 : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: Unable to link with SSL" >&5 echo "$as_me: error: Unable to link with SSL" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$OPENSSL_PKGCONF_DEPENDENCIES" != "x"; then GPT_PKGCONFIG_DEPENDENCIES="$GPT_PKGCONFIG_DEPENDENCIES $OPENSSL_PKGCONF_DEPENDENCIES" else GPT_EXTERNAL_INCLUDES="${GPT_EXTERNAL_INCLUDES} ${OPENSSL_CFLAGS}" GPT_EXTERNAL_LIBS="${GPT_EXTERNAL_LIBS} ${OPENSSL_LIBS}" fi xml_catalog_path="notset" # Check whether --with-xml-catalog or --without-xml-catalog was given. if test "${with_xml_catalog+set}" = set; then withval="$with_xml_catalog" xml_catalog_path="$withval" else xml_catalog_path="notset" fi; # Extract the first word of ""xsltproc"", so it can be a program name with args. set dummy "xsltproc"; 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_XSLTPROC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) ac_cv_path_XSLTPROC="$XSLTPROC" # 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_XSLTPROC="$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 XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then echo "$as_me:$LINENO: result: $XSLTPROC" >&5 echo "${ECHO_T}$XSLTPROC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of ""xmllint"", so it can be a program name with args. set dummy "xmllint"; 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_XMLLINT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XMLLINT in [\\/]* | ?:[\\/]*) ac_cv_path_XMLLINT="$XMLLINT" # 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_XMLLINT="$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 XMLLINT=$ac_cv_path_XMLLINT if test -n "$XMLLINT"; then echo "$as_me:$LINENO: result: $XMLLINT" >&5 echo "${ECHO_T}$XMLLINT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$xml_catalog_path" != x"notset"; then if test ! -f "$xml_catalog_path"; then { { echo "$as_me:$LINENO: error: Invalid XML catalog path" >&5 echo "$as_me: error: Invalid XML catalog path" >&2;} { (exit 1); exit 1; }; } else XML_CATALOG_PATH=$xml_catalog_path fi fi GLOBUS_TOOLKIT_VERSION="`globus-version`" if test "x$GLOBUS_TOOLKIT_VERSION" = "x"; then GLOBUS_TOOLKIT_VERSION="UNKNOWN" fi if false; then REBUILD_PARSER_TRUE= REBUILD_PARSER_FALSE='#' else REBUILD_PARSER_TRUE='#' REBUILD_PARSER_FALSE= fi if false; then REBUILD_SCANNER_TRUE= REBUILD_SCANNER_FALSE='#' else REBUILD_SCANNER_TRUE='#' REBUILD_SCANNER_FALSE= fi # Check whether --with-xml-prefix or --without-xml-prefix was given. if test "${with_xml_prefix+set}" = set; then withval="$with_xml_prefix" xml_config_prefix="$withval" else xml_config_prefix="" fi; # Check whether --with-xml-exec-prefix or --without-xml-exec-prefix was given. if test "${with_xml_exec_prefix+set}" = set; then withval="$with_xml_exec_prefix" xml_config_exec_prefix="$withval" else xml_config_exec_prefix="" fi; # Check whether --enable-xmltest or --disable-xmltest was given. if test "${enable_xmltest+set}" = set; then enableval="$enable_xmltest" else enable_xmltest=yes fi; if test x$xml_config_exec_prefix != x ; then xml_config_args="$xml_config_args" if test x${XML2_CONFIG+set} != xset ; then XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config fi fi if test x$xml_config_prefix != x ; then xml_config_args="$xml_config_args --prefix=$xml_config_prefix" if test x${XML2_CONFIG+set} != xset ; then XML2_CONFIG=$xml_config_prefix/bin/xml2-config fi fi # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; 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_XML2_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XML2_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # 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_XML2_CONFIG="$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_XML2_CONFIG" && ac_cv_path_XML2_CONFIG="no" ;; esac fi XML2_CONFIG=$ac_cv_path_XML2_CONFIG if test -n "$XML2_CONFIG"; then echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5 echo "${ECHO_T}$XML2_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi min_xml_version=2.6.11 echo "$as_me:$LINENO: checking for libxml - version >= $min_xml_version" >&5 echo $ECHO_N "checking for libxml - version >= $min_xml_version... $ECHO_C" >&6 no_xml="" if test "$XML2_CONFIG" = "no" ; then no_xml=yes else XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags` XML_LIBS=`$XML2_CONFIG $xml_config_args --libs` xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_xmltest" = "xyes" ; then ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" LIBS="$XML_LIBS $LIBS" rm -f conf.xmltest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" 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() { int xml_major_version, xml_minor_version, xml_micro_version; int major, minor, micro; char *tmp_version; system("touch conf.xmltest"); /* Capture xml2-config output via autoconf/configure variables */ /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = (char *)strdup("$min_xml_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string from xml2-config\n", "$min_xml_version"); exit(1); } free(tmp_version); /* Capture the version information from the header files */ tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION); if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) { printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION"); exit(1); } free(tmp_version); /* Compare xml2-config output to the libxml headers */ if ((xml_major_version != $xml_config_major_version) || (xml_minor_version != $xml_config_minor_version) || (xml_micro_version != $xml_config_micro_version)) { printf("*** libxml header files (version %d.%d.%d) do not match\n", xml_major_version, xml_minor_version, xml_micro_version); printf("*** xml2-config (version %d.%d.%d)\n", $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version); return 1; } /* Compare the headers to the library to make sure we match */ /* Less than ideal -- doesn't provide us with return value feedback, * only exits if there's a serious mismatch between header and library. */ LIBXML_TEST_VERSION; /* Test that the library is greater than our minimum version */ if ((xml_major_version > major) || ((xml_major_version == major) && (xml_minor_version > minor)) || ((xml_major_version == major) && (xml_minor_version == minor) && (xml_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", xml_major_version, xml_minor_version, xml_micro_version); printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the xml2-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n"); printf("*** correct copy of xml2-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } return 1; } _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 ) no_xml=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_xml" = x ; then echo "$as_me:$LINENO: result: yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&5 echo "${ECHO_T}yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&6 ac_cv_have_libxml2=yes else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$XML2_CONFIG" = "no" ; then echo "*** The xml2-config script installed by LIBXML could not be found" echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the XML2_CONFIG environment variable to the" echo "*** full path to xml2-config." else if test -f conf.xmltest ; then : else echo "*** Could not run libxml test program, checking why..." CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" LIBS="$LIBS $XML_LIBS" 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 () { LIBXML_TEST_VERSION; return 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 echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBXML or finding the wrong" echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means LIBXML was incorrectly installed" echo "*** or that you have moved LIBXML since it was installed. In the latter case, you" echo "*** may want to edit the xml2-config script: $XML2_CONFIG" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi fi XML_CPPFLAGS="" XML_LIBS="" ac_cv_have_libxml2=no { echo "$as_me:$LINENO: WARNING: Unable to locate a usable libxml2" >&5 echo "$as_me: WARNING: Unable to locate a usable libxml2" >&2;} { echo "$as_me:$LINENO: WARNING: Teragrid gateway user extension will not be usable" >&5 echo "$as_me: WARNING: Teragrid gateway user extension will not be usable" >&2;} { echo "$as_me:$LINENO: WARNING: To remedy, please install libxml2 using your operating system's package management tools or from http://www.xmlsoft.org/downloads.html" >&5 echo "$as_me: WARNING: To remedy, please install libxml2 using your operating system's package management tools or from http://www.xmlsoft.org/downloads.html" >&2;} fi rm -f conf.xmltest if test "$ac_cv_have_libxml2" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBXML2 1 _ACEOF fi case $host in *solaris*) cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF ;; esac if test "$xml_catalog_path" != "notset"; then GENERATE_MANPAGES_TRUE= GENERATE_MANPAGES_FALSE='#' else GENERATE_MANPAGES_TRUE='#' GENERATE_MANPAGES_FALSE= fi cat >>confdefs.h <<_ACEOF #define GLOBUS_FLAVOR_NAME "$GLOBUS_FLAVOR_NAME" _ACEOF LOGDIR="`eval_path $localstatedir/log/globus`" AUDITDIR="`eval_path $localstatedir/lib/globus/gram-audit`" ac_config_files="$ac_config_files pkgdata/Makefile pkgdata/pkg_data_src.gpt scripts/Makefile seg/Makefile rvf/Makefile doxygen/Makefile doxygen/Doxyfile doxygen/Doxyfile-internal globus-personal-gatekeeper globus-gram-job-manager.conf gram.logrotate Makefile version.h" 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 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed 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 if test -z "${REBUILD_PARSER_TRUE}" && test -z "${REBUILD_PARSER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"REBUILD_PARSER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"REBUILD_PARSER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${REBUILD_SCANNER_TRUE}" && test -z "${REBUILD_SCANNER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"REBUILD_SCANNER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"REBUILD_SCANNER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GENERATE_MANPAGES_TRUE}" && test -z "${GENERATE_MANPAGES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GENERATE_MANPAGES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GENERATE_MANPAGES\" 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 Configuration files: $config_files 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" ;; "pkgdata/Makefile" ) CONFIG_FILES="$CONFIG_FILES pkgdata/Makefile" ;; "pkgdata/pkg_data_src.gpt" ) CONFIG_FILES="$CONFIG_FILES pkgdata/pkg_data_src.gpt" ;; "scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "seg/Makefile" ) CONFIG_FILES="$CONFIG_FILES seg/Makefile" ;; "rvf/Makefile" ) CONFIG_FILES="$CONFIG_FILES rvf/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" ;; "globus-personal-gatekeeper" ) CONFIG_FILES="$CONFIG_FILES globus-personal-gatekeeper" ;; "globus-gram-job-manager.conf" ) CONFIG_FILES="$CONFIG_FILES globus-gram-job-manager.conf" ;; "gram.logrotate" ) CONFIG_FILES="$CONFIG_FILES gram.logrotate" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "version.h" ) CONFIG_FILES="$CONFIG_FILES version.h" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { 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_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,@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,@OPENSSL_CFLAGS@,$OPENSSL_CFLAGS,;t t s,@OPENSSL_LIBS@,$OPENSSL_LIBS,;t t s,@XSLTPROC@,$XSLTPROC,;t t s,@XMLLINT@,$XMLLINT,;t t s,@XML_CATALOG_PATH@,$XML_CATALOG_PATH,;t t s,@GLOBUS_TOOLKIT_VERSION@,$GLOBUS_TOOLKIT_VERSION,;t t s,@REBUILD_PARSER_TRUE@,$REBUILD_PARSER_TRUE,;t t s,@REBUILD_PARSER_FALSE@,$REBUILD_PARSER_FALSE,;t t s,@REBUILD_SCANNER_TRUE@,$REBUILD_SCANNER_TRUE,;t t s,@REBUILD_SCANNER_FALSE@,$REBUILD_SCANNER_FALSE,;t t s,@XML2_CONFIG@,$XML2_CONFIG,;t t s,@XML_CPPFLAGS@,$XML_CPPFLAGS,;t t s,@XML_LIBS@,$XML_LIBS,;t t s,@GENERATE_MANPAGES_TRUE@,$GENERATE_MANPAGES_TRUE,;t t s,@GENERATE_MANPAGES_FALSE@,$GENERATE_MANPAGES_FALSE,;t t s,@LOGDIR@,$LOGDIR,;t t s,@AUDITDIR@,$AUDITDIR,;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_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