From 7d0a87a73a3962d361a2d3eb85ff346ffc7f4406 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 9 Jan 2008 09:13:41 +0100 Subject: [PATCH] Added templates for a library. * Libtoolized project. * Added basically empty src/libfoobar.c and src/foobar.h. --- .gitignore | 7 +++++++ bootstrap.sh | 3 +++ configure.ac | 2 ++ src/Makefile.am | 8 +++++++- src/foobar.c | 2 ++ src/foobar.h | 37 +++++++++++++++++++++++++++++++++++++ src/libfoobar.c | 26 ++++++++++++++++++++++++++ 7 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 src/foobar.h create mode 100644 src/libfoobar.c diff --git a/.gitignore b/.gitignore index 04580d2..860a4a0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,8 +12,15 @@ install-sh missing stamp-h1 +# ltdl stuff +libltdl +libtool +ltmain.sh + # build output .libs +*.la +*.lo *.o foobar diff --git a/bootstrap.sh b/bootstrap.sh index 827027a..40a1920 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -4,11 +4,14 @@ set -ex test ! -f Makefile || make distclean +rm -rf libltdl + rm -rf autom4te.cache rm -f config.cache aclocal autoheader +libtoolize --ltdl --copy --force automake --add-missing --copy --foreign autoconf -Wall diff --git a/configure.ac b/configure.ac index de68d59..583843d 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,8 @@ AC_PROG_MAKE_SET AM_PROG_CC_C_O +AC_PROG_LIBTOOL + test_cc_flags() { AC_LANG_CONFTEST([int main() {}]) $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null diff --git a/src/Makefile.am b/src/Makefile.am index 12dc45e..f90eccd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,12 @@ AM_CFLAGS = @STRICT_CFLAGS@ +include_HEADERS = foobar.h +lib_LTLIBRARIES = libfoobar.la + +libfoobar_la_SOURCES = libfoobar.c foobar.h +libfoobar_la_LDFLAGS = -version-info 0:0:0 + bin_PROGRAMS = foobar -foobar_SOURCES = foobar.c +foobar_SOURCES = foobar.c foobar.h diff --git a/src/foobar.c b/src/foobar.c index 523b57c..c4205e9 100644 --- a/src/foobar.c +++ b/src/foobar.c @@ -24,6 +24,8 @@ # include "config.h" #endif /* HAVE_CONFIG_H */ +#include "foobar.h" + #if HAVE_LIBGEN_H # include #else /* HAVE_LIBGEN_H */ diff --git a/src/foobar.h b/src/foobar.h new file mode 100644 index 0000000..e8b8e45 --- /dev/null +++ b/src/foobar.h @@ -0,0 +1,37 @@ +/* + * foobar - src/foobar.h + * Copyright (C) 2008 Sebastian Harl + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; only version 2 of the License is applicable. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * A short description of this module... + */ + +#ifndef FOOBAR_H +#define FOOBAR_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* ! FOOBAR_H */ + +/* vim: set tw=78 sw=4 ts=4 noexpandtab : */ + diff --git a/src/libfoobar.c b/src/libfoobar.c new file mode 100644 index 0000000..775d14c --- /dev/null +++ b/src/libfoobar.c @@ -0,0 +1,26 @@ +/* + * foobar - src/libfoobar.c + * Copyright (C) 2008 Sebastian Harl + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; only version 2 of the License is applicable. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * A short description of this module... + */ + +#include "foobar.h" + +/* vim: set tw=78 sw=4 ts=4 noexpandtab : */ + -- 2.30.2