From 03fe0b481b0b2c737b989e727fc218be2407a16d Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Thu, 23 Feb 2012 12:47:30 +0100 Subject: [PATCH] initial structure --- README | 0 autogen.sh | 47 ++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 16 +++++++++++++++ include/codecrypt.h | 0 lib/lib.c | 7 +++++++ src/decrypt/main.c | 4 ++++ src/encrypt/main.c | 4 ++++ src/keygen-rs/main.c | 4 ++++ 8 files changed, 82 insertions(+) create mode 100644 README create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 include/codecrypt.h create mode 100644 lib/lib.c create mode 100644 src/decrypt/main.c create mode 100644 src/encrypt/main.c create mode 100644 src/keygen-rs/main.c diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..8adaaf1 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# simple autogen script that generates basic layout for autotools. + +COMMON_CPPFLAGS="-I/usr/local/include -I\$(srcdir)/include/" +COMMON_CFLAGS="-Wall" +COMMON_LDFLAGS="-L/usr/local/lib" +COMMON_LDADD="" + +OUT=Makefile.am +touch NEWS AUTHORS ChangeLog +echo > $OUT + +PROGS="ccr-keygen-rs ccr-encrypt ccr-decrypt" +DISTDIRS="" + +echo "AUTOMAKE_OPTIONS = subdir-objects" >>$OUT +echo "dist_noinst_SCRIPTS = autogen.sh" `for i in $DISTDIRS ; do find \$i -type f ; done | tr "\n" " " ` >>$OUT + +echo "noinst_HEADERS = `find include/ -type f -name \*.h |tr \"\n\" \" \" `" >>$OUT +echo "lib_LTLIBRARIES = libcodecrypt.la" >>$OUT +echo "libcodecrypt_la_SOURCES = `(find lib/ -type f -name *.c; find lib/ -type f -name *.cpp)|tr \"\n\" \" \" ` " >>$OUT +echo "noinst_HEADERS += `find lib/ -type f -name \*.h |tr \"\n\" \" \" `" >>$OUT + +echo "libcodecrypt_la_CPPFLAGS = -I\$(srcdir)/lib/ ${COMMON_CPPFLAGS}" >>$OUT +echo "libcodecrypt_la_CFLAGS = ${COMMON_CFLAGS}" >>$OUT +echo "libcodecrypt_la_LDFLAGS = ${COMMON_LDFLAGS}" >>$OUT +#echo "libcodecrypt_la_LDADD = ${COMMON_LDADD} " >>$OUT +[ -f "lib/Makefile.am.extra" ] && cat "lib/Makefile.am.extra" >>$OUT + +echo "bin_PROGRAMS = $PROGS" >>$OUT +for i in $PROGS +do + name=`echo $i |tr '-' '_'` + dir="src/${i#ccr-}" + echo "${name}dir = $dir/" >>$OUT + echo "${name}_SOURCES = `( find $dir/ -type f -name \*.c ; find $dir/ -type f -name \*.cpp ) |tr \"\n\" \" \" ` " >>$OUT + echo "noinst_HEADERS += `find $dir/ -type f -name \*.h |tr \"\n\" \" \" `" >>$OUT + echo "${name}_CPPFLAGS = -I\$(srcdir)/$i/ ${COMMON_CPPFLAGS}" >>$OUT + echo "${name}_CFLAGS = ${COMMON_CFLAGS}" >>$OUT + echo "${name}_LDFLAGS = ${COMMON_LDFLAGS}" >>$OUT + echo "${name}_LDADD = libcodecrypt.la ${COMMON_LDADD} " >>$OUT + [ -f "$dir/Makefile.am.extra" ] && cat "$dir/Makefile.am.extra" >>$OUT +done + +libtoolize --force && aclocal && autoconf && automake --add-missing + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..56ad434 --- /dev/null +++ b/configure.ac @@ -0,0 +1,16 @@ + +AC_PREREQ(2.6) +AC_INIT([codecrypt], [9999]) +AC_CONFIG_AUX_DIR(.) # because of libtoolize + +AM_INIT_AUTOMAKE() +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) + +AM_PROG_CC_C_O +AC_PROG_CPP +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LIBTOOL + +AC_OUTPUT(Makefile) + diff --git a/include/codecrypt.h b/include/codecrypt.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/lib.c b/lib/lib.c new file mode 100644 index 0000000..f910c68 --- /dev/null +++ b/lib/lib.c @@ -0,0 +1,7 @@ + +#include "codecrypt.h" + +int libf() +{ + return 4; +} diff --git a/src/decrypt/main.c b/src/decrypt/main.c new file mode 100644 index 0000000..15d3008 --- /dev/null +++ b/src/decrypt/main.c @@ -0,0 +1,4 @@ + +int main() { + return 0; +} diff --git a/src/encrypt/main.c b/src/encrypt/main.c new file mode 100644 index 0000000..15d3008 --- /dev/null +++ b/src/encrypt/main.c @@ -0,0 +1,4 @@ + +int main() { + return 0; +} diff --git a/src/keygen-rs/main.c b/src/keygen-rs/main.c new file mode 100644 index 0000000..15d3008 --- /dev/null +++ b/src/keygen-rs/main.c @@ -0,0 +1,4 @@ + +int main() { + return 0; +}