diff --git a/tiny-agent/.gitignore b/tiny-agent/.gitignore index bffbdc5..6b08279 100644 --- a/tiny-agent/.gitignore +++ b/tiny-agent/.gitignore @@ -1,8 +1,34 @@ +# Hand-rolled build dir (legacy, kept for any in-flight bare-make users) build/ + +# Object files *.o +*.a + +# Autotools generated +Makefile Makefile.in configure +config.h +config.h.in +config.log +config.status + +# Autoreconf --force backup files (and any editor backups) +*~ aclocal.m4 autom4te.cache/ +build-aux/ +m4/ +stamp-h1 .deps/ .libs/ + +# Built binary +pty_test + +# Dist tarballs and distcheck temp dirs +*.tar.gz +*.tar.bz2 +*.tar.xz +tiny-agent-*/ diff --git a/tiny-agent/Makefile b/tiny-agent/Makefile deleted file mode 100644 index e8bcdce..0000000 --- a/tiny-agent/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -CC = gcc -CFLAGS = -Wall -Wextra -std=c99 -g -LDFLAGS = -lutil - -SRC = src/pty.c -BIN = build/pty_test - -.PHONY: all clean - -all: $(BIN) - -$(BIN): $(SRC) | build - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) - -build: - mkdir -p build - -clean: - rm -rf build diff --git a/tiny-agent/Makefile.am b/tiny-agent/Makefile.am new file mode 100644 index 0000000..5ff2f58 --- /dev/null +++ b/tiny-agent/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = src + +EXTRA_DIST = autogen.sh diff --git a/tiny-agent/autogen.sh b/tiny-agent/autogen.sh new file mode 100755 index 0000000..525de60 --- /dev/null +++ b/tiny-agent/autogen.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec autoreconf --install --force --verbose diff --git a/tiny-agent/configure.ac b/tiny-agent/configure.ac new file mode 100644 index 0000000..bf7036c --- /dev/null +++ b/tiny-agent/configure.ac @@ -0,0 +1,22 @@ +AC_PREREQ([2.69]) +AC_INIT([tiny-agent], [0.1.0], [https://github.com/vivekvjnk/tiny-agent/issues]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_SRCDIR([src/pty.c]) +AC_CONFIG_HEADERS([config.h]) + +AM_INIT_AUTOMAKE([1.15 foreign subdir-objects -Wall -Werror]) +AM_SILENT_RULES([yes]) + +AC_PROG_CC +AC_PROG_INSTALL + +# PTY support +AC_CHECK_HEADER([pty.h], [], [AC_MSG_ERROR([pty.h not found])]) +AC_CHECK_LIB([util], [forkpty], [], + [AC_MSG_ERROR([libutil with forkpty() not found])]) + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) +AC_OUTPUT diff --git a/tiny-agent/src/Makefile.am b/tiny-agent/src/Makefile.am new file mode 100644 index 0000000..ef5765e --- /dev/null +++ b/tiny-agent/src/Makefile.am @@ -0,0 +1,4 @@ +AM_CFLAGS = -Wall -Wextra -std=c99 + +bin_PROGRAMS = pty_test +pty_test_SOURCES = pty.c