Code

Added templates for a library.
authorSebastian Harl <sh@tokkee.org>
Wed, 9 Jan 2008 08:13:41 +0000 (09:13 +0100)
committerSebastian Harl <sh@tokkee.org>
Wed, 9 Jan 2008 08:13:41 +0000 (09:13 +0100)
 * Libtoolized project.
 * Added basically empty src/libfoobar.c and src/foobar.h.

.gitignore
bootstrap.sh
configure.ac
src/Makefile.am
src/foobar.c
src/foobar.h [new file with mode: 0644]
src/libfoobar.c [new file with mode: 0644]

index 04580d2959b8d96ee32264fbfb5d3951be9f149d..860a4a0af1ec53694a48c1a380f52394a1b7a4d8 100644 (file)
@@ -12,8 +12,15 @@ install-sh
 missing
 stamp-h1
 
 missing
 stamp-h1
 
+# ltdl stuff
+libltdl
+libtool
+ltmain.sh
+
 # build output
 .libs
 # build output
 .libs
+*.la
+*.lo
 *.o
 foobar
 
 *.o
 foobar
 
index 827027a30f0c23471c44fda9c3357db0dda123c0..40a1920fe9aa70451916b9442378c1e4d1779d3b 100755 (executable)
@@ -4,11 +4,14 @@ set -ex
 
 test ! -f Makefile || make distclean
 
 
 test ! -f Makefile || make distclean
 
+rm -rf libltdl
+
 rm -rf autom4te.cache
 rm -f config.cache
 
 aclocal
 autoheader
 rm -rf autom4te.cache
 rm -f config.cache
 
 aclocal
 autoheader
+libtoolize --ltdl --copy --force
 automake --add-missing --copy --foreign
 autoconf -Wall
 
 automake --add-missing --copy --foreign
 autoconf -Wall
 
index de68d59e50eff42c1aac767f45210d6a7c462875..583843df66554a719d478788c4e5e0aa7e33f8b9 100644 (file)
@@ -20,6 +20,8 @@ AC_PROG_MAKE_SET
 
 AM_PROG_CC_C_O
 
 
 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
 test_cc_flags() {
        AC_LANG_CONFTEST([int main() {}])
        $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
index 12dc45ef3f150f732d04cade0f8c2b0dd74a69b7..f90eccd224aa359c937c1616092fc43eba6030bc 100644 (file)
@@ -1,6 +1,12 @@
 AM_CFLAGS = @STRICT_CFLAGS@
 
 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
 
 bin_PROGRAMS = foobar
 
-foobar_SOURCES = foobar.c
+foobar_SOURCES = foobar.c foobar.h
 
 
index 523b57c6cd8f76ea926e05744b0c2d3e11249ded..c4205e9f7e1bf5d451eb4f0b680235427afb74af 100644 (file)
@@ -24,6 +24,8 @@
 #      include "config.h"
 #endif /* HAVE_CONFIG_H */
 
 #      include "config.h"
 #endif /* HAVE_CONFIG_H */
 
+#include "foobar.h"
+
 #if HAVE_LIBGEN_H
 #      include <libgen.h>
 #else /* HAVE_LIBGEN_H */
 #if HAVE_LIBGEN_H
 #      include <libgen.h>
 #else /* HAVE_LIBGEN_H */
diff --git a/src/foobar.h b/src/foobar.h
new file mode 100644 (file)
index 0000000..e8b8e45
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * foobar - src/foobar.h
+ * Copyright (C) 2008 Sebastian Harl <sh@tokkee.org>
+ *
+ * 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 (file)
index 0000000..775d14c
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * foobar - src/libfoobar.c
+ * Copyright (C) 2008 Sebastian Harl <sh@tokkee.org>
+ *
+ * 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 : */
+