diff --git a/Makefile.am b/Makefile.am index 24613aa..3ab6dcf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = src +pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = tlcommon.pc ACLOCAL_AMFLAGS = -I build/m4 -I build diff --git a/configure.ac b/configure.ac index 3e2b360..ec35651 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ AC_INIT([TuneL common library], AC_CONFIG_SRCDIR([src/socket.c]) AC_CONFIG_AUX_DIR([build/aux]) AC_CONFIG_MACRO_DIR([build/m4]) -AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror foreign]) +AM_INIT_AUTOMAKE([1.11.1 -Wall foreign]) AM_PROG_AR AC_CONFIG_HEADERS([config.h]) @@ -42,13 +42,6 @@ AC_PROG_CXX TL_COMMON_LTVERSION="0:0:0" AC_SUBST([TL_COMMON_LTVERSION]) -pkgconfigdir="$libdir/pkgconfig" -tl_includedir="$includedir/tunel" -tl_include_commondir="$tl_includedir/common" -AC_SUBST(pkgconfigdir) -AC_SUBST(tl_includedir) -AC_SUBST(tl_include_commondir) - # Checks for libraries. # AX_REQUIRE_HEADER(HEADER, IF-PRESENT) @@ -133,44 +126,18 @@ AC_CHECK_FUNCS([memset \ # Tuning AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug], [enable debugging [[default=yes]]]), + [AS_HELP_STRING([--enable-debug], [enable debugging [[default=yes]]])], [enable_debug="$enableval"], [enable_debug="yes"]) -AC_MSG_CHECKING([[whether to enable debugging]]) -if test "x$enable_debug" = "xyes"; then - AC_DEFINE([TL_DEBUG], [1], [is debugging enabled]) - # FIXME: please only use TL_DEBUG, not DEBUG - DEBUG_CPPFLAGS="-DTL_DEBUG -DDEBUG" - CPPFLAGS="$CPPFLAGS $DEBUG_CPPFLAGS" - AC_MSG_RESULT([[yes]]) -else - DEBUG_CFLAGS= - AC_MSG_RESULT([[no]]) -fi -AC_SUBST([DEBUG_CFLAGS]) - -AC_ARG_ENABLE([paranoia], - AC_HELP_STRING([--enable-paranoia], - [enable excessively strict compiler options \ - (works only with GCC and compatible) [[default=no]]]), - [enable_paranoia="$enableval"], - [enable_paranoia="no"]) -AC_MSG_CHECKING([[whether to enable paranoiac compiler options]]) -if test "x$enable_paranoia" = "xyes"; then - CFLAGS="$CFLAGS \ - -Wall -W -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int \ - -Werror-implicit-function-declaration -Wmain -Wparentheses -Wsequence-point \ - -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas \ - -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast \ - -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return \ - -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ - -Wmissing-noreturn -Wformat -Wmissing-format-attribute \ - -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs \ - -Winline -Wlong-long -Wunreachable-code -pedantic" - AC_MSG_RESULT([[yes]]) -else - AC_MSG_RESULT([[no]]) -fi +AC_MSG_CHECKING([whether to enable debugging]) +AS_IF([test "x$enable_debug" = "xyes"], + [AC_DEFINE([TL_DEBUG], [1], [is debugging enabled]) + # FIXME: please only use TL_DEBUG, not DEBUG + TL_DEBUG_CPPFLAGS="-DTL_DEBUG -DDEBUG" + AC_MSG_RESULT([yes])], + [TL_DEBUG_CPPFLAGS= + AC_MSG_RESULT([no])]) +AC_SUBST([TL_DEBUG_CPPFLAGS]) #TL_CHECK_PHY_DEBUG @@ -185,7 +152,6 @@ AC_OUTPUT echo "------------------------------------------" echo "Configuration choices:" echo "* Debugging enabled : $enable_debug" -echo "* Paranoiac compiler options : $enable_paranoia" echo "* Base installation directory : $prefix" echo "" echo "Now type 'make' to build $PACKAGE_NAME" diff --git a/src/Makefile.am b/src/Makefile.am index ab5784f..8f3900d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,6 +3,7 @@ lib_LTLIBRARIES = libtlcommon.la #libtlcommon_la_CPPFLAGS = @TL_PHY_DEBUG_CPPFLAGS_EXPORT@ libtlcommon_la_CFLAGS = @TL_COMMON_CFLAGS@ +libtlcommon_la_CPPFLAGS = @TL_DEBUG_CPPFLAGS@ libtlcommon_la_CXXFLAGS = @TL_COMMON_CXXFLAGS@ libtlcommon_la_LDFLAGS = -version-info @TL_COMMON_LTVERSION@ libtlcommon_la_LIBADD = @TL_COMMON_LIBS@ @@ -18,7 +19,8 @@ libtlcommon_la_SOURCES = socket.c \ treegenerator.c -tl_include_common_HEADERS = socket.h \ +tlcommon_includedir = $(includedir)/tunel/common +tlcommon_include_HEADERS = socket.h \ ptimer.h \ netclient.h \ netprotocol.h \ diff --git a/tlcommon.pc.in b/tlcommon.pc.in index 9488b0b..a637619 100644 --- a/tlcommon.pc.in +++ b/tlcommon.pc.in @@ -9,4 +9,4 @@ Version: @VERSION@ Requires: scecore Libs: -L${libdir} -ltlcommon Libs.private: -lpthread -Cflags: -I${includedir} @DEBUG_CFLAGS@ +Cflags: -I${includedir} @TL_DEBUG_CPPFLAGS@