Skip to content

Commit

Permalink
some fixes to make this work on old autotools
Browse files Browse the repository at this point in the history
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
novas0x2a committed Jan 3, 2009
1 parent 4a48b8c commit 6632602
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 13 deletions.
12 changes: 11 additions & 1 deletion autogen
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"])



##################################################
Expand Down Expand Up @@ -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"])



##################################################
Expand Down
5 changes: 3 additions & 2 deletions m4/ax_check_functions.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand All @@ -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
]
)
Expand Down
9 changes: 4 additions & 5 deletions m4/ax_group_pkg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
5 changes: 5 additions & 0 deletions m4/ax_load_deps.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
7 changes: 3 additions & 4 deletions m4/ax_pkg_apple.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
3 changes: 2 additions & 1 deletion src/vw/Geometry/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 6632602

Please sign in to comment.