aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2011-11-03 15:33:09 +0100
committerKay Sievers <kay.sievers@vrfy.org>2011-11-03 15:54:43 +0100
commit5591e1cead225f2176a75c2c95ee9968716c49ec (patch)
treea8599ea5e8dab4d575b020c19377786c3f7e7819
parent87f3de235b15c972c99ca75abcc48ecd804cb5a9 (diff)
downloadlibabc-5591e1cead225f2176a75c2c95ee9968716c49ec.tar.gz
misc fixes
- Remove SUBDIRS variable on top-level Makefile.am; using SUBDIRS=. is only meaningful to ask automake an explicit ordering of the sub-directory processing. - Add $(AM_LDFLAGS) to the library's LDFLAGS; this is important because one of the most common mistake is forgetting that the variable is an override. - check_PROGRAMS only build the programs, but doesn't run them; TESTS run the command; this way it is possible to execute a script, but build a binary that the script uses. - Pass CFLAGS in ./configure command line when using ./autogen.sh. - Use M4sh syntax instead of sh syntax for conditionals (AS_IF rather than if); when you don't use M4sh, AC_REQUIRE does not behave correctly, leading to a common mistake when using PKG_CHECK_MODULES. - Add [default=(enabled|disabled)] comments in options description; this makes them behave a lot more like autoconf's own descriptions. - Correct a warning in libabc.c (return with no value in function returning non-void). - Fix path mistakes in pkg-config data file. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
-rw-r--r--Makefile.am5
-rwxr-xr-xautogen.sh3
-rw-r--r--configure.ac12
-rw-r--r--libabc/libabc.c2
-rw-r--r--libabc/libabc.pc.in4
5 files changed, 13 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am
index b1c86d6..ee7823a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,3 @@
-SUBDIRS = .
EXTRA_DIST = autogen.sh
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
@@ -34,13 +33,15 @@ libabc_libabc_la_SOURCES =\
EXTRA_DIST += libabc/libabc.sym
-libabc_libabc_la_LDFLAGS = \
+libabc_libabc_la_LDFLAGS = $(AM_LDFLAGS) \
-version-info $(LIBABC_CURRENT):$(LIBABC_REVISION):$(LIBABC_AGE) \
-Wl,--version-script=$(top_srcdir)/libabc/libabc.sym
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libabc/libabc.pc
+TESTS = test-libabc
+
check_PROGRAMS = test-libabc
test_libabc_SOURCES = test-libabc.c
test_libabc_LDADD = libabc/libabc.la
diff --git a/autogen.sh b/autogen.sh
index 813afb0..d465ab6 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -17,5 +17,4 @@ args="--prefix=/usr \
--sysconfdir=/etc \
--libdir=$(libdir /usr/lib)"
-export CFLAGS
-./configure $args $@
+./configure $args CFLAGS="${MYCFLAGS} ${CFLAGS}" $@
diff --git a/configure.ac b/configure.ac
index 9cc8c67..65cfbb0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,18 +15,18 @@ LT_INIT([disable-static])
AC_PREFIX_DEFAULT([/usr])
AC_ARG_ENABLE([logging],
- AS_HELP_STRING([--disable-logging], [disable system logging]),
+ AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
[], enable_logging=yes)
-if test "x$enable_logging" = "xyes"; then
+AS_IF([test "x$enable_logging" = "xyes"], [
AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
-fi
+])
AC_ARG_ENABLE([debug],
- AS_HELP_STRING([--enable-debug], [enable debug messages]),
+ AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
[], [enable_debug=no])
-if test "x$enable_debug" = "xyes"; then
+AS_IF([test "x$enable_debug" = "xyes"], [
AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
-fi
+])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([
diff --git a/libabc/libabc.c b/libabc/libabc.c
index 8f21e4e..3dd73e1 100644
--- a/libabc/libabc.c
+++ b/libabc/libabc.c
@@ -180,7 +180,7 @@ ABC_EXPORT struct abc_ctx *abc_ref(struct abc_ctx *ctx)
ABC_EXPORT struct abc_ctx *abc_unref(struct abc_ctx *ctx)
{
if (ctx == NULL)
- return;
+ return NULL;
ctx->refcount--;
if (ctx->refcount > 0)
return ctx;
diff --git a/libabc/libabc.pc.in b/libabc/libabc.pc.in
index 36b85cc..2fc7b76 100644
--- a/libabc/libabc.pc.in
+++ b/libabc/libabc.pc.in
@@ -1,7 +1,7 @@
prefix=@prefix@
-exec_prefix=@prefix@
+exec_prefix=@exec_prefix@
libdir=@libdir@
-includedir=@prefix@/include
+includedir=@includedir@
Name: libabc
Description: Library for something with abc