]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Switch to GNU autotools.
authorSimon Ruderich <simon@ruderich.org>
Sat, 5 Mar 2011 22:16:55 +0000 (23:16 +0100)
committerSimon Ruderich <simon@ruderich.org>
Sat, 5 Mar 2011 22:19:31 +0000 (23:19 +0100)
.gitignore [new file with mode: 0644]
Makefile [deleted file]
Makefile.am [new file with mode: 0644]
configure.ac [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/tlsproxy.c [moved from tlsproxy.c with 99% similarity]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..fb15544
--- /dev/null
@@ -0,0 +1,18 @@
+# Created by autoreconf.
+Makefile.in
+aclocal.m4
+autom4te.cache/
+build-aux/
+config.h.in
+configure
+src/Makefile.in
+# Created by ./configure.
+Makefile
+config.h
+config.log
+config.status
+src/.deps/
+src/Makefile
+stamp-h1
+# Created by make.
+src/tlsproxy
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index ed3deaf..0000000
--- a/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-all: tlsproxy
-
-
-tlsproxy: tlsproxy.c
-       gcc -Wall -Wextra -DDEBUG -o tlsproxy $^
-
-clean:
-       rm -f tlsproxy
-
-.PHONY: all clean
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..af437a6
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..bf75ebb
--- /dev/null
@@ -0,0 +1,28 @@
+AC_INIT([tlsproxy], [0.1], [simon@ruderich.org])
+
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([src/tlsproxy.c])
+
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
+
+AC_PROG_CC
+
+if test "x$GCC" = xyes; then
+    CFLAGS="-std=c89 -pedantic -Wall -Wextra -Werror -D_XOPEN_SOURCE=500 $CFLAGS"
+fi
+
+AC_CHECK_LIB([gnutls], [gnutls_certificate_verify_peers2])
+if test "x$ac_cv_lib_gnutls_gnutls_certificate_verify_peers2" != xyes; then
+   AC_MSG_ERROR([GnuTLS is required])
+fi
+
+AC_ARG_ENABLE([debug],
+              [AC_HELP_STRING([--enable-debug], [enable debug output])],
+              [if test "x$enableval" = xyes; then
+                   AC_DEFINE([DEBUG], 1, [Define to enable debug output.])
+               fi])
+
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([Makefile src/Makefile])
+AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..677f369
--- /dev/null
@@ -0,0 +1,2 @@
+bin_PROGRAMS = tlsproxy
+tlsproxy_SOURCES = tlsproxy.c
similarity index 99%
rename from tlsproxy.c
rename to src/tlsproxy.c
index 157633bf20e348ea1613879b0c3584479aefa652..68b5a2edf73854ac211f0443b26d02929f0dd497 100644 (file)
@@ -35,6 +35,8 @@
 /* poll() */
 #include <poll.h>
 
+#include <config.h>
+
 
 /* Maximum line of the request line. Longer request lines are aborted with an
  * error. The standard doesn't specify a maximum line length but this should