Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move various tricky configure logic to their own file

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@6007 ea778897-0a13-0410-b9d1-a72fbfd435f5
  • Loading branch information...
commit c955de3ffcf0a65483e7952b9099acfb1b679eab 1 parent f1bce08
@b4n b4n authored
Showing with 30 additions and 14 deletions.
  1. +2 −1  ChangeLog
  2. +2 −13 configure.ac
  3. +26 −0 m4/geany-utils.m4
View
3  ChangeLog
@@ -4,7 +4,8 @@
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-mingw.m4, m4/geany-socket.m4, m4/geany-vte.m4:
+ m4/geany-mingw.m4, m4/geany-socket.m4, m4/geany-vte.m4,
+ m4/geany-utils.m4:
Extract some configure logic to separate files for better
readability.
View
15 configure.ac
@@ -42,6 +42,8 @@ AC_CHECK_FUNCS([gethostname ftruncate fgetpos mkstemp strerror strstr])
# autoscan end
+GEANY_PREFIX
+GEANY_DOCDIR
# check for SVN revision
GEANY_CHECK_REVISION([dnl force debug mode for a SVN working copy
@@ -107,19 +109,6 @@ fi
GEANY_I18N
-# Set ${datadir}
-if test "x${datadir}" = 'x${prefix}/share' -o "x${datarootdir}" = 'x${prefix}/share'; then
- if test "x${prefix}" = "xNONE"; then
- prefix=${ac_default_prefix}
- fi
-fi
-
-# Set ${docdir} if it is empty
-if test -z "${docdir}"; then
- docdir='${datadir}/doc/${PACKAGE}'
- AC_SUBST([docdir])
-fi
-
GEANY_DATA_DIR=`eval echo ${datarootdir}/geany`
AC_SUBST([GEANY_DATA_DIR])
View
26 m4/geany-utils.m4
@@ -0,0 +1,26 @@
+dnl GEANY_PREFIX
+dnl Ensures $prefix and $exec_prefix are set to something sensible
+dnl
+dnl Logic taken from Geany-Plugins' build/expansions.m4
+AC_DEFUN([GEANY_PREFIX],
+[
+ if test "x$prefix" = xNONE; then
+ prefix=$ac_default_prefix
+ fi
+
+ if test "x$exec_prefix" = xNONE; then
+ exec_prefix=$prefix
+ fi
+])
+
+dnl GEANY_DOCDIR
+dnl Ensures $docdir is set and AC_SUBSTed
+dnl
+dnl FIXME: is this really useful?
+AC_DEFUN([GEANY_DOCDIR],
+[
+ if test -z "${docdir}"; then
+ docdir='${datadir}/doc/${PACKAGE}'
+ AC_SUBST([docdir])
+ fi
+])
Please sign in to comment.
Something went wrong with that request. Please try again.