Specify package name and version in call to AC_INIT
[rsync.git] / configure.ac
index 588f551ac5464d335ccb77a8784cc9c1787c2437..58bc46c3dad1648336246ed5b679625bdf19b4e4 100644 (file)
@@ -1,20 +1,25 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT()
+AC_INIT([rsync], [3.1.2dev], [http://rsync.samba.org/bugzilla.html])
+
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SRCDIR([byteorder.h])
 AC_CONFIG_HEADER(config.h)
 AC_PREREQ(2.60)
 
-RSYNC_VERSION=3.1.1pre2
-AC_SUBST(RSYNC_VERSION)
-AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])
+AC_SUBST(RSYNC_VERSION, $PACKAGE_VERSION)
+AC_MSG_NOTICE([Configuring rsync $PACKAGE_VERSION])
 
-AC_DEFINE_UNQUOTED(RSYNC_VERSION, ["$RSYNC_VERSION"], [rsync release version])
+AC_DEFINE_UNQUOTED(RSYNC_VERSION, ["$PACKAGE_VERSION"], [rsync release version])
 
 LDFLAGS=${LDFLAGS-""}
 
 AC_CANONICAL_HOST
 
+dnl define the directory for replacement function since AC_LIBOBJ does not
+dnl officially support subdirs and fails with automake
+AC_CONFIG_LIBOBJ_DIR([lib])
+
 # We must decide this before testing the compiler.
 
 # Please allow this to default to yes, so that your users have more
@@ -486,8 +491,7 @@ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
 
 dnl AC_MSG_NOTICE([Looking in libraries: $LIBS])
 
-AC_CHECK_FUNCS(inet_ntop, , [AC_LIBOBJ(lib/inet_ntop)])
-AC_CHECK_FUNCS(inet_pton, , [AC_LIBOBJ(lib/inet_pton)])
+AC_REPLACE_FUNCS([inet_ntop inet_pton])
 
 AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
 AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/types.h>
@@ -519,9 +523,9 @@ if test x"$rsync_cv_HAVE_GETADDR_DEFINES" = x"yes" -a x"$ac_cv_type_struct_addri
                        AC_DEFINE(HAVE_GETADDRINFO, 1,
                                [Define to 1 if you have the "getaddrinfo" function and required types.])],
                        [AC_MSG_RESULT([no])
-                       AC_LIBOBJ(lib/getaddrinfo)])])
+                       AC_LIBOBJ([getaddrinfo])])])
 else
-       AC_LIBOBJ(lib/getaddrinfo)
+       AC_LIBOBJ([getaddrinfo])
 fi
 
 AC_CHECK_MEMBER([struct sockaddr.sa_len],
@@ -602,7 +606,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
     setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
     seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
     extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
-    initgroups utimensat posix_fallocate attropen setvbuf)
+    initgroups utimensat posix_fallocate attropen setvbuf usleep)
 
 dnl cygwin iconv.h defines iconv_open as libiconv_open
 if test x"$ac_cv_func_iconv_open" != x"yes"; then
@@ -705,6 +709,7 @@ AC_CACHE_CHECK([whether link() can hard-link symlinks],rsync_cv_can_hardlink_sym
     main() {
        unlink(FILENAME);
        if (symlink("conftest.no-such", FILENAME) < 0) abort();
+       unlink(FILENAME "2");
        if (link(FILENAME, FILENAME "2") < 0) exit(1);
        exit(0);
     }],
@@ -724,6 +729,7 @@ AC_CACHE_CHECK([whether link() can hard-link special files],rsync_cv_can_hardlin
     main() {
        unlink(FILENAME);
        if (mkfifo(FILENAME, 0777) < 0) abort();
+       unlink(FILENAME "2");
        if (link(FILENAME, FILENAME "2") < 0) exit(1);
        exit(0);
     }],
@@ -746,7 +752,7 @@ if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then
     AC_DEFINE(HAVE_SOCKETPAIR, 1, [Define to 1 if you have the "socketpair" function])
 fi
 
-AC_CHECK_FUNCS(getpass, , [AC_LIBOBJ(lib/getpass)])
+AC_REPLACE_FUNCS([getpass])
 
 if test x"$with_included_popt" != x"yes"; then
     AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])