Stop trading one compiler warning for another.

* subversion/libsvn_subr/error.c
  (err_abort): Disable the unused-variable warning via pramgas when e can
    rather than using the variable by setting it to itself, which creates
    another warning.  Leave the old method in place for compilers that
    don't support this method.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574174 13f79535-47bb-0310-9956-ffa450edef68
In libsvn_repos, simplify hash iteration code a little by using key and
value accessor functions rather than apr_hash_this(), as we already do in
many other places.

Though I lament the length of those svn__apr_hash_index_* identifiers (which
I created), at least it's a step closer to readable. We can shorten them
later to apr_hash_this_* by adding configury, now that APR 1.5 has those.

* subversion/libsvn_repos/delta.c
  (delta_dirs): As above.

* subversion/libsvn_repos/fs-wrap.c
  (svn_repos_fs_commit_txn): As above.

* subversion/libsvn_repos/hooks.c
  (lock_token_content): As above.

* subversion/libsvn_repos/load-fs-vtable.c
  (prefix_mergeinfo_paths,
   renumber_mergeinfo_revs,
   remove_node_props): As above.

* subversion/libsvn_repos/log.c
  (svn_repos_check_revision_access,
   turn_moves_into_copies,
   turn_unique_copies_into_moves,
   detect_changed,
   fs_mergeinfo_changed,
   get_combined_mergeinfo_changes,
   send_log,
   combine_mergeinfo_path_lists): As above.

* subversion/libsvn_repos/replay.c
  (add_subdir,
   svn_repos_replay2,
   svn_repos__replay_ev2): As above.

* subversion/libsvn_repos/reporter.c
  (delta_proplists): As above.

* subversion/libsvn_repos/rev_hunt.c
  (find_merged_revisions): As above.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574181 13f79535-47bb-0310-9956-ffa450edef68
Shut up a bunch of warnings from SQLite Amalgamation.

I get no warnings from CLang now, but GCC still spits a bunch out for me
since you simply can't turn them off with pragmas.  Our only option is
to figure out how to pass '-w' to GCC when building this file.

* subversion/libsvn_subr/sqlite3wrapper.c:
  Don't bother with the push or pop.  Effectively nothing is in this file but
  the SQLite Amalgamation so no reason to turn them back on.  Since the other
  pragmas have been supported since GCC 4.2 let more compilers benefit from
  reduced warnings.  CLang has shorten-64-to-32 so disable it for it not just
  Apple's fork of GCC.  Add two CLang specific warnings.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574238 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_subr/mergeinfo.c: Fix typos in comments.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574398 13f79535-47bb-0310-9956-ffa450edef68
* subversion/tests/libsvn_repos/dir-delta-editor.h
  (dir_delta_get_editor): Add a doc string.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574450 13f79535-47bb-0310-9956-ffa450edef68
* subversion/svn/util.c
  (svn_cl__merge_file_externally): When the merge tool fails to run, include
    the path to the merge tool in the error message, not just the exit code.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574458 13f79535-47bb-0310-9956-ffa450edef68
* subversion/svn/conflict-callbacks.c
  (handle_text_conflict): Inform the user if falling back to the internal
   merge tool.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574459 13f79535-47bb-0310-9956-ffa450edef68
* subversion/svn/conflict-callbacks.c
  (open_editor, handle_text_conflict, conflict_func_interactive): Use the
   svn_err_best_message() function instead of hand-rolling an error messsage
   to fall back on. 


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574461 13f79535-47bb-0310-9956-ffa450edef68
Remove some (since at least 1.8.0) unused gen-make options, from when we only
supported in-tree builds of bdb and apr-util.

* gen-make.py
  Remove support for --enable-bdb-in-apr-util,
  --with-neon and --without-neon.

* build/generator/gen_win_dependencies.py
  Stop parsing enable-bdb-in-apr-util.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574561 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_subr/utf8proc.c
  Following up on r1573069, resolve a shadowed symbol warning by redefining
  strlen when including "utf8proc/utf8proc.c".


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574573 13f79535-47bb-0310-9956-ffa450edef68
Fix getopt tests with KWallet, followup to r1572106

Obvious fix.

