Revision: 6006 http://geany.svn.sourceforge.net/geany/?rev=6006&view=rev Author: colombanw Date: 2011-10-06 00:44:48 +0000 (Thu, 06 Oct 2011) Log Message: ----------- Move configure logic for MinGW, socket and VTE to their own files
Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac
Added Paths: ----------- trunk/m4/geany-mingw.m4 trunk/m4/geany-socket.m4 trunk/m4/geany-vte.m4
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-06 00:44:25 UTC (rev 6005) +++ trunk/ChangeLog 2011-10-06 00:44:48 UTC (rev 6006) @@ -3,7 +3,8 @@ * autogen.sh, configure.ac: Modernize configure.ac a bit. * configure.ac, m4/geany-revision.m4, m4/geany-binreloc.m4, - m4/geany-gnu-regex.m4, m4/geany-plugins.m4, m4/geany-i18n.m4: + m4/geany-gnu-regex.m4, m4/geany-plugins.m4, m4/geany-i18n.m4, + m4/geany-mingw.m4, m4/geany-socket.m4, m4/geany-vte.m4: Extract some configure logic to separate files for better readability.
Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2011-10-06 00:44:25 UTC (rev 6005) +++ trunk/configure.ac 2011-10-06 00:44:48 UTC (rev 6006) @@ -80,58 +80,15 @@
# check for mingw specific settings -case "${host}" in - *mingw*) - AC_CHECK_LIB([iberty], [fnmatch], [], - [AC_MSG_ERROR([fnmatch does not present in libiberty. You need to update it, read http://www.geany.org/Support/CrossCompile for details.])]) - AC_DEFINE([WIN32], [1], [we are cross compiling for WIN32]) - AC_DEFINE([HAVE_SOCKET], [1], [Define if you want to detect a running instance]) - AM_CONDITIONAL([MINGW], true) - want_vte="no" - want_socket="yes" - ;; - *) - AM_CONDITIONAL([MINGW], false) - ;; -esac +GEANY_CHECK_MINGW
-# skip check if already decided -if test "x$want_socket" = "x"; then - # socket support - AC_ARG_ENABLE([socket], - [AS_HELP_STRING([--enable-socket], - [enable if you want to detect a running instance [default=yes]])], - [want_socket="$enableval"], - [want_socket="yes"]) +GEANY_CHECK_SOCKET
- if test "x$want_socket" = "xyes"; then - AC_DEFINE([HAVE_SOCKET], [1], [Define if you want to detect a running instance]) - # this should bring in libsocket on Solaris: - AC_SEARCH_LIBS([connect],[socket]) - fi -fi
+GEANY_CHECK_VTE
-# skip check if already decided -if test "x$want_vte" = "x"; then - # VTE support - AC_ARG_ENABLE([vte], - [AS_HELP_STRING([--enable-vte], - [enable if you want virtual terminal support [default=yes]])], - [want_vte="$enableval"], - [want_vte="yes"]) - if test "x$want_vte" = "xyes"; then - AC_DEFINE([HAVE_VTE], [1], [Define if you want VTE support]) - fi - AC_ARG_WITH([vte-module-path], - [AS_HELP_STRING([--with-vte-module-path=PATH], - [Path to a loadable libvte [default=None]])], - [AC_DEFINE_UNQUOTED([VTE_MODULE_PATH], - ["$withval"], [Path to a loadable libvte])]) -fi
- # just for a laugh (it has absolutely no effect) AC_ARG_ENABLE([the-force], [AS_HELP_STRING([--enable-the-force], @@ -201,8 +158,8 @@ fi echo "Using GTK version : ${GTK_VERSION}" echo "Build with plugin support : ${geany_enable_plugins}" -echo "Use virtual terminal support : ${want_vte}" -echo "Use (UNIX domain) socket support : ${want_socket}" +echo "Use virtual terminal support : ${geany_enable_vte}" +echo "Use (UNIX domain) socket support : ${geany_enable_socket}" if test "x$enable_gnu_regex" = "xyes" ; then echo "GNU regex library : built-in" else
Added: trunk/m4/geany-mingw.m4 =================================================================== --- trunk/m4/geany-mingw.m4 (rev 0) +++ trunk/m4/geany-mingw.m4 2011-10-06 00:44:48 UTC (rev 6006) @@ -0,0 +1,20 @@ +dnl GEANY_CHECK_MINGW +dnl Checks whether we're building for MinGW, and defines appropriate stuff +dnl if it is the case. +dnl Most importantly, AM_CODITIONALs MINGW +AC_DEFUN([GEANY_CHECK_MINGW], +[ + case "${host}" in + *mingw*) + AC_CHECK_LIB([iberty], [fnmatch], [], + [AC_MSG_ERROR([fnmatch does not present in libiberty. You need to update it, read http://www.geany.org/Support/CrossCompile for details.])]) + AC_DEFINE([WIN32], [1], [we are cross compiling for WIN32]) + GEANY_CHECK_VTE([no]) + GEANY_CHECK_SOCKET([yes]) + AM_CONDITIONAL([MINGW], true) + ;; + *) + AM_CONDITIONAL([MINGW], false) + ;; + esac +])
Added: trunk/m4/geany-socket.m4 =================================================================== --- trunk/m4/geany-socket.m4 (rev 0) +++ trunk/m4/geany-socket.m4 2011-10-06 00:44:48 UTC (rev 6006) @@ -0,0 +1,42 @@ +dnl _GEANY_CHECK_SOCKET_PREREQ +AC_DEFUN([_GEANY_CHECK_SOCKET_PREREQ], +[ + AC_ARG_ENABLE([socket], + [AS_HELP_STRING([--enable-socket], + [enable if you want to detect a running instance [default=yes]])], + [geany_enable_socket="$enableval"], + [geany_enable_socket="auto"]) +]) + +dnl GEANY_CHECK_SOCKET([enable]) +AC_DEFUN([GEANY_CHECK_SOCKET], +[ + AC_REQUIRE([_GEANY_CHECK_SOCKET_PREREQ]) + + dnl this way of calling once is a bit ugly, but we need to be able to + dnl call this from one or more locations, the first one maybe in a shell + dnl conditional. + if test "x$_geany_enable_socket_done" = x; then + dnl This one gives precedence for user choice + dnl if test "x$geany_enable_socket" = xauto; then + dnl if test -n "$1"; then + dnl geany_enable_socket="$1" + dnl else + dnl geany_enable_socket=yes + dnl fi + dnl fi + if test -n "$1"; then + geany_enable_socket="$1" + elif test "x$geany_enable_socket" = xauto; then + geany_enable_socket=yes + fi + + if test "x$geany_enable_socket" = xyes; then + AC_DEFINE([HAVE_SOCKET], [1], [Define if you want to detect a running instance]) + # this should bring in libsocket on Solaris: + AC_SEARCH_LIBS([connect],[socket]) + fi + + _geany_enable_socket_done=yes + fi +])
Added: trunk/m4/geany-vte.m4 =================================================================== --- trunk/m4/geany-vte.m4 (rev 0) +++ trunk/m4/geany-vte.m4 2011-10-06 00:44:48 UTC (rev 6006) @@ -0,0 +1,46 @@ +dnl _GEANY_CHECK_VTE_PREREQ +AC_DEFUN([_GEANY_CHECK_VTE_PREREQ], +[ + AC_ARG_ENABLE([vte], + [AS_HELP_STRING([--enable-vte], + [enable if you want virtual terminal support [default=yes]])], + [geany_enable_vte="$enableval"], + [geany_enable_vte="yes"]) + AC_ARG_WITH([vte-module-path], + [AS_HELP_STRING([--with-vte-module-path=PATH], + [Path to a loadable libvte [default=None]])], + [AC_DEFINE_UNQUOTED([VTE_MODULE_PATH], + ["$withval"], [Path to a loadable libvte])]) +]) + +dnl GEANY_CHECK_VTE([enable]) +AC_DEFUN([GEANY_CHECK_VTE], +[ + AC_REQUIRE([_GEANY_CHECK_VTE_PREREQ]) + + dnl this way of calling once is a bit ugly, but we need to be able to + dnl call this from one or more locations, the first one maybe in a shell + dnl conditional. + dnl see geany-socket.m4 + if test "x$_geany_enable_vte_done" = x; then + dnl This one gives precedence for user choice + dnl if test "x$geany_enable_vte" = xauto; then + dnl if test -n "$1"; then + dnl geany_enable_vte="$1" + dnl else + dnl geany_enable_vte=yes + dnl fi + dnl fi + if test -n "$1"; then + geany_enable_vte="$1" + elif test "x$geany_enable_vte" = xauto; then + geany_enable_vte=yes + fi + + if test "x$geany_enable_vte" = xyes; then + AC_DEFINE([HAVE_VTE], [1], [Define if you want VTE support]) + fi + + _geany_enable_vte_done=yes + fi +])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.