Vsftpd ver 2.1.1 (05/28/2009)
[tomato.git] / release / src / router / vsftpd / vsf_findlibs.sh
blob3014f009568a1280f46e742b67bc6f3f12ab2f3c
1 #!/bin/sh
2 # Cheesy hacky location of additional link libraries.
4 locate_library() { [ ! "$1*" = "`echo $1*`" ]; }
5 find_func() { egrep $1 $2 >/dev/null; }
7 if find_func hosts_access tcpwrap.o; then
8 echo "-lwrap";
9 locate_library /lib/libnsl.so && echo "-lnsl";
12 # Look for PAM (done weirdly due to distribution bugs (e.g. Debian) or the
13 # crypt library.
14 if find_func pam_start sysdeputil.o; then
15 locate_library /lib/libpam.so.0 && echo "/lib/libpam.so.0";
16 locate_library /usr/lib/libpam.so && echo "-lpam";
17 # HP-UX ends shared libraries with .sl
18 locate_library /usr/lib/libpam.sl && echo "-lpam";
19 # AIX ends shared libraries with .a
20 locate_library /usr/lib/libpam.a && echo "-lpam";
21 else
22 locate_library /lib/libcrypt.so && echo "-lcrypt";
23 locate_library /usr/lib/libcrypt.so && echo "-lcrypt";
26 # Look for the dynamic linker library. Needed by older RedHat when
27 # you link in PAM
28 locate_library /lib/libdl.so && echo "-ldl";
30 # Look for libsocket. Solaris needs this.
31 locate_library /lib/libsocket.so && echo "-lsocket";
33 # Look for libnsl. Solaris needs this.
34 locate_library /lib/libnsl.so && echo "-lnsl";
36 # Look for libresolv. Solaris needs this.
37 locate_library /lib/libresolv.so && echo "-lresolv";
39 # Look for libutil. Older FreeBSD need this for setproctitle().
40 locate_library /usr/lib/libutil.so && echo "-lutil";
42 # For older HP-UX...
43 locate_library /usr/lib/libsec.sl && echo "-lsec";
45 # Look for libcap (capabilities)
46 if locate_library /lib/libcap.so.1; then
47 echo "/lib/libcap.so.1";
48 elif locate_library /lib/libcap.so.2; then
49 echo "/lib/libcap.so.2";
50 else
51 locate_library /usr/lib/libcap.so && echo "-lcap";
52 locate_library /lib/libcap.so && echo "-lcap";
55 # Solaris needs this for nanosleep()..
56 locate_library /lib/libposix4.so && echo "-lposix4";
57 locate_library /usr/lib/libposix4.so && echo "-lposix4";
59 # Tru64 (nanosleep)
60 locate_library /usr/shlib/librt.so && echo "-lrt";
62 # Solaris sendfile
63 locate_library /usr/lib/libsendfile.so && echo "-lsendfile";
65 # OpenSSL
66 if find_func SSL_library_init ssl.o; then
67 echo "-lssl -lcrypto";
70 exit 0;