Configure check for smbwrapper
Tim Potter
tpot at acsys.anu.edu.au
Fri Nov 20 03:56:58 GMT 1998
> Currently the only check for smbwrapper support is whether the system
> supports shared libraries. Unfortunately, what is needed, is LD_PRELOAD (or
> like) suppport - which is not tested.
>
> Our system (SVR4 based) does not have LD_PRELOAD support (I am aware of).
> Has anybody idea, how to test for it? I never used this feature.
OK, here's a bit of autoconf to do most of the check. Unfortunately the
AC_DEFINE(LD_PRELOAD) doesn't seem to do anything to include/config.h.
Perhaps someone with more experience with autoconf could fix it.
###############################################
# test for LD_PRELOAD functionality
AC_CACHE_CHECK([for LD_PRELOAD],samba_cv_HAVE_LD_PRELOAD,[
cat > conf-preload.c << EOF
#include <stdio.h>
void main(void)
{
exit(preload_test());
}
EOF
cat > conf-preload1.c << EOF
int preload_test(void)
{
return 1;
}
EOF
cat > conf-preload2.c << EOF
int preload_test(void)
{
return 0;
}
EOF
AC_TRY_COMMAND($CC $CFLAGS -c conf-preload.c)
AC_TRY_COMMAND($CC $LDSHFLAGS $CFLAGS -o libconf-preload1.so conf-preload1.c)
AC_TRY_COMMAND($CC $LDSHFLAGS $CFLAGS -o libconf-preload2.so conf-preload2.c)
AC_TRY_COMMAND($CC $CFLAGS $CPPFLAGS -o conftest conf-preload.o ./libconf-preload1.so)
LD_PRELOAD=./libconf-preload2.so; export LD_PRELOAD
AC_TRY_COMMAND(conftest > conf.out)
if test $? -eq 0; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LD_PRELOAD)
else
AC_MSG_RESULT(no)
fi
])
Tim.
>
> thank you
>
> /andrej
>
More information about the samba-technical
mailing list