1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
Author: Christian Seiler <christian@iwakd.de>
Last-Update: Mon, 27 Jun 2016 23:57:12 +0200
Description: Add autoconf stuff to enable simple library creation
--- /dev/null
+++ b/code/Makefile.am
@@ -0,0 +1,16 @@
+lib_LTLIBRARIES = libdisorder.la
+libdisorder_la_SOURCES = src/disorder.c
+libdisorder_la_LDFLAGS = -version-info @LIB_VERSION@
+libdisorder_la_CPPFLAGS = -Iinclude
+libdisorder_la_LIBADD = -lm
+
+bin_PROGRAMS = ropy
+ropy_SOURCES = tool/ropy.c
+ropy_LDADD = libdisorder.la
+
+include_HEADERS = include/disorder.h
+man_MANS = man/shannon_H.3
+
+TESTS = test/gpl.sh
+TEST_EXTENSIONS = .sh
+SH_LOG_COMPILER = /bin/sh
--- /dev/null
+++ b/code/configure.ac
@@ -0,0 +1,47 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_INIT(disorder, 0.0.2, michael@freshdefense.net)
+AC_CONFIG_HEADERS([config.h])
+
+AC_PREREQ(2.64)
+
+# Directory that contains install-sh and other auxiliary files
+AC_CONFIG_AUX_DIR([config])
+
+################################################################################
+# According to (http://www.mail-archive.com/autoconf@gnu.org/msg14232.html)
+# this macro should be after AC_INIT but before AM_INIT_AUTOMAKE
+################################################################################
+AC_CONFIG_MACRO_DIR(config)
+
+AM_INIT_AUTOMAKE([1.11 parallel-tests foreign subdir-objects dist-zip tar-ustar filename-length-max=299])
+
+LIB_VERSION=0:0
+
+AC_SUBST([VERSION])
+AC_SUBST([LIB_VERSION])
+
+AC_SUBST([VERSION])
+
+# Checks for programs.
+AC_PROG_LN_S
+AC_PROG_INSTALL
+
+LT_PREREQ(2.2)
+LT_INIT
+
+CPPFLAGS="-I\$(top_srcdir) $CPPFLAGS"
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stdlib.h])
+
+AC_PROG_MAKE_SET
+
+AC_CONFIG_FILES([
+ Makefile
+ ])
+AC_OUTPUT
+
--- /dev/null
+++ b/code/test/gpl.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+EXPECTED="tokens: 78 entropy: 4.737054 metric: 0.000259 maxent: 6.285402 ratio: 0.753660"
+ACTUAL="$(./ropy COPYING)"
+
+if [ x"$EXPECTED" = x"$ACTUAL" ] ; then
+ echo "Entropy of COPYING matches expected value."
+ exit 0
+else
+ echo "Test failure:"
+ echo " expected output:"
+ echo -n " "
+ echo "$EXPECTED"
+ echo " actual output:"
+ echo -n " "
+ echo "$ACTUAL"
+ exit 1
+fi
|