mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-12 05:13:50 +08:00
953ff28998
2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
262 lines
8.4 KiB
Bash
Executable File
262 lines
8.4 KiB
Bash
Executable File
#! /bin/sh
|
|
#
|
|
# Update a local Subversion tree from the GCC repository, with an emphasis
|
|
# on treating generated files correctly, so that autoconf, gperf et
|
|
# al are not required for the ``end'' user.
|
|
#
|
|
# (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
|
|
# Originally by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, August 1998.
|
|
#
|
|
# This script is Free Software, and it can be copied, distributed and
|
|
# modified as defined in the GNU General Public License. A copy of
|
|
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
|
|
#
|
|
#
|
|
# By default all command-line options are passed to `svn update` in
|
|
# addition to $UPDATE_OPTIONS (defined below). If the first parameter
|
|
# reads --nostdflags, $UPDATE_OPTIONS as well as this parameter itself
|
|
# are omitted.
|
|
#
|
|
# If the first parameter reads --patch, the second parameter is considered
|
|
# a patch file.
|
|
#
|
|
# If the first parameter is --touch, no svn operation will be performed,
|
|
# only generated files that appear to be out of date in the local tree
|
|
# will be touched.
|
|
#
|
|
# If the first parameter is --list, a list of the generated files and
|
|
# their dependencies will be printed; --help prints this message.
|
|
#
|
|
# If the first parameter is --silent, this script prints nothing other
|
|
# than error messages; the second parameter is then interpreted as above.
|
|
#
|
|
# Examples:
|
|
#
|
|
# contrib/gcc_update -r 8712
|
|
# contrib/gcc_update --patch some-patch
|
|
# contrib/gcc_update --touch
|
|
# contrib/gcc_update --list
|
|
|
|
|
|
# SVN command
|
|
GCC_SVN=${GCC_SVN-${SVN-svn}}
|
|
# Default options used when updating via SVN (none).
|
|
UPDATE_OPTIONS=""
|
|
|
|
######## Anything below shouldn't be changed by regular users.
|
|
|
|
# Arrange for the value of $0 to be available for functions
|
|
self=$0
|
|
|
|
# This function prints its arguments to standard output unless
|
|
# "silent" is set.
|
|
unset silent
|
|
chat () {
|
|
if [ -z "$silent" ]; then
|
|
echo "$@"
|
|
fi
|
|
}
|
|
|
|
# This function prints a list of all generated files, along with their
|
|
# dependencies. Note that only one target is supported per line: the
|
|
# colon is stripped from the output.
|
|
files_and_dependencies () {
|
|
sed -e 's/ *#.*//' -e '/^$/d' -e 's/://' <<\EOF
|
|
# fixincludes
|
|
fixincludes/configure: fixincludes/configure.ac fixincludes/aclocal.m4
|
|
fixincludes/config.h.in: fixincludes/configure.ac fixincludes/aclocal.m4
|
|
# intl library
|
|
intl/plural.c: intl/plural.y
|
|
intl/configure: intl/configure.ac intl/aclocal.m4
|
|
intl/config.h.in: intl/configure.ac intl/aclocal.m4
|
|
# Now, proceed to gcc automatically generated files
|
|
gcc/configure: gcc/configure.ac
|
|
gcc/cstamp-h.in: gcc/configure.ac
|
|
gcc/config.in: gcc/cstamp-h.in
|
|
gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def
|
|
gcc/config/arm/arm-tune.md: gcc/config/arm/arm-cores.def gcc/config/arm/gentune.sh
|
|
# And then, language-specific files
|
|
gcc/cp/cfns.h: gcc/cp/cfns.gperf
|
|
gcc/java/keyword.h: gcc/java/keyword.gperf
|
|
# testsuite
|
|
# Without this, _Pragma3.c can have a false negative.
|
|
gcc/testsuite/gcc.dg/cpp/_Pragma3.c: gcc/testsuite/gcc.dg/cpp/mi1c.h
|
|
# And libraries, at last
|
|
libbanshee/configure: libbanshee/configure.ac
|
|
libmudflap/configure: libmudflap/configure.ac
|
|
libobjc/configure: libobjc/configure.ac
|
|
zlib/aclocal.m4: zlib/configure.ac zlib/acinclude.m4
|
|
zlib/Makefile.in: zlib/Makefile.am zlib/configure.ac zlib/aclocal.m4
|
|
zlib/configure: zlib/configure.ac zlib/aclocal.m4
|
|
fastjar/aclocal.m4: fastjar/configure.ac
|
|
fastjar/Makefile.in: fastjar/Makefile.am fastjar/configure.ac fastjar/aclocal.m4
|
|
fastjar/configure: fastjar/configure.ac fastjar/aclocal.m4
|
|
boehm-gc/aclocal.m4: boehm-gc/configure.ac
|
|
boehm-gc/Makefile.in: boehm-gc/Makefile.am boehm-gc/configure.ac boehm-gc/aclocal.m4
|
|
boehm-gc/configure: boehm-gc/configure.ac boehm-gc/aclocal.m4
|
|
libada/configure: libada/configure.ac
|
|
libffi/aclocal.m4: libffi/configure.ac libffi/acinclude.m4
|
|
libffi/Makefile.in: libffi/Makefile.am libffi/configure.ac libffi/aclocal.m4
|
|
libffi/configure: libffi/configure.ac libffi/aclocal.m4
|
|
libffi/fficonfig.h.in: libffi/configure.ac libffi/aclocal.m4
|
|
libgfortran/aclocal.m4: libgfortran/configure.ac libgfortran/acinclude.m4
|
|
libgfortran/Makefile.in: libgfortran/Makefile.am libgfortran/configure.ac libgfortran/aclocal.m4
|
|
libgfortran/configure: libgfortran/configure.ac libgfortran/aclocal.m4
|
|
libjava/aclocal.m4: libjava/configure.ac
|
|
libjava/Makefile.in: libjava/Makefile.am libjava/configure.ac libjava/aclocal.m4
|
|
libjava/configure: libjava/configure.ac libjava/aclocal.m4
|
|
libjava/libltdl/aclocal.m4: libjava/libltdl/configure.ac libjava/libltdl/acinclude.m4
|
|
libjava/libltdl/Makefile.in: libjava/libltdl/Makefile.am libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
|
|
libjava/libltdl/configure: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
|
|
libjava/libltdl/config-h.in: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
|
|
libcpp/aclocal.m4: libcpp/configure.ac
|
|
libcpp/Makefile.in: libcpp/configure.ac libcpp/aclocal.m4
|
|
libcpp/configure: libcpp/configure.ac libcpp/aclocal.m4
|
|
libgomp/aclocal.m4: libgomp/configure.ac libgomp/acinclude.m4
|
|
libgomp/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4
|
|
libgomp/configure: libgomp/configure.ac libgomp/aclocal.m4
|
|
libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4
|
|
# Top level
|
|
Makefile.in: Makefile.tpl Makefile.def
|
|
configure: configure.in config/acx.m4
|
|
EOF
|
|
}
|
|
|
|
|
|
# This function touches generated files such that the ``end'' user does
|
|
# not have to rebuild them.
|
|
touch_files () {
|
|
rm -f Makefile.$$
|
|
echo 'all: \' > Makefile.$$
|
|
files_and_dependencies | sed 's, .*, \\,' >> Makefile.$$
|
|
echo '; @true' >> Makefile.$$
|
|
files_and_dependencies | sed 's, ,: ,' >> Makefile.$$
|
|
files_and_dependencies | sed 's, .*, \\,' >> Makefile.$$
|
|
echo ':' >> Makefile.$$
|
|
echo ' @for f in $? $@; do test -f $$f || exit 0; done; \' >> Makefile.$$
|
|
echo ' echo Touching $@...; \' >> Makefile.$$
|
|
chat ' echo Touching $@... 1>&2; \' >> Makefile.$$
|
|
echo ' touch $@' >> Makefile.$$
|
|
files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$
|
|
|
|
# We would have to explicitly shut off the "Entering... Leaving..."
|
|
# messages through "--no-print-directory" to handle the case when
|
|
# we were called from a recursive invocation (i.e. "$(MAKE)" in a
|
|
# Makefile, not just make). Passing only "-s" doesn't help then,
|
|
# because make has helpfully added "-w" to MAKEFLAGS automatically.
|
|
# Unfortunately we do not require GNU make other than for building
|
|
# and testing, so let's just grep known text explicitly echoed by
|
|
# the rule.
|
|
while ${MAKE-make} -s -f Makefile.$$ all | grep Touching > /dev/null; do
|
|
sleep 1
|
|
done 2>&1
|
|
rm -f Makefile.$$
|
|
}
|
|
|
|
|
|
# Whenever we update the tree or install a patch, we may be modifying
|
|
# this script. By re-execing it, we ensure that the appropriate
|
|
# dependencies and rules will be used.
|
|
touch_files_reexec () {
|
|
chat "Adjusting file timestamps"
|
|
exec ${CONFIG_SHELL-/bin/sh} $self ${silent+"--silent"} --touch
|
|
}
|
|
|
|
# This functions applies a patch to an existing tree.
|
|
apply_patch () {
|
|
if [ -f "$1" ]; then
|
|
echo "Applying patch file $1"
|
|
case $1 in
|
|
*gz)
|
|
gzip -d -c "$1" | patch -p1 ;;
|
|
*bz2)
|
|
bzip2 -d -c "$1" | patch -p1 ;;
|
|
*)
|
|
patch -p1 < "$1";;
|
|
esac
|
|
fi
|
|
touch_files_reexec
|
|
}
|
|
|
|
# Check whether this indeed looks like a local tree.
|
|
if [ ! -f gcc/version.c ]; then
|
|
echo "This does not seem to be a GCC tree!"
|
|
exit
|
|
fi
|
|
|
|
case "$1" in
|
|
--silent)
|
|
silent=t
|
|
shift
|
|
;;
|
|
esac
|
|
|
|
case "$1" in
|
|
# First of all, check whether we are going to process a patch.
|
|
--patch)
|
|
if test "$#" != 2; then
|
|
echo "$1" expects only one argument >&2
|
|
exit 1
|
|
fi
|
|
apply_patch "${2}"
|
|
exit $?
|
|
;;
|
|
|
|
--touch)
|
|
if test "$#" != 1; then
|
|
echo "$1" does not expect any argument >&2
|
|
exit 1
|
|
fi
|
|
touch_files
|
|
exit $?
|
|
;;
|
|
|
|
--list)
|
|
if test "$#" != 1; then
|
|
echo "$1" does not expect any argument >&2
|
|
exit 1
|
|
fi
|
|
files_and_dependencies | sed 's/ /: /'
|
|
exit $?
|
|
;;
|
|
|
|
--help)
|
|
sed -e '1,2d' -e '/^UPDATE_OPTIONS=/{i\
|
|
\
|
|
|
|
p
|
|
}' \
|
|
-e '/^$/,$d' -e 's/#//' -e 's/^ //' < $0
|
|
exit $?
|
|
;;
|
|
|
|
esac
|
|
|
|
# Check whether this indeed looks like a local SVN tree.
|
|
if [ ! -d .svn ]; then
|
|
echo "This does not seem to be a GCC SVN tree!"
|
|
exit
|
|
fi
|
|
|
|
# Check command-line options
|
|
if [ x"${1}"x = x"--nostdflags"x ]; then
|
|
shift
|
|
else
|
|
set -- $UPDATE_OPTIONS ${1+"$@"}
|
|
fi
|
|
|
|
chat "Updating SVN tree"
|
|
|
|
$GCC_SVN ${silent+-q} --non-interactive update ${1+"$@"}
|
|
if [ $? -ne 0 ]; then
|
|
(touch_files_reexec)
|
|
echo "SVN update of full tree failed." >&2
|
|
exit 1
|
|
fi
|
|
|
|
{
|
|
date
|
|
echo "`TZ=UTC date` (revision `svnversion .`)"
|
|
} > LAST_UPDATED
|
|
touch_files_reexec
|