More autotools stuff
authorMikael Berthe <mikael@lilotux.net>
Sun, 07 Mar 2010 19:11:38 +0100
changeset 4 807420cf8002
parent 3 7df50d56fbdd
child 5 fbfc64c5d6be
More autotools stuff
autogen.sh
comment/Makefile.am
configure.ac
extsay/Makefile.am
macros/define_dir.m4
--- a/autogen.sh	Sun Mar 07 15:16:31 2010 +0100
+++ b/autogen.sh	Sun Mar 07 19:11:38 2010 +0100
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 libtoolize --force --automake --copy
-aclocal -I macros/
+aclocal
 autoheader
 autoconf
 automake -a --copy
--- a/comment/Makefile.am	Sun Mar 07 15:16:31 2010 +0100
+++ b/comment/Makefile.am	Sun Mar 07 19:11:38 2010 +0100
@@ -1,5 +1,6 @@
 
-if INSTALL_HEADERS
+if INSTALL_MODULE_COMMENT
+
 pkglib_LTLIBRARIES = libcomment.la
 libcomment_la_SOURCES = comment.c
 libcomment_la_LDFLAGS = -module -avoid-version -shared
--- a/configure.ac	Sun Mar 07 15:16:31 2010 +0100
+++ b/configure.ac	Sun Mar 07 19:11:38 2010 +0100
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT([mcabber-modules],[0.10.0-dev],[mcabber@lilotux.net])
+AC_INIT([mcabber],[0.10.0-dev],[mcabber@lilotux.net])
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER([config-modules.h])
 
@@ -60,6 +60,8 @@
                 iswblank])
 
 
+PKG_CHECK_MODULES(MCABBER, mcabber >= 0.10.0)
+
 # Check for glib
 AM_PATH_GLIB_2_0(2.14.0,
                  [AC_DEFINE([HAVE_GLIB_REGEX], 1,
@@ -68,7 +70,7 @@
                                   [g_list_append], ["$gmodule_module"])],
                  [g_regex_new "$gmodule_module"])
 
-PKG_CHECK_MODULES(MCABBER, mcabber >= 0.10.0)
+PKG_CHECK_MODULES(GMODULES, gmodule-2.0)
 
 AC_ARG_ENABLE(debug,
     [AC_HELP_STRING(--enable-debug, add development compilation options)],
@@ -91,10 +93,24 @@
 # We need _GNU_SOURCE for strptime() and strcasestr()
 CFLAGS="$CFLAGS -D_GNU_SOURCE"
 
-AC_ARG_ENABLE(all-modules, [  --enable-all-modules    enable all modules],
+AC_ARG_ENABLE(all-modules,
+              AC_HELP_STRING([--enable-all-modules], [enable all modules]),
               enable_all_modules=$enableval)
 
-AM_CONDITIONAL([INSTALL_HEADERS], [test x$enable_all_modules = xyes])
+AC_ARG_ENABLE(module-comment,
+              AC_HELP_STRING([--enable-module-comment], [enable module comment]),
+              enable_module_comment=$enableval)
+AC_ARG_ENABLE(module-extsay,
+              AC_HELP_STRING([--enable-module-extsay], [enable module extsay]),
+              enable_module_extsay=$enableval)
+
+AM_CONDITIONAL([INSTALL_MODULE_COMMENT],
+               [test x"${enable_all_modules}" = x"yes" -o \
+                     x"${enable_module_comment}" = x"yes"])
+
+AM_CONDITIONAL([INSTALL_MODULE_EXTSAY],
+               [test x"${enable_all_modules}" = x"yes" -o \
+                     x"${enable_module_extsay}" = x"yes"])
 
 AC_CONFIG_FILES([comment/Makefile
                  extsay/Makefile
--- a/extsay/Makefile.am	Sun Mar 07 15:16:31 2010 +0100
+++ b/extsay/Makefile.am	Sun Mar 07 19:11:38 2010 +0100
@@ -1,5 +1,6 @@
 
-if INSTALL_HEADERS
+if INSTALL_MODULE_EXTSAY
+
 pkglib_LTLIBRARIES = libextsay.la
 libextsay_la_SOURCES = extsay.c
 libextsay_la_LDFLAGS = -module -avoid-version -shared
--- a/macros/define_dir.m4	Sun Mar 07 15:16:31 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-dnl define_dir.m4
-dnl http://autoconf-archive.cryp.to/ac_define_dir.html
-
-#  AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
-# This macro sets VARNAME to the expansion of the DIR variable, taking care
-# of fixing up ${prefix} and such.
-# VARNAME is then offered as both an output variable and a C preprocessor
-# symbol.
-
-# Authors
-# Stepan Kasal <kasal@ucw.cz>, Andreas Schwab <schwab@suse.de>,
-# Guido Draheim <guidod@gmx.de>, Alexandre Oliva
-# (Slightly modified -- Mikael Berthe)
-
-AC_DEFUN([AC_DEFINE_DIR], [
-  prefix_NONE=
-  exec_prefix_NONE=
-  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
-  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
-dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
-dnl refers to ${prefix}.  Thus we have to use `eval' twice.
-  ac_define_dir=`eval echo [$]$2`
-  ac_define_dir=`eval echo [$]ac_define_dir`
-  AC_SUBST($1, "$ac_define_dir")
-  ifelse($3, ,
-    AC_DEFINE_UNQUOTED($1, "$ac_define_dir"),
-    AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3))
-  test "$prefix_NONE" && prefix=NONE
-  test "$exec_prefix_NONE" && exec_prefix=NONE
-])