[gegl] configure: move more m4 macros into external files



commit 81b696689be2087ad3d0acf725a5f92ad389127d
Author: Danny Robson <danny blubinc net>
Date:   Mon Aug 2 21:07:03 2010 +1000

    configure: move more m4 macros into external files
    
    Renamed the m4macros directory into the more standard `m4'. Seperated
    the variadic macros and gtk-doc macros into individual files.

 Makefile.am                          |    2 +-
 acinclude.m4                         |  112 ----------------------------------
 autogen.sh                           |    2 +-
 configure.ac                         |    2 +-
 {m4macros => m4}/.gitignore          |    0
 {m4macros => m4}/as-compiler-flag.m4 |    0
 m4/gegl-variadic-macros.m4           |   58 +++++++++++++++++
 m4/gtk-doc.m4                        |   52 ++++++++++++++++
 8 files changed, 113 insertions(+), 115 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 0947aec..a84dcc1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 AUTOMAKE_OPTIONS = dist-bzip2
 
-ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
 # The libs directory needs to be before anything which can depend on its
 # libraries, otherwise any potentially rebuilt libs won't be picked up until
diff --git a/autogen.sh b/autogen.sh
index 1cc6eac..6873a2c 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -21,7 +21,7 @@ GLIB_REQUIRED_VERSION=2.8.0
 INTLTOOL_REQUIRED_VERSION=0.31
 LIBTOOL_REQUIRED_VERSION=1.5
 
-ACLOCAL_FLAGS="-I m4macros"
+ACLOCAL_FLAGS="-I m4"
 
 PROJECT="GEGL"
 TEST_TYPE=-f
diff --git a/configure.ac b/configure.ac
index dcf9e0a..c38db67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@ m4_define([graphviz_required_version], [0.0.0])
 
 AC_INIT(gegl, gegl_major_version.gegl_minor_version.gegl_micro_version)
 AC_CONFIG_SRCDIR([gegl/gegl.h])
-AC_CONFIG_MACRO_DIR([m4macros])
+AC_CONFIG_MACRO_DIR([m4])
 
 # Enable silent build rules by default, requires at least
 # Automake-1.11. Disable by either passing --disable-silent-rules to
diff --git a/m4macros/.gitignore b/m4/.gitignore
similarity index 100%
rename from m4macros/.gitignore
rename to m4/.gitignore
diff --git a/m4macros/as-compiler-flag.m4 b/m4/as-compiler-flag.m4
similarity index 100%
rename from m4macros/as-compiler-flag.m4
rename to m4/as-compiler-flag.m4
diff --git a/m4/gegl-variadic-macros.m4 b/m4/gegl-variadic-macros.m4
new file mode 100644
index 0000000..1eaa37d
--- /dev/null
+++ b/m4/gegl-variadic-macros.m4
@@ -0,0 +1,58 @@
+# GEGL_VARIADIC_MACROS
+# --------------------
+# check for flavours of variadic macros
+AC_DEFUN([GEGL_VARIADIC_MACROS],
+[AC_BEFORE([AC_PROG_CXX], [$0])
+AC_REQUIRE([AC_PROG_CPP])
+AC_CACHE_CHECK([for GNUC variadic macros],
+    [gegl_cv_prog_gnuc_variadic_macros],
+    [# gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
+    # is passed ISO vararg support is turned off, and there is no work
+    # around to turn it on, so we unconditionally turn it off.
+    { echo '#if __GNUC__ == 2 && __GNUC_MINOR__ == 95'
+      echo ' yes '
+      echo '#endif'; } > conftest.c
+    if ${CPP} conftest.c | grep yes > /dev/null; then
+        gegl_cv_prog_c_variadic_macros=no
+        gegl_cv_prog_cxx_variadic_macros=no
+    fi
+    AC_TRY_COMPILE([],[int a(int p1, int p2, int p3);
+#define call_a(params...) a(1,params)
+call_a(2,3);
+    ],
+        gegl_cv_prog_gnuc_variadic_macros=yes,
+        gegl_cv_prog_gnuc_variadic_macros=no)
+])
+if test x$gegl_cv_prog_gnuc_variadic_macros = xyes; then
+  AC_DEFINE(GEGL_GNUC_VARIADIC_MACROS, 1, [Define if the C pre-processor supports GNU style variadic macros])
+fi
+
+AC_CACHE_CHECK([for ISO C99 variadic macros in C],
+    [gegl_cv_prog_c_variadic_macros],
+    [AC_TRY_COMPILE([],[int a(int p1, int p2, int p3);
+#define call_a(...) a(1,__VA_ARGS__)
+call_a(2,3);
+        ],
+        gegl_cv_prog_c_variadic_macros=yes,
+        gegl_cv_prog_c_variadic_macros=no)
+])
+if test x$gegl_cv_prog_c_variadic_macros = xyes ; then
+  AC_DEFINE(GEGL_ISO_VARIADIC_MACROS, 1, [Define if the C pre-processor supports variadic macros])
+fi
+
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_CACHE_CHECK([for ISO C99 variadic macros in C++],
+        [gegl_cv_prog_cxx_variadic_macros],
+        [AC_LANG_PUSH(C++)
+        AC_TRY_COMPILE([],[int a(int p1, int p2, int p3);
+#define call_a(...) a(1,__VA_ARGS__)
+call_a(2,3);
+        ],
+        gegl_cv_prog_cxx_variadic_macros=yes,
+        gegl_cv_prog_cxx_variadic_macros=no)
+        AC_LANG_POP])],
+    [# No C++ compiler+    gegl_cv_prog_cxx_variadic_macros=no])
+if test x$gegl_cv_prog_cxx_variadic_macros = xyes ; then
+  AC_DEFINE(GEGL_ISO_CXX_VARIADIC_MACROS, 1, [Define if the C++ pre-processor supports variadic macros])
+fi
+]) dnl GEGL_VARIADIC_MACROS
diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4
new file mode 100644
index 0000000..e2f8d83
--- /dev/null
+++ b/m4/gtk-doc.m4
@@ -0,0 +1,52 @@
+dnl The following lines were copied from gtk-doc.m4
+
+dnl Usage:
+dnl   GTK_DOC_CHECK([minimum-gtk-doc-version])
+AC_DEFUN([GTK_DOC_CHECK],
+[
+  AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+  AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+  dnl for overriding the documentation installation directory
+  AC_ARG_WITH(html-dir,
+    AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
+    [with_html_dir='${datadir}/gtk-doc/html'])
+  HTML_DIR="$with_html_dir"
+  AC_SUBST(HTML_DIR)
+
+  dnl enable/disable documentation building
+  AC_ARG_ENABLE(gtk-doc,
+    AC_HELP_STRING([--enable-gtk-doc],
+                   [use gtk-doc to build documentation (default=no)]),,
+    enable_gtk_doc=no)
+
+  have_gtk_doc=no
+  if test x$enable_gtk_doc = xyes; then
+    if test -z "$PKG_CONFIG"; then
+      AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+    fi
+    if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
+      have_gtk_doc=yes
+    fi
+
+  dnl do we want to do a version check?
+ifelse([$1],[],,
+    [gtk_doc_min_version=$1
+    if test "$have_gtk_doc" = yes; then
+      AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
+      if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+        have_gtk_doc=no
+      fi
+    fi
+])
+    if test "$have_gtk_doc" != yes; then
+      enable_gtk_doc=no
+    fi
+  fi
+
+  AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
+  AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
+])
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]