build/autoconf/expandlibs.m4

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 dnl This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4
michael@0 5 AC_DEFUN([MOZ_EXPAND_LIBS],
michael@0 6 [
michael@0 7 dnl ========================================================
michael@0 8 dnl =
michael@0 9 dnl = Check what kind of list files are supported by the
michael@0 10 dnl = linker
michael@0 11 dnl =
michael@0 12 dnl ========================================================
michael@0 13
michael@0 14 AC_CACHE_CHECK(what kind of list files are supported by the linker,
michael@0 15 EXPAND_LIBS_LIST_STYLE,
michael@0 16 [echo "int main() {return 0;}" > conftest.${ac_ext}
michael@0 17 if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&5) && test -s conftest.${OBJ_SUFFIX}; then
michael@0 18 echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
michael@0 19 if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
michael@0 20 EXPAND_LIBS_LIST_STYLE=linkerscript
michael@0 21 else
michael@0 22 echo "conftest.${OBJ_SUFFIX}" > conftest.list
michael@0 23 dnl -filelist is for the OS X linker. We need to try -filelist
michael@0 24 dnl first because clang understands @file, but may pass an
michael@0 25 dnl oversized argument list to the linker depending on the
michael@0 26 dnl contents of @file.
michael@0 27 if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS [-Wl,-filelist,conftest.list] $LIBS 1>&5) && test -s conftest${ac_exeext}; then
michael@0 28 EXPAND_LIBS_LIST_STYLE=filelist
michael@0 29 elif AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
michael@0 30 EXPAND_LIBS_LIST_STYLE=list
michael@0 31 else
michael@0 32 EXPAND_LIBS_LIST_STYLE=none
michael@0 33 fi
michael@0 34 fi
michael@0 35 else
michael@0 36 dnl We really don't expect to get here, but just in case
michael@0 37 AC_ERROR([couldn't compile a simple C file])
michael@0 38 fi
michael@0 39 rm -rf conftest*])
michael@0 40
michael@0 41 LIBS_DESC_SUFFIX=desc
michael@0 42 AC_SUBST(LIBS_DESC_SUFFIX)
michael@0 43 AC_SUBST(EXPAND_LIBS_LIST_STYLE)
michael@0 44
michael@0 45 if test "$GCC_USE_GNU_LD"; then
michael@0 46 AC_CACHE_CHECK(what kind of ordering can be done with the linker,
michael@0 47 EXPAND_LIBS_ORDER_STYLE,
michael@0 48 [> conftest.order
michael@0 49 _SAVE_LDFLAGS="$LDFLAGS"
michael@0 50 LDFLAGS="${LDFLAGS} -Wl,--section-ordering-file,conftest.order"
michael@0 51 AC_TRY_LINK([], [],
michael@0 52 EXPAND_LIBS_ORDER_STYLE=section-ordering-file,
michael@0 53 EXPAND_LIBS_ORDER_STYLE=)
michael@0 54 LDFLAGS="$_SAVE_LDFLAGS"
michael@0 55 if test -z "$EXPAND_LIBS_ORDER_STYLE"; then
michael@0 56 if AC_TRY_COMMAND(${CC-cc} ${DSO_LDOPTS} ${LDFLAGS} -o ${DLL_PREFIX}conftest${DLL_SUFFIX} -Wl,--verbose 2> /dev/null | sed -n '/^===/,/^===/p' | grep '\.text'); then
michael@0 57 EXPAND_LIBS_ORDER_STYLE=linkerscript
michael@0 58 else
michael@0 59 EXPAND_LIBS_ORDER_STYLE=none
michael@0 60 fi
michael@0 61 rm -f ${DLL_PREFIX}conftest${DLL_SUFFIX}
michael@0 62 fi])
michael@0 63 fi
michael@0 64 AC_SUBST(EXPAND_LIBS_ORDER_STYLE)
michael@0 65
michael@0 66 ])

mercurial