Preliminary autoconf framework. Entirely separate from the main
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 2 Nov 2008 15:51:56 +0000 (15:51 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 2 Nov 2008 15:51:56 +0000 (15:51 +0000)
development makefile; there's a bob build script which creates a
tarball that has an autoconf makefile in place of my GNUmakefile.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8261 cda61777-01e9-0310-a592-d414129be87e

Buildscr [new file with mode: 0644]
GNUmakefile
Makefile.am [new file with mode: 0644]
TODO
configure.ac [new file with mode: 0644]

diff --git a/Buildscr b/Buildscr
new file mode 100644 (file)
index 0000000..e6a5c17
--- /dev/null
+++ b/Buildscr
@@ -0,0 +1,18 @@
+# -*- sh -*-
+#
+# bob script to build the agedu tarball.
+
+module agedu
+
+in agedu do sed '/AC_INIT/s/6.66/r$(revision)/' configure.ac > tmp.ac
+in agedu do mv tmp.ac configure.ac
+in agedu do aclocal
+in agedu do autoconf
+in agedu do autoheader
+in agedu do automake -a --foreign
+
+in . do cp -R agedu agedu-r$(revision)
+in . do rm agedu-r$(revision)/GNUmakefile
+in . do tar czvf agedu-r$(revision).tar.gz agedu-r$(revision)
+
+deliver agedu-r$(revision).tar.gz $@
index 339cc15..1f92d8e 100644 (file)
@@ -31,10 +31,6 @@ $(ALLOBJS): %.o: %.c
        gcc $(CFLAGS) -MM $*.c > $*.d
        gcc $(CFLAGS) $(INTERNALFLAGS) -c $*.c
 
-install: agedu
-       mkdir -p $(bindir)
-       $(INSTALL) -m 0755 agedu $(bindir)/agedu
-
 clean:
        rm -f agedu $(ALLOBJS) $(ALLDEPS)
 
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..fe5671c
--- /dev/null
@@ -0,0 +1,4 @@
+bin_PROGRAMS = agedu
+agedu_SOURCES = agedu.c du.c alloc.c trie.c index.c html.c httpd.c \
+                fgetline.c licence.c
+agedu_LDADD = $(LIBOBJS)
diff --git a/TODO b/TODO
index cfd5577..e362fa2 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,15 +3,11 @@ TODO list for agedu
 
 Before it's non-embarrassingly releasable:
 
- - cross-Unix portability:
-    + use autoconf
-       * configure use of stat64
-       * configure use of /proc/net/tcp
-       * configure use of /dev/random
-       * configure use of Linux syscall magic replacing readdir
-          + later glibcs have fdopendir, hooray! So we can use that
-           too, if it's available and O_NOATIME is too.
-       * what do we do elsewhere about _GNU_SOURCE?
+ - now we have a configure framework, actually use it to:
+    * configure use of stat64
+    * configure use of Linux syscall magic replacing readdir
+       + later glibcs have fdopendir, hooray! So we can use that
+        too, if it's available and O_NOATIME is too.
 
  - man page, --version.
 
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..510a5d1
--- /dev/null
@@ -0,0 +1,38 @@
+# autoconf input for agedu.
+
+AC_INIT([agedu], [6.66], [anakin@pobox.com])
+AC_CONFIG_SRCDIR([agedu.c])
+AC_CONFIG_HEADER([config.h])
+
+AM_INIT_AUTOMAKE
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_CC_C99
+AC_PROG_INSTALL
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h syslog.h termios.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+
+# Checks for library functions.
+AC_FUNC_CLOSEDIR_VOID
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_MMAP
+AC_FUNC_SELECT_ARGTYPES
+AC_FUNC_STRFTIME
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([ftruncate inet_ntoa memchr munmap select socket strcasecmp strchr strcspn strerror strrchr strspn strtoul strtoull])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT