summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-07-21 16:43:14 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-21 16:45:33 +0200
commit81d5442e9734bffb3c156485357ba87448954d19 (patch)
tree497d5f4583f285ea341f8da07d3e22c65f461f49
parenteadd48a8dfe3f60c329e6d0da504ddd801139fa6 (diff)
dolt: use shell wrappers and other small prettyfication
Make the code more readable.
-rw-r--r--dolt.m438
1 files changed, 13 insertions, 25 deletions
diff --git a/dolt.m4 b/dolt.m4
index d14bbe7..18e3141 100644
--- a/dolt.m4
+++ b/dolt.m4
@@ -12,36 +12,24 @@ AC_DEFUN([DOLT], [
AC_REQUIRE([AC_CANONICAL_HOST])
# dolt, a replacement for libtool
# Josh Triplett <josh@freedesktop.org>
-AC_PATH_PROG(DOLT_BASH, bash)
+AC_PATH_PROG([DOLT_BASH], [bash])
AC_MSG_CHECKING([if dolt supports this host])
dolt_supported=yes
-if test x$DOLT_BASH = x; then
- dolt_supported=no
-fi
-if test x$GCC != xyes; then
- dolt_supported=no
-fi
-case $host in
-*-*-linux* \
-|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
- pic_options='-fPIC'
- ;;
-*-apple-darwin*)
- pic_options='-fno-common'
- ;;
-*mingw*|*nacl*)
- pic_options=''
- ;;
-*)
- dolt_supported=no
- ;;
-esac
-if test x$dolt_supported = xno ; then
+AS_IF([test x$DOLT_BASH = x], [dolt_supported=no])
+AS_IF([test x$GCC != xyes], [dolt_supported=no])
+
+AS_CASE([$host],
+ [*-*-linux*|*-*-freebsd*], [pic_options='-fPIC'],
+ [*-apple-darwin*], [pic_options='-fno-common'],
+ [*mingw*|*nacl*], [pic_options='']
+ [*], [dolt_supported=no]
+)
+AS_IF([test x$dolt_supported = xno], [
AC_MSG_RESULT([no, falling back to libtool])
LTCOMPILE='$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
LTCXXCOMPILE='$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
m4_pattern_allow([AM_V_lt])
-else
+], [
AC_MSG_RESULT([yes, replacing libtool])
dnl Start writing out doltcompile.
@@ -175,7 +163,7 @@ __DOLTLIBTOOL__EOF__
dnl Done writing out doltlibtool; substitute it for libtool.
chmod +x doltlibtool
LIBTOOL='$(top_builddir)/doltlibtool'
-fi
+])
AC_SUBST(LTCOMPILE)
AC_SUBST(LTCXXCOMPILE)
# end dolt