[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freetalk-dev] PATCH: Various build system improvements
From: |
Yavor Doganov |
Subject: |
[Freetalk-dev] PATCH: Various build system improvements |
Date: |
Tue, 13 Jan 2009 01:23:38 +0200 |
User-agent: |
Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/22.3 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) |
Greetings,
I've made unofficial package of 3.2 for gNewSense (based on Kartik
Mistry's Debian package). I had to apply the following patch to strip
unneded dependencies. Here's some explanation:
* -Wall, -g, etc. are compiler flags, so specifiying them in
AM_CPPFLAGS is kinda wrong, as by default "-g -O2" is used when the
installer does not pass CFLAGS/CXXFLAGS to configure.
* The proper Automake primary for linking the program against -lfoo is
*_LDADD; *_LDFLAGS is for linker flags (-Wl,...).
* Checking for tgetent causes unnecessary linking against ncurses (in
my case -- on GNU/Linux). I couldn't find any usage of it.
* When you don't have libloudmouth installed, configure proceeds
without error and the build halts at compile time. Better to check
for it as well as GLib (for GLIB_CFLAGS). It seems that this was
done before, but I'm not sure why the code was commented.
* Some variables are AC_SUBST'ed at configure time, so it's not
necessary to define them in Makefile.am.
2008-12-24 Yavor Doganov <address@hidden> (tiny change)
* src/Makefile.am (AM_CXXFLAGS): New variable, move compiler flags
from...
(AM_CPPFLAGS): ...here.
(freetalk_LDFLAGS): Rename as...
(freetalk_LDADD): ...to allow installers to use LDFLAGS properly.
* configure.ac: Don't check for tgetent. Use AM_PATH_GLIB_2_0 and
PGK_CHECK_MODULES to detect glib and loudmouth.
* Makefile.am (PACKAGE, VERSION, LOUDMOUTH_CFLAGS)
(LOUDMOUTH_LIBS): Do not define, inherited from configure.
Index: freetalk/Makefile.am
===================================================================
--- freetalk.orig/Makefile.am 2008-12-24 02:22:57.000000000 +0200
+++ freetalk/Makefile.am 2008-12-24 02:24:10.000000000 +0200
@@ -1,11 +1,5 @@
SUBDIRS = src extensions doc po examples
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@
-LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@
-
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST =autogen.sh
Index: freetalk/configure.ac
===================================================================
--- freetalk.orig/configure.ac 2008-12-24 02:22:57.000000000 +0200
+++ freetalk/configure.ac 2008-12-24 02:24:10.000000000 +0200
@@ -14,7 +14,6 @@
AC_PROG_MAKE_SET
AC_PROG_CXX
-AC_SEARCH_LIBS([tgetent],[ncurses termcap curses])
AC_CHECK_LIB([readline], [readline],,AC_MSG_ERROR([ERROR! readline not
found...]))
GUILE_FLAGS
AC_CHECK_LIB([guile],[scm_boot_guile],,AC_MSG_ERROR([ERROR! Guile 1.6 or above
required.]))
@@ -24,18 +23,8 @@
AC_MSG_ERROR([pkg-config not found])
fi
-dnl AC_CHECK_LIB([glib-2.0],[g_slist_free],,AC_MSG_ERROR([ERROR! glib-2.0 not
found...]))
-GLIB_CFLAGS=`pkg-config --cflags glib-2.0`
-GLIB_LIBS=`pkg-config --libs glib-2.0`
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-dnl AC_CHECK_LIB([loudmouth1],[lm_session_is_open],,AC_MSG_ERROR([ERROR!
loudmouth1 not found...]))
-LOUDMOUTH_CFLAGS=`pkg-config --cflags loudmouth-1.0`
-LOUDMOUTH_LIBS=`pkg-config --libs loudmouth-1.0`
-AC_SUBST(LOUDMOUTH_CFLAGS)
-AC_SUBST(LOUDMOUTH_LIBS)
-
+AM_PATH_GLIB_2_0
+PKG_CHECK_MODULES([LOUDMOUTH], [loudmouth-1.0])
AC_CHECK_HEADER([argp.h],AC_DEFINE(HAVE_ARGP,[1]))
Index: freetalk/src/Makefile.am
===================================================================
--- freetalk.orig/src/Makefile.am 2008-12-24 02:24:40.000000000 +0200
+++ freetalk/src/Makefile.am 2008-12-24 02:25:35.000000000 +0200
@@ -1,4 +1,5 @@
-AM_CPPFLAGS= -Wall -g $(GUILE_CFLAGS) $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS)
-DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\"
+AM_CXXFLAGS = -Wall -g
+AM_CPPFLAGS = $(GUILE_CFLAGS) $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS)
-DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\"
bin_PROGRAMS=freetalk
@@ -9,6 +10,6 @@
roster.h interpreter.h extensions.h primitives.h presence.h \
file_transfer.h register.h compat.h
-freetalk_LDFLAGS=$(LOUDMOUTH_LIBS) $(GLIB_LIBS) $(GUILE_LDFLAGS)
+freetalk_LDADD = $(LOUDMOUTH_LIBS) $(GUILE_LDFLAGS)
CLEANFILES = *~
- [Freetalk-dev] PATCH: Various build system improvements,
Yavor Doganov <=