Diff

Differences From Artifact [7b1ee0452b]:

To Artifact [4ebe0b5820]:


     1      1   AC_DEFUN(DC_SETVERSIONSCRIPT, [
     2      2   	VERSIONSCRIPT="$1"
            3  +	SYMFILE="$2"
            4  +
            5  +	delete_symfile='0'
            6  +	if test ! -f "${SYMFILE}"; then
            7  +		delete_symfile='1'
            8  +
            9  +		echo '' > "${SYMFILE}"
           10  +	fi
     3     11   
     4     12   	SAVE_LDFLAGS="${LDFLAGS}"
     5     13   
     6     14   	AC_MSG_CHECKING([for how to set version script])
     7     15   
     8         -	for tryaddldflags in "-Wl,--version-script -Wl,${VERSIONSCRIPT}"; do
           16  +	for tryaddldflags in "-Wl,--version-script -Wl,${VERSIONSCRIPT}" "-Wl,-exported_symbols_list -Wl,${SYMFILE}"; do
     9     17   		LDFLAGS="${SAVE_LDFLAGS} ${tryaddldflags}"
    10     18   		AC_TRY_LINK([], [], [
    11     19   			addldflags="${tryaddldflags}"
    12     20   
    13     21   			break
    14     22   		])
    15     23   	done
           24  +
           25  +	if test "${delete_symfile}" = "1"; then
           26  +		rm -f "${SYMFILE}"
           27  +	fi
    16     28   
    17     29   	if test -n "${addldflags}"; then
    18     30   		LDFLAGS="${SAVE_LDFLAGS} ${addldflags}"
    19     31   		AC_MSG_RESULT($addldflags)
    20     32   	else
    21     33   		LDFLAGS="${SAVE_LDFLAGS}"
    22     34   		AC_MSG_RESULT([don't know])
................................................................................
    32     44   
    33     45   	if test "x${STRIP}" = "xfalse"; then
    34     46   		STRIP="${OBJCOPY}"
    35     47   	fi
    36     48   
    37     49   	WEAKENSYMS='true'
    38     50   	REMOVESYMS='true'
           51  +	SYMPREFIX=''
    39     52   
    40     53   	case $host_os in
    41     54   		darwin*)
    42         -			REMOVESYMS="${STRIP} -s ${SYMFILE}"
           55  +			REMOVESYMS="${STRIP} -i -u -s ${SYMFILE}"
           56  +			SYMPREFIX="_"
    43     57   			;;
    44     58   		*)
    45     59   			if test "x${OBJCOPY}" != "xfalse"; then
    46     60   				WEAKENSYMS="${OBJCOPY} --keep-global-symbols=${SYMFILE}"
    47     61   				REMOVESYMS="${OBJCOPY} --discard-all"
    48     62   			elif test "x${STRIP}" != "xfalse"; then
    49     63   				REMOVESYMS="${STRIP} -x"
    50     64   			fi
    51     65   			;;
    52     66   	esac
    53     67   
    54     68   	AC_SUBST(WEAKENSYMS)
    55     69   	AC_SUBST(REMOVESYMS)
           70  +	AC_SUBST(SYMPREFIX)
    56     71   ])