summaryrefslogtreecommitdiff
blob: 32b3523d9c9257232416365920454c6fbddf3a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- a/configure.in	2014-12-02 18:56:23.000000000 +0300
+++ b/configure.in	2014-12-02 19:09:46.724190436 +0300
@@ -6,13 +6,13 @@
 
 dnl Checks for libraries.
 dnl Replace `main' with a function in -lftp:
-AC_CHECK_LIB(ftp, main,[LIBS="-DUSE_FTP -lftp"],AC_MSG_WARN([Warning libftp not found ftp features disabled]))
 AC_CHECK_LIB(m, ceil,[LIBS="$LIBS -lm"],AC_MSG_ERROR([Error mlib is required]))
-AC_ARG_ENABLE(ftp,
-[
+AC_ARG_ENABLE([ftp],
+    AS_HELP_STRING([--disable-ftp],[Disables all ftp features and libftp dependencies]))
 
-  --disable-ftp			Disables all ftp features and libftp dependencies
-],[LIBS=""])
+AS_IF([test "x$enable_ftp" != "xno"], [
+    AC_SEARCH_LIBS([FtpInit],[ftp],[CPPFLAGS+="-DUSE_FTP"],AC_MSG_ERROR([libftp not found]))
+])
 
 dnl Checks for header files.
 AC_CONFIG_HEADERS([config.h:config.h.in])