# Miscellaneous additional macros for Subversion's own use. # SVN_CONFIG_NICE(FILENAME) # Write a shell script to FILENAME (typically 'config.nice') which reinvokes # configure with all of the arguments. Reserves use of the filename # FILENAME.old for its own use. # This is different from 'config.status --recheck' in that it does add implicit # --no-create --no-recursion options, and stores _just_ the configure # invocation, instead of the entire configured state. AC_DEFUN([SVN_CONFIG_NICE], [ AC_MSG_NOTICE([creating $1]) # This little dance satisfies Cygwin, which cannot overwrite in-use files. if test -f "$1"; then mv "$1" "$1.old" fi cat >"$1" <]], [[]])], [svn_maybe_add_to_cflags_ok="yes"], [svn_maybe_add_to_cflags_ok="no"] ) if test "$svn_maybe_add_to_cflags_ok" = "yes"; then AC_MSG_RESULT([yes, will use it]) else AC_MSG_RESULT([no]) CFLAGS="$svn_maybe_add_to_cflags_saved_flags" fi ]) dnl SVN_REMOVE_STANDARD_LIB_DIRS(OPTIONS) dnl dnl Remove standard library search directories. dnl OPTIONS is a list of compiler/linker options. dnl This macro prints input options except -L options whose arguments are dnl standard library search directories (e.g. /usr/lib). dnl dnl This macro is used to avoid linking against Subversion libraries dnl potentially placed in standard library search directories. AC_DEFUN([SVN_REMOVE_STANDARD_LIB_DIRS], [ input_flags="$1" output_flags="" filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" for flag in $input_flags; do filter="no" for dir in $filtered_dirs; do if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then filter="yes" break fi done if test "$filter" = "no"; then output_flags="$output_flags $flag" fi done if test -n "$output_flags"; then printf "%s" "${output_flags# }" fi ])