diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-02-20 16:18:59 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-02-21 07:45:33 +0000 |
commit | e282c19520802b6c1d61e29fa6dd72a8a991608c (patch) | |
tree | 04af59b091baaf996f9e5d9e27098035152ab82c | |
parent | a299e69bb2be8e0532d190bd925b89d91487bc07 (diff) |
autotools: Fix multiple repetitions of -L build flags
Before:
WS_LDFLAGS=' -Wl,--as-needed -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib'
After:
WS_LDFLAGS=' -Wl,--as-needed -L/usr/local/lib'
Bumps autoconf required version to 2.64.
Change-Id: Idac0e0382481ddd954b07d9ac729f33c9d11639a
Reviewed-on: https://code.wireshark.org/review/14041
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | acinclude.m4 | 4 | ||||
-rw-r--r-- | aclocal-fallback/ax_append_flag.m4 | 71 |
3 files changed, 74 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 1401d7dda0..53295a8298 100644 --- a/Makefile.am +++ b/Makefile.am @@ -704,6 +704,7 @@ EXTRA_DIST = \ aclocal-fallback/glib-2.0.m4 \ aclocal-fallback/gtk-2.0.m4 \ aclocal-fallback/gtk-3.0.m4 \ + aclocal-fallback/ax_append_flag.m4 \ aclocal-fallback/ax_check_compile_flag.m4 \ aclocal-fallback/ax_gcc_x86_cpuid.m4 \ aclocal-fallback/ax_ext.m4 \ diff --git a/acinclude.m4 b/acinclude.m4 index 14a848883c..126334b340 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -59,10 +59,10 @@ dnl Roland McGrath, Noah Friedman, david d zuhn, and many others. # "-R" here. # AC_DEFUN([AC_WIRESHARK_ADD_DASH_L], -[$1="$$1 -L$2" +[AX_APPEND_FLAG(-L$2, $1) case "$host_os" in solaris*) - $1="$$1 -R$2" + AX_APPEND_FLAG(-R$2, $1) ;; esac ]) diff --git a/aclocal-fallback/ax_append_flag.m4 b/aclocal-fallback/ax_append_flag.m4 new file mode 100644 index 0000000000..08f2e07ec6 --- /dev/null +++ b/aclocal-fallback/ax_append_flag.m4 @@ -0,0 +1,71 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) +# +# DESCRIPTION +# +# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space +# added in between. +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains +# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly +# FLAG. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> +# +# 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 3 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, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 6 + +AC_DEFUN([AX_APPEND_FLAG], +[dnl +AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF +AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) +AS_VAR_SET_IF(FLAGS,[ + AS_CASE([" AS_VAR_GET(FLAGS) "], + [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], + [ + AS_VAR_APPEND(FLAGS,[" $1"]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) + ], + [ + AS_VAR_SET(FLAGS,[$1]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) +AS_VAR_POPDEF([FLAGS])dnl +])dnl AX_APPEND_FLAG |