xref: /minix3/crypto/external/bsd/heimdal/dist/cf/version-script.m4 (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambucdnl check if ld supports --version-script
2*ebfedea0SLionel Sambucdnl
3*ebfedea0SLionel SambucAC_DEFUN([rk_VERSIONSCRIPT],[
4*ebfedea0SLionel SambucAC_CACHE_CHECK(for ld --version-script, rk_cv_version_script,[
5*ebfedea0SLionel Sambuc  rk_cv_version_script=no
6*ebfedea0SLionel Sambuc
7*ebfedea0SLionel Sambuc  cat > conftest.map <<EOF
8*ebfedea0SLionel SambucHEIM_GSS_V1 {
9*ebfedea0SLionel Sambuc        global: gss*;
10*ebfedea0SLionel Sambuc};
11*ebfedea0SLionel SambucHEIM_GSS_V1_1 {
12*ebfedea0SLionel Sambuc        global: gss_init_creds;
13*ebfedea0SLionel Sambuc} HEIM_GSS_V1;
14*ebfedea0SLionel SambucEOF
15*ebfedea0SLionel Sambuccat > conftest.c <<EOF
16*ebfedea0SLionel Sambucint gss_init_creds(int foo) { return 0; }
17*ebfedea0SLionel SambucEOF
18*ebfedea0SLionel Sambuc
19*ebfedea0SLionel Sambuc  if AC_TRY_COMMAND([${CC-cc} -c $CFLAGS -fPIC conftest.c])  &&
20*ebfedea0SLionel Sambuc     AC_TRY_COMMAND([${CC-cc} -shared -Wl,--version-script,conftest.map $CFLAGS $LDFLAGS -o libconftestlib.so conftest.o]);
21*ebfedea0SLionel Sambuc  then
22*ebfedea0SLionel Sambuc    rk_cv_version_script=yes
23*ebfedea0SLionel Sambuc  fi
24*ebfedea0SLionel Sambucrm -rf conftest* libconftest* .libs
25*ebfedea0SLionel Sambuc])
26*ebfedea0SLionel Sambuc
27*ebfedea0SLionel Sambucif test $rk_cv_version_script = yes ; then
28*ebfedea0SLionel Sambuc  doversioning=yes
29*ebfedea0SLionel Sambuc  LDFLAGS_VERSION_SCRIPT="-Wl,--version-script,"
30*ebfedea0SLionel Sambucelse
31*ebfedea0SLionel Sambuc  doversioning=no
32*ebfedea0SLionel Sambuc  LDFLAGS_VERSION_SCRIPT=
33*ebfedea0SLionel Sambucfi
34*ebfedea0SLionel SambucAC_SUBST(VERSIONING)
35*ebfedea0SLionel Sambuc
36*ebfedea0SLionel SambucAM_CONDITIONAL(versionscript,test $doversioning = yes)
37*ebfedea0SLionel SambucAC_SUBST(LDFLAGS_VERSION_SCRIPT)
38*ebfedea0SLionel Sambuc
39*ebfedea0SLionel Sambuc])