Permalink
Browse files

some fixes to make this work on old autotools

This should work back to automake-1.6/autoconf-2.59. _AS_ECHO_LOG is
internal and I shouldn't have used it anyway, and AS_IF doesn't become
n-ary until later. m4_foreach_w also doesn't exist until later.

also, old automake didn't like the way the geometry test ifs were
structured

automake-1.6 can't handle a macro as the first arg of AM_CONDITIONAL
  • Loading branch information...
1 parent 4a48b8c commit 66326026274ba4c3cd4c617964dae512a9bc708e @novas0x2a novas0x2a committed Jan 3, 2009
Showing with 41 additions and 13 deletions.
  1. +11 −1 autogen
  2. +13 −0 configure.ac
  3. +3 −2 m4/ax_check_functions.m4
  4. +4 −5 m4/ax_group_pkg.m4
  5. +5 −0 m4/ax_load_deps.m4
  6. +3 −4 m4/ax_pkg_apple.m4
  7. +2 −1 src/vw/Geometry/tests/Makefile.am
View
12 autogen
@@ -1,3 +1,13 @@
#!/bin/sh
-autoreconf --force --verbose --install -I m4 -I thirdparty/m4
+if [[ -n "$1" && "$1" = "old" ]]; then
+ export AUTOCONF=autoconf-2.59
+ export AUTOMAKE=automake-1.6
+ export ACLOCAL=aclocal-1.6
+ export AUTOHEADER=autoheader-2.59
+ reconf=autoreconf-2.59
+else
+ reconf=autoreconf
+fi
+
+$reconf --force --verbose --install -I m4 -I thirdparty/m4
View
@@ -125,6 +125,12 @@ AX_ARG_ENABLE(optimize, 3, [none], [compiler optimization level
AX_ARG_ENABLE(multi-arch, [], [none], [build multi-arch (universal) binaries])
AX_ARG_ENABLE(lib64, auto, [none], [force /lib64 instead of /lib])
+# These need to be here because automake-1.6 is dumb and does not properly
+# process AM_CONDITIONALs unless the first argument is a simple string.
+AM_CONDITIONAL(ENABLE_SSE, [test x"$ENABLE_SSE" = x"yes"])
+AM_CONDITIONAL(ENABLE_EXCEPTIONS, [test x"$ENABLE_EXCEPTIONS" = x"yes"])
+AM_CONDITIONAL(ENABLE_BOUNDS_CHECK, [test x"$ENABLE_BOUNDS_CHECK" = x"yes"])
+
##################################################
@@ -225,6 +231,13 @@ AX_ARG_WITH(dist-license-summary, [], [mk am-set], [special distri
AX_ARG_WITH(dist-config-options-default, [], [mk am-set], [special distribution config.options.default file])
AX_ARG_WITH(dist-remove-modules, [Geometry Python gui], [mk am-set], [remove certain modules from the distribution])
+# These need to be here because automake-1.6 is dumb and does not properly
+# process AM_CONDITIONALs unless the first argument is a simple string.
+AM_CONDITIONAL(DIST_LICENSE, [test ! -z "$DIST_LICENSE"])
+AM_CONDITIONAL(DIST_LICENSE_SUMMARY, [test ! -z "$DIST_LICENSE_SUMMARY"])
+AM_CONDITIONAL(DIST_CONFIG_OPTIONS_DEFAULT, [test ! -z "$DIST_CONFIG_OPTIONS_DEFAULT"])
+AM_CONDITIONAL(DIST_REMOVE_MODULES, [test ! -z "$DIST_REMOVE_MODULES"])
+
##################################################
View
@@ -15,7 +15,7 @@ AC_DEFUN([AX_CHECK_FUNCTIONS],
for func in $1; do
m4_ifval([$5], [AC_MSG_CHECKING([$5])])
- _AS_ECHO_LOG([Checking for $func in $LIBS])
+ echo ["Checking for $func in $LIBS"] >&AS_MESSAGE_LOG_FD
AC_LINK_IFELSE(
AC_LANG_CALL([],[$func]),
@@ -24,7 +24,8 @@ AC_DEFUN([AX_CHECK_FUNCTIONS],
check_function_missing_libs=yes
check_function_got_it=no
m4_ifval([$4], [$4], [:])
- _AS_ECHO_LOG([Could not find $func in $LIBS])
+ echo ["Could not find $func in $LIBS"] >&AS_MESSAGE_LOG_FD
+
]
)
View
@@ -21,11 +21,10 @@ AC_DEFUN([AX_GROUP_PKG],
m4_if([$2], [], [have_pkg=[no_deps]], AX_LOAD_DEPS(pkg, m4_toupper([[$2]]), missing))
- AS_IF(
- [test x"$have_pkg" = "xno"], [AS_VAR_SET([bool], 0); AC_MSG_RESULT([no (disabled by user)])],
- [test x"$have_pkg" = "xno_deps"], [AS_VAR_SET([bool], 0); AC_MSG_RESULT([no])],
- [test -z "$missing"], [AS_VAR_SET([bool], 1); AC_MSG_RESULT([yes])],
- [bool=0; AC_MSG_RESULT([no ([missing] $missing)]) ])
+ AS_IF([test x"$have_pkg" = "xno"], [AS_VAR_SET([bool], 0); AC_MSG_RESULT([no (disabled by user)])],
+ [AS_IF([test x"$have_pkg" = "xno_deps"], [AS_VAR_SET([bool], 0); AC_MSG_RESULT([no])],
+ [AS_IF([test -z "$missing"], [AS_VAR_SET([bool], 1); AC_MSG_RESULT([yes])],
+ [bool=0; AC_MSG_RESULT([no ([missing] $missing)]) ])])])
AS_IF( [test x"$bool" = "x1"], [have_pkg=yes], [pkg_c=""; pkg_l=""; have_pkg=no])
View
@@ -2,6 +2,11 @@ dnl AX_LOAD_DEPS(<pkg>, <deps>[, <missing>])
dnl copies deps into the pkg CPPFLAGS/LIBS
dnl missing could be a shell var name in which to store
dnl the names of the missing deps
+
+dnl this was introduced in autoconf 2.6, i think.
+m4_ifset([m4_foreach_w], [],
+[m4_define([m4_foreach_w],[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])])])
+
AC_DEFUN([AX_LOAD_DEPS],
[AS_VAR_PUSHDEF([pkg_c], [PKG_]m4_toupper([[$1]])[_CPPFLAGS])
AS_VAR_PUSHDEF([pkg_l], [PKG_]m4_toupper([[$1]])[_LIBS])
View
@@ -21,10 +21,9 @@ AC_DEFUN([AX_PKG_APPLE],
pkg_l="$pkg_l $3"
- AS_IF(
- [test x"$have_pkg" = "xno"], [ AS_VAR_SET([bool], 0); AC_MSG_RESULT([no (disabled by user)]) ],
- [test ! -z "$missing"], [ bool=0; AC_MSG_RESULT([no ([missing] $missing)]) ],
- [bool=1; AC_MSG_RESULT([yes])])
+ AS_IF([test x"$have_pkg" = "xno"], [ AS_VAR_SET([bool], 0); AC_MSG_RESULT([no (disabled by user)]) ],
+ [AS_IF([test ! -z "$missing"], [ bool=0; AC_MSG_RESULT([no ([missing] $missing)]) ],
+ [bool=1; AC_MSG_RESULT([yes])])])
AS_VAR_POPDEF([missing])])
AS_IF( [test x"$bool" = "x1"], [have_pkg=yes], [pkg_c=""; pkg_l=""; have_pkg=no])
@@ -33,11 +33,12 @@ nodist_TestSpatialTree_SOURCES = TestSpatialTree.cxx
if HAVE_PKG_PPL
nodist_TestConvex_SOURCES = TestConvex.cxx
convex_tests = TestConvex
-endif
+else
if HAVE_PKG_APRON
nodist_TestConvex_SOURCES = TestConvex.cxx
convex_tests = TestConvex
endif
+endif
TESTS = TestSphere TestSpatialTree $(convex_tests)

0 comments on commit 6632602

Please sign in to comment.