r43: Switched to using automake instead of a home-grown Makefile.in; should help me
authoryoe <yoe>
Tue, 27 Jan 2004 20:07:59 +0000 (20:07 +0000)
committeryoe <yoe>
Tue, 27 Jan 2004 20:07:59 +0000 (20:07 +0000)
get rid of the mistakes I made with `make dist' in the past.

Makefile.am [new file with mode: 0644]
Makefile.in [deleted file]
config.h.in
configure.in
nbd-server.c

diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..51ee6c0
--- /dev/null
@@ -0,0 +1,14 @@
+bin_PROGRAMS = nbd-server
+EXTRA_PROGRAMS = nbd-client
+nbd_client_SOURCES = nbd-client.c cliserv.h
+nbd_server_SOURCES = nbd-server.c cliserv.h
+man1_MANS = nbd-server.1
+man8_MANS = nbd-client.8
+EXTRA_DIST = nbd.h nbd-client.8.sgml nbd-server.1.sgml gznbd winnbd
+DISTCLEANFILES = nbd-client.8 nbd-server.1
+nbd-server.1: nbd-server.1.sgml
+       docbook-to-man nbd-server.1.sgml > nbd-server.1
+nbd-client.8: nbd-client.8.sgml
+       docbook-to-man nbd-client.8.sgml > nbd-client.8
+dist-hook:
+       rm -Rf `find $(distdir) -name 'CVS' -type d -print`
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644 (file)
index 43b07a4..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-mandir=@mandir@
-srcdir=@srcdir@
-CC=@CC@
-CFLAGS=@CFLAGS@
-LIBS=@LIBS@
-LDFLAGS=@LDFLAGS@ $(LIBS)
-VPATH=@srcdir@
-INSTALL=install
-CMDS=nbd-server @BUILD_CLIENT@
-
-all: $(CMDS)
-
-nbd-client: nbd-client.o
-
-nbd-client.o: nbd-client.c cliserv.h config.h
-
-nbd-server: nbd-server.o
-
-nbd-server.o: nbd-server.c cliserv.h config.h
-       $(CC) $(CFLAGS) $(FSCHOICE) -c nbd-server.c
-
-install: $(CMDS)
-       strip $(CMDS)
-       $(INSTALL) $(CMDS) $(bindir)/
-
-clean:
-       rm -f `find . -name "*~" -o -name "*.[oa]" -o -name "\#*\#" -o -name TAGS -o -name core`
-       rm -f $(CMDS)
-
-distclean: clean
-       rm -f Makefile config.h config.cache config.log config.status
-
-allclean: distclean
-       rm -f configure config.h.in
-
-dist: distclean
-       sh -c 'X=`pwd` ; X=`basename $$X` ; cd .. ; tar czvvf /tmp/$$X.tar.gz $$X --exclude CVS --exclude tmp --exclude "*.tar.gz"'
index 3a670c6..9fa27b1 100644 (file)
 /* Define to 1 if you have the `llseek' function. */
 #undef HAVE_LLSEEK
 
+/* Define to 1 if you want to use a local nbd.h (not provided, must be
+   supplied by you */
+#undef HAVE_LOCAL_NBD_H
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
 /* Define to 1 if Large File Support should be enabled */
 #undef NBD_LFS
 
+/* Name of package */
+#undef PACKAGE
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* Define to 1 if the C compiler supports function prototypes. */
-#undef PROTOTYPES
-
 /* Define to 1 if the `setvbuf' function takes the buffering type as its
    second argument and the buffer pointer as the third, as on System V before
    release 3. */
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* Version number of package */
+#undef VERSION
+
 /* Define to 1 if your processor stores words with the most significant byte
    first (like Motorola and SPARC, unlike Intel and VAX). */
 #undef WORDS_BIGENDIAN
 
-/* Define like PROTOTYPES; this can be used by system headers. */
-#undef __PROTOTYPES
-
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
index 15b1015..3b0af33 100644 (file)
@@ -1,6 +1,8 @@
 dnl Configure script for NBD system
-dnl (c) 1998 Martin Mares <mj@ucw.cz>, (c) 2000 Pavel Machek <pavel@ucw.cz>
-AC_INIT(nbd, 2.6, wouter@debian.org)
+dnl (c) 1998 Martin Mares <mj@ucw.cz>, (c) 2000 Pavel Machek <pavel@ucw.cz>,
+dnl (c) 2003-2004 Wouter Verhelst
+AC_INIT([nbd],[2.7],[wouter@debian.org])
+AM_INIT_AUTOMAKE(nbd, 2.7)
 AC_ARG_ENABLE(lfs, AC_HELP_STRING([--enable-lfs],[Enable Large File Support]), [NBD_LFS=1], [NBD_LFS=0])
 AC_MSG_CHECKING([whether Large File Support should be enabled])
 if test $NBD_LFS -eq 1; then
@@ -39,7 +41,7 @@ AC_FUNC_FORK
 AC_FUNC_SETVBUF_REVERSED
 AC_MSG_CHECKING(whether client should be built)
 case "`uname`" in
-     *Linux*) BUILD_CLIENT=nbd-client
+     *Linux*) sbin_PROGRAMS=nbd-client
              AC_MSG_RESULT(yes)
               ;;
      *) AC_MSG_RESULT(no) ;;
@@ -55,7 +57,8 @@ AC_CHECK_HEADERS([linux/nbd.h arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl
 AC_HEADER_SYS_WAIT
 AC_TYPE_OFF_T
 AC_TYPE_PID_T
-AC_SUBST(BUILD_CLIENT)
-AC_CONFIG_HEADER(config.h)
-AC_OUTPUT(Makefile)
+AC_SUBST(sbin_PROGRAMS)
+AM_CONFIG_HEADER(config.h)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
 
index 9056643..be5f3fd 100644 (file)
@@ -53,6 +53,7 @@
 #include <sys/stat.h>
 #include <sys/wait.h>          /* wait */
 #include <sys/ioctl.h>
+#include <sys/param.h>
 #include <sys/mount.h>         /* For BLKGETSIZE */
 #include <signal.h>            /* sigaction */
 #include <netinet/tcp.h>