From dec92aeba675db577f7b58b7d08382d714ecee67 Mon Sep 17 00:00:00 2001 From: Emmanuel Bouthenot Date: Sat, 29 Oct 2005 17:56:50 +0000 Subject: fix detection of libgnutls --- configure.in | 48 +++++++++++++++++++---------------- src/common/Makefile.am | 2 +- src/gui/curses/Makefile.am | 2 +- src/gui/wxwidgets/Makefile.am | 1 - src/irc/Makefile.am | 2 +- weechat/configure.in | 48 +++++++++++++++++++---------------- weechat/src/common/Makefile.am | 2 +- weechat/src/gui/curses/Makefile.am | 2 +- weechat/src/gui/wxwidgets/Makefile.am | 1 - weechat/src/irc/Makefile.am | 2 +- 10 files changed, 58 insertions(+), 52 deletions(-) diff --git a/configure.in b/configure.in index d2851dbe1..1ae03c7f6 100644 --- a/configure.in +++ b/configure.in @@ -29,6 +29,16 @@ AC_PROG_CC AC_PROG_MAKE_SET AM_PROG_LIBTOOL +# Add some flags for some OS +case "$host_os" in +freebsd* | openbsd*) + CFLAGS="$CFLAGS -I/usr/local/include" + LFLAGS="$LFLAGS -L/usr/local/lib" + ;; +*) + ;; +esac + # Gettext ALL_LINGUAS="fr es cs" AM_GNU_GETTEXT @@ -300,9 +310,11 @@ if test "x$enable_gnutls" = "xyes" ; then *** ftp://ftp.gnutls.org/pub/gnutls/ *** WeeChat will be built without GnuTLS support.]])) if test "x$found_gnutls" = "xyes" ; then - GNUTLS_LIBS="-lgnutls" - AC_SUBST(GNUTLS_LIBS) - AC_DEFINE(HAVE_GNUTLS) + GNUTLS_CFLAGS=`libgnutls-config --cflags` + GNUTLS_LFLAGS=`libgnutls-config --libs` + AC_SUBST(GNUTLS_CFLAGS) + AC_SUBST(GNUTLS_LFLAGS) + AC_DEFINE(HAVE_GNUTLS) else enable_gnutls="no" fi @@ -312,22 +324,6 @@ fi # general vars # ------------------------------------------------------------------------------ -case "$host_os" in -freebsd*) - if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then - CFLAGS="$CFLAGS -pthread" - fi - CFLAGS="$CFLAGS -I/usr/local/include" - LDFLAGS="$LDFLAGS -L/usr/local/lib" - ;; -openbsd*) - CFLAGS="$CFLAGS -I/usr/local/include" - LDFLAGS="$LDFLAGS -L/usr/local/lib" - ;; -*) - ;; -esac - if test "x$enable_perl_nothread" = "xyes" ; then AC_DEFINE(PERL_NOTHREAD) fi @@ -365,9 +361,17 @@ if test "x$debug" = "x2" ; then AC_DEFINE(DEBUG) fi -# for FreeBSD -LIBS="$LIBS $INTLLIBS" -CFLAGS="$CFLAGS $CPPFLAGS" +case "$host_os" in +freebsd*) + if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then + CFLAGS="$CFLAGS -pthread" + fi + LIBS="$LIBS $INTLLIBS" + CFLAGS="$CFLAGS $CPPFLAGS" + ;; +*) + ;; +esac # ------------------------------------------------------------------------------ # output Makefiles diff --git a/src/common/Makefile.am b/src/common/Makefile.am index b9c7f66a1..e7d9ebb45 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" +INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GNUTLS_CFLAGS) noinst_LIBRARIES = lib_weechat_main.a diff --git a/src/gui/curses/Makefile.am b/src/gui/curses/Makefile.am index b698611af..76b5b5f92 100644 --- a/src/gui/curses/Makefile.am +++ b/src/gui/curses/Makefile.am @@ -24,7 +24,7 @@ weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \ ../../irc/lib_weechat_irc.a \ $(PLUGINS_LIBS) \ $(NCURSES_LIBS) \ - $(GNUTLS_LIBS) + $(GNUTLS_LFLAGS) weechat_curses_SOURCES = gui-display.c \ gui-input.c diff --git a/src/gui/wxwidgets/Makefile.am b/src/gui/wxwidgets/Makefile.am index bdfca7f5a..025fd25f4 100644 --- a/src/gui/wxwidgets/Makefile.am +++ b/src/gui/wxwidgets/Makefile.am @@ -22,7 +22,6 @@ bin_PROGRAMS = weechat-wxwidgets weechat_wxwidgets_LDADD = ../lib_weechat_gui_common.a \ ../../common/lib_weechat_main.a \ ../../irc/lib_weechat_irc.a \ - $(WXWIDGETS_LIBS) \ ../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS) weechat_wxwidgets_SOURCES = gui-display.c \ diff --git a/src/irc/Makefile.am b/src/irc/Makefile.am index d916bf345..21912f7d9 100644 --- a/src/irc/Makefile.am +++ b/src/irc/Makefile.am @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" +INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GNUTLS_CFLAGS) noinst_LIBRARIES = lib_weechat_irc.a diff --git a/weechat/configure.in b/weechat/configure.in index d2851dbe1..1ae03c7f6 100644 --- a/weechat/configure.in +++ b/weechat/configure.in @@ -29,6 +29,16 @@ AC_PROG_CC AC_PROG_MAKE_SET AM_PROG_LIBTOOL +# Add some flags for some OS +case "$host_os" in +freebsd* | openbsd*) + CFLAGS="$CFLAGS -I/usr/local/include" + LFLAGS="$LFLAGS -L/usr/local/lib" + ;; +*) + ;; +esac + # Gettext ALL_LINGUAS="fr es cs" AM_GNU_GETTEXT @@ -300,9 +310,11 @@ if test "x$enable_gnutls" = "xyes" ; then *** ftp://ftp.gnutls.org/pub/gnutls/ *** WeeChat will be built without GnuTLS support.]])) if test "x$found_gnutls" = "xyes" ; then - GNUTLS_LIBS="-lgnutls" - AC_SUBST(GNUTLS_LIBS) - AC_DEFINE(HAVE_GNUTLS) + GNUTLS_CFLAGS=`libgnutls-config --cflags` + GNUTLS_LFLAGS=`libgnutls-config --libs` + AC_SUBST(GNUTLS_CFLAGS) + AC_SUBST(GNUTLS_LFLAGS) + AC_DEFINE(HAVE_GNUTLS) else enable_gnutls="no" fi @@ -312,22 +324,6 @@ fi # general vars # ------------------------------------------------------------------------------ -case "$host_os" in -freebsd*) - if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then - CFLAGS="$CFLAGS -pthread" - fi - CFLAGS="$CFLAGS -I/usr/local/include" - LDFLAGS="$LDFLAGS -L/usr/local/lib" - ;; -openbsd*) - CFLAGS="$CFLAGS -I/usr/local/include" - LDFLAGS="$LDFLAGS -L/usr/local/lib" - ;; -*) - ;; -esac - if test "x$enable_perl_nothread" = "xyes" ; then AC_DEFINE(PERL_NOTHREAD) fi @@ -365,9 +361,17 @@ if test "x$debug" = "x2" ; then AC_DEFINE(DEBUG) fi -# for FreeBSD -LIBS="$LIBS $INTLLIBS" -CFLAGS="$CFLAGS $CPPFLAGS" +case "$host_os" in +freebsd*) + if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then + CFLAGS="$CFLAGS -pthread" + fi + LIBS="$LIBS $INTLLIBS" + CFLAGS="$CFLAGS $CPPFLAGS" + ;; +*) + ;; +esac # ------------------------------------------------------------------------------ # output Makefiles diff --git a/weechat/src/common/Makefile.am b/weechat/src/common/Makefile.am index b9c7f66a1..e7d9ebb45 100644 --- a/weechat/src/common/Makefile.am +++ b/weechat/src/common/Makefile.am @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" +INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GNUTLS_CFLAGS) noinst_LIBRARIES = lib_weechat_main.a diff --git a/weechat/src/gui/curses/Makefile.am b/weechat/src/gui/curses/Makefile.am index b698611af..76b5b5f92 100644 --- a/weechat/src/gui/curses/Makefile.am +++ b/weechat/src/gui/curses/Makefile.am @@ -24,7 +24,7 @@ weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \ ../../irc/lib_weechat_irc.a \ $(PLUGINS_LIBS) \ $(NCURSES_LIBS) \ - $(GNUTLS_LIBS) + $(GNUTLS_LFLAGS) weechat_curses_SOURCES = gui-display.c \ gui-input.c diff --git a/weechat/src/gui/wxwidgets/Makefile.am b/weechat/src/gui/wxwidgets/Makefile.am index bdfca7f5a..025fd25f4 100644 --- a/weechat/src/gui/wxwidgets/Makefile.am +++ b/weechat/src/gui/wxwidgets/Makefile.am @@ -22,7 +22,6 @@ bin_PROGRAMS = weechat-wxwidgets weechat_wxwidgets_LDADD = ../lib_weechat_gui_common.a \ ../../common/lib_weechat_main.a \ ../../irc/lib_weechat_irc.a \ - $(WXWIDGETS_LIBS) \ ../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS) weechat_wxwidgets_SOURCES = gui-display.c \ diff --git a/weechat/src/irc/Makefile.am b/weechat/src/irc/Makefile.am index d916bf345..21912f7d9 100644 --- a/weechat/src/irc/Makefile.am +++ b/weechat/src/irc/Makefile.am @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" +INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GNUTLS_CFLAGS) noinst_LIBRARIES = lib_weechat_irc.a -- cgit v1.2.3