From: yoe Date: Tue, 27 Jan 2004 20:07:59 +0000 (+0000) Subject: r43: Switched to using automake instead of a home-grown Makefile.in; should help me X-Git-Url: http://git.alex.org.uk r43: Switched to using automake instead of a home-grown Makefile.in; should help me get rid of the mistakes I made with `make dist' in the past. --- diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..51ee6c0 --- /dev/null +++ b/Makefile.am @@ -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 index 43b07a4..0000000 --- a/Makefile.in +++ /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"' diff --git a/config.h.in b/config.h.in index 3a670c6..9fa27b1 100644 --- a/config.h.in +++ b/config.h.in @@ -27,6 +27,10 @@ /* 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 header file. */ #undef HAVE_MEMORY_H @@ -102,6 +106,9 @@ /* 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 @@ -117,9 +124,6 @@ /* 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. */ @@ -140,13 +144,13 @@ /* 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 diff --git a/configure.in b/configure.in index 15b1015..3b0af33 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,8 @@ dnl Configure script for NBD system -dnl (c) 1998 Martin Mares , (c) 2000 Pavel Machek -AC_INIT(nbd, 2.6, wouter@debian.org) +dnl (c) 1998 Martin Mares , (c) 2000 Pavel Machek , +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 diff --git a/nbd-server.c b/nbd-server.c index 9056643..be5f3fd 100644 --- a/nbd-server.c +++ b/nbd-server.c @@ -53,6 +53,7 @@ #include #include /* wait */ #include +#include #include /* For BLKGETSIZE */ #include /* sigaction */ #include