heimdal Extend the 'hdb as a keytab' code [HEIMDAL-600]
[heimdal.git] / cf / version-script.m4
blobf08e01344f3f37d6c9c6a6e0996cc862ddda8a5f
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([${CC-cc} -c $CFLAGS -fPIC conftest.c])  && 
20      AC_TRY_COMMAND([${CC-cc} -shared -Wl,--version-script,conftest.map $CFLAGS $LDFLAGS -o libconftestlib.so conftest.o]);
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)