+AM_PROG_CC_C_O
+
+dnl *********************************************************************
+dnl FIXME! FIXME! These should be selectable properly, and should produce
+dnl the proper flags and defines...
+dnl *********************************************************************
+
+############################################
+# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
+#AC_SEARCH_LIBS(dlopen, [dl])
+# dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
+
+dnl Checks for libraries.
+dnl Replace `main' with a function in -labs:
+dnl AC_CHECK_LIB(abs, main)
+dnl Replace `main' with a function in -laudit:
+dnl AC_CHECK_LIB(audit, main)
+dnl Replace `main' with a function in -lauth:
+dnl AC_CHECK_LIB(auth, main)
+dnl Replace `main' with a function in -lcmd:
+dnl AC_CHECK_LIB(cmd, main)
+dnl Replace `main' with a function in -lcrypt:
+dnl AC_CHECK_LIB(crypt, main)
+dnl Replace `main' with a function in -ld:
+dnl AC_CHECK_LIB(d, main)
+dnl Replace `main' with a function in -ldl:
+dnl AC_CHECK_LIB(dl, dlopen)
+dnl Replace `main' with a function in -lkauth:
+dnl AC_CHECK_LIB(kauth, main)
+dnl Replace `main' with a function in -lkrb:
+dnl AC_CHECK_LIB(krb, main)
+dnl Replace `main' with a function in -llwp:
+dnl AC_CHECK_LIB(lwp, main)
+dnl Replace `main' with a function in -ln:
+dnl AC_CHECK_LIB(n, main)
+
+dnl not the right stuff but should be enough for now
+AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
+AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
+
+dnl Replace `main' with a function in -lprot:
+dnl AC_CHECK_LIB(prot, main)
+dnl Replace `main' with a function in -lrx:
+dnl AC_CHECK_LIB(rx, main)
+dnl Replace `main' with a function in -lrxkad:
+dnl AC_CHECK_LIB(rxkad, main)
+dnl Replace `main' with a function in -lsys:
+dnl AC_CHECK_LIB(sys, main)
+dnl Replace `main' with a function in -lubik:
+dnl AC_CHECK_LIB(ubik, main)
+
+
+#
+# Check presence of some functions
+#
+# Check for XPG4 access() function
+# Be sure to test before adding AFS libs in LIBS path as AFS lib
+# has such a function that works only on AFS filesystems.
+AC_CHECK_FUNCS(access)
+#