fixes from Stefan Metzmacher
[heimdal.git] / cf / version-script.m4
blob59f6f9478679c388c69139839be5d3a034c9c337
1 dnl check if ld supports --version-script
2 dnl
3 AC_DEFUN([rk_VERSIONSCRIPT],[
4 AC_CACHE_CHECK(for ld --version-script, rk_cv_version_script,[
5   rk_cv_version_script=no
7   cat > conftest.map <<EOF
8 HEIM_GSS_V1 {
9         global: gss*;
11 HEIM_GSS_V1_1 {
12         global: gss_init_creds;
13 } HEIM_GSS_V1;
14 EOF
15 cat > conftest.c <<EOF
16 int gss_init_creds(int foo) { return 0; }
17 EOF
19   if AC_TRY_COMMAND([$SHELL libtool --tag=CC --mode=compile ${CC-cc} -c $CFLAGS conftest.c])  && 
20      AC_TRY_COMMAND([$SHELL libtool --tag=CC --mode=link ${CC-cc} -version-info 1:0:0 -Wl,--version-script,conftest.map -rpath `pwd` $CFLAGS $LDFLAGS -o libconftestlib.la conftest.lo]);
21   then
22     rk_cv_version_script=yes
23   fi
24 rm -rf conftest* libconftest* .libs
27 if test $rk_cv_version_script = yes ; then
28   doversioning=yes
29   LDFLAGS_VERSION_SCRIPT="-Wl,--version-script,"
30 else
31   doversioning=no
32   LDFLAGS_VERSION_SCRIPT=
34 AC_SUBST(VERSIONING)
36 AM_CONDITIONAL(versionscript,test $doversioning = yes)
37 AC_SUBST(LDFLAGS_VERSION_SCRIPT)