* subversion/tests/cmdline/getopt_tests.py
  (del_lines_res): Adjust pattern to fit actual output of --version
    with KWallet


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574665 13f79535-47bb-0310-9956-ffa450edef68
Kick off work on pkg-config support (issue #738, and also #4435).

pkg-config support allows API consumers on UNIX-like systems to link
to Subversion libraries without having to manually specify the correct
set of linker flags, including the particular flags for dependencies
required by a particular build of Subversion (bdb, serf, etc.).
pkg-config uses libsvn_foo.pc files which describe the set of flags
required to link to libsvn_foo.
See http://www.freedesktop.org/wiki/Software/pkg-config/ for more information.

Make gen-make.py produce .pc.in files for all Subversion libraries,
and make the configure script produce .pc files from these .pc.in files.
Dependency declarations and linker flags are based on information
parsed from build.conf.

Dependencies of Subversion which support pkg-config can be marked
as such in build.conf, allowing pkg-config to resolve them. The
name of the dependency's pkg-config script has to be specified
without the .pc extension, e.g.:

 [gnome-keyring]
 type = lib
 external-lib = $(SVN_GNOME_KEYRING_LIBS)
 pkg-config = gnome-keyring-1

Dependencies not aware of pkg-config are added to linker flags directly.

To illustrate, the generated libsvn_client.pc file on my system contains:

[[[
  prefix=/home/stsp/svn/prefix/svn-trunk
  exec_prefix=${prefix}
  libdir=${exec_prefix}/lib
  includedir=${prefix}/include
  
  Name: libsvn_client
  Description: Subversion Client Library
  Version: 1.9.0
  Required:  apr-1
  Required.private: 
  Libs: -L${libdir}  -lsvn_wc -lsvn_ra -lsvn_delta -lsvn_diff -lsvn_subr
  Cflags: -I${includedir}
]]]

There is no support for optional dependencies between Subversion libraries
yet, however. For instance, libsvn_client might or might not be linked to
libsvn_ra_serf. Such dependencies are currently omitted. Also, I'm not
sure yet what to do in cases where a dependency might be statically or
dynamically linked, e.g. sqlite.

The .pc files are not being installed yet. I don't want to expose these
files to systems using pkg-config until all outstanding issues are resolved.

* build/generator/gen_make.py
  (Generator.write): Generate .pc.in files.
  (Generator.write_pkg_config_dot_in_files): New helper function.

* build/generator/templates/pkg-config.in.ezt: New file, the .pc.in template.

* build.conf: apr, apr-util, serf, gnome-keyring, and sqlite support pkg-config.
   There may be others (kwallet?) but I haven't investiged more yet.
   I also haven't checked yet if all versions of these dependencies support
   pkg-config. The most recent versions do support it.

* configure.ac
  (SVN_APR_MAJOR_VERSION): Declare. APR's major version number is needed
   to select the correct pkg-config script name (e.g. apr-1 or apr-2).
   Generate .pc files from pc.in files.

* subversion/libsvn_auth_gnome_keyring, subversion/libsvn_auth_kwallet,
  subversion/libsvn_client, subversion/libsvn_delta, subversion/libsvn_diff,
  subversion/libsvn_fs, subversion/libsvn_fs_base, subversion/libsvn_fs_fs,
  subversion/libsvn_fs_util, subversion/libsvn_fs_x, subversion/libsvn_ra,
  subversion/libsvn_ra_local, subversion/libsvn_ra_serf,
  subversion/libsvn_ra_svn, subversion/libsvn_repos, subversion/libsvn_subr,
  subversion/libsvn_wc: Ignore generated .pc and .pc.in files.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574710 13f79535-47bb-0310-9956-ffa450edef68
Add missing descriptions for several libraries to build.conf.
These descriptions are used in pkg-config .pc files and I noticed
a few .pc files were lacking them.

* build.conf
  (libsvn_fs_base, libsvn_fs_fs, libsvn_fs_x,
   libsvn_fs_util, libsvn_ra, libsvn_ra_serf,
   libsvn_ra_svn, libsvn_ra_local): Describe these libraries.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574720 13f79535-47bb-0310-9956-ffa450edef68
* configure.ac: Tweak .pc generation to handle builddir != srcdir.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574842 13f79535-47bb-0310-9956-ffa450edef68
* configure.ac: Add quotes around ${abs_srcdir}.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574848 13f79535-47bb-0310-9956-ffa450edef68
Don't let invalid mergeinfo stop 'svnadmin dump' from producing a dump.
Just continue.

Part of issue #4476 "Mergeinfo containing r0 makes svnsync and svnadmin dump
fail".

* subversion/libsvn_repos/dump.c
  (verify_mergeinfo_revisions): New function, factored out of ...
  (dump_node): ... here. And if verify_mergeinfo_revisions() produces any
    error, ignore the error and continue.

* subversion/tests/libsvn_repos/repos-test.c
  (dump_r0_mergeinfo_notifier): New function.
  (test_dump_r0_mergeinfo): New test function.
  (test_funcs): Run it.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574868 13f79535-47bb-0310-9956-ffa450edef68
Fix typos in comments: s/begin/being/.

* subversion/include/svn_fs.h
  (svn_fs_progress_notify_func_t): Fix typo.

* subversion/libsvn_subr/named_atomic.c
  (svn_atomic_namespace__create): Fix typo.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574982 13f79535-47bb-0310-9956-ffa450edef68
Make the C tests work with the --enable-optimize configure option.

Because the main() function used to be defined in libsvn_test,
the -flto option (which performs rather aggressive link-time
optimizations) would cause the linker to remove all "unreferenced"
static functions ... which includes all the actual tests.

Which this change, main() is now defined in each test driver.

* subversion/tests/svn_test.h
  (test_funcs, svn_test_max_threads): Remove external declarations.
  (svn_test_main): New prototype for the (existing-but-renamed) test driver.
  (SVN_TEST_MAIN): Bolierplate macro that generates a main() implementation.

* subversion/tests/svn_test_main.c
  (svn_test_main): Renamed from 'main', and takes two extra parameters,
   'max_threads' and 'test_funcs'. Propagates test_funcs to get_array_size,
   do_test_num and do_tests_concurrently.
  (get_array_size, do_test_num,
   test_params_t, test_thread, do_tests_concurrently): Require a test_funcs
   parameter. All uses updated.

* subversion/tests/libsvn_client/client-test.c,
  subversion/tests/libsvn_client/mtcc-test.c,
  subversion/tests/libsvn_delta/random-test.c,
  subversion/tests/libsvn_delta/window-test.c,
  subversion/tests/libsvn_diff/diff-diff3-test.c,
  subversion/tests/libsvn_diff/parse-diff-test.c,
  subversion/tests/libsvn_fs/fs-test.c,
  subversion/tests/libsvn_fs/locks-test.c,
  subversion/tests/libsvn_fs_base/
  subversion/tests/libsvn_fs_base/changes-test.c,
  subversion/tests/libsvn_fs_base/fs-base-test.c,
  subversion/tests/libsvn_fs_base/strings-reps-test.c,
  subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c,
  subversion/tests/libsvn_fs_x/fs-x-pack-test.c,
  subversion/tests/libsvn_fs_x/string-table-test.c,
  subversion/tests/libsvn_ra/ra-test.c,
  subversion/tests/libsvn_ra_local/ra-local-test.c,
  subversion/tests/libsvn_repos/repos-test.c,
  subversion/tests/libsvn_subr/auth-test.c,
  subversion/tests/libsvn_subr/cache-test.c,
  subversion/tests/libsvn_subr/checksum-test.c,
  subversion/tests/libsvn_subr/compat-test.c,
  subversion/tests/libsvn_subr/config-test.c,
  subversion/tests/libsvn_subr/crypto-test.c,
  subversion/tests/libsvn_subr/dirent_uri-test.c,
  subversion/tests/libsvn_subr/error-code-test.c,
  subversion/tests/libsvn_subr/error-test.c,
  subversion/tests/libsvn_subr/hashdump-test.c,
  subversion/tests/libsvn_subr/io-test.c,
  subversion/tests/libsvn_subr/mergeinfo-test.c,
  subversion/tests/libsvn_subr/named_atomic-test.c,
  subversion/tests/libsvn_subr/opt-test.c,
  subversion/tests/libsvn_subr/packed-data-test.c,
  subversion/tests/libsvn_subr/path-test.c,
  subversion/tests/libsvn_subr/prefix-string-test.c,
  subversion/tests/libsvn_subr/priority-queue-test.c,
  subversion/tests/libsvn_subr/revision-test.c,
  subversion/tests/libsvn_subr/root-pools-test.c,
  subversion/tests/libsvn_subr/skel-test.c,
  subversion/tests/libsvn_subr/spillbuf-test.c,
  subversion/tests/libsvn_subr/sqlite-test.c,
  subversion/tests/libsvn_subr/stream-test.c,
  subversion/tests/libsvn_subr/string-test.c,
  subversion/tests/libsvn_subr/subst_translate-test.c,
  subversion/tests/libsvn_subr/time-test.c,
  subversion/tests/libsvn_subr/translate-test.c,
  subversion/tests/libsvn_subr/utf-test.c,
  subversion/tests/libsvn_wc/conflict-data-test.c,
  subversion/tests/libsvn_wc/db-test.c,
  subversion/tests/libsvn_wc/entries-compat.c,
  subversion/tests/libsvn_wc/op-depth-test.c,
  subversion/tests/libsvn_wc/pristine-store-test.c,
  subversion/tests/libsvn_wc/wc-queries-test.c,
  subversion/tests/libsvn_wc/wc-test.c:
   (max_threads): Renamed from svn_test_max_threads and made static.
   (test_funcs): Made static.
   (SVN_TEST_MAIN): Expanded boilerplate main() function.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1574988 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_repos/dump.c
  (svn_repos_verify_fs3): Add a comment. Remove a misplaced
    comment. Tweak white space.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1575007 13f79535-47bb-0310-9956-ffa450edef68
Duplicate author value in the right pool in ra_serf, when retrieving the
nodes in a directory. Resolves a regression introduced by introducing
scratch pools inside the directory walking code to hold the http state
that used to be in the ra operation result pool.

* subversion/libsvn_ra_serf/stat.c
  (dirent_walker): Copy author to result pool.

Found by: steveking


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1575018 13f79535-47bb-0310-9956-ffa450edef68