Permalink
Browse files

this patch adds --with-modulename-cppflags and --with-modulename-libs.

It's definitely a bit of a hack- cppflags prepends the given flags,
while libs overrides the flags and prevents the search. It works,
though. It also explicitly segregates apple and linux searches, since
finding a solution that works for both seems to be a bit of a pain.
  • Loading branch information...
1 parent 38b2702 commit 3a92ea1a726bf5fba1c3cc76fbca10ed4b2e8ab0 @novas0x2a novas0x2a committed Oct 16, 2008
Showing with 41 additions and 23 deletions.
  1. +18 −4 acinclude.m4
  2. +23 −19 configure.ac
View
@@ -123,6 +123,13 @@ AC_DEFUN([AX_PKG],
[ HAVE_PKG_$1=$withval ]
)
+ AC_ARG_WITH(translit($1,`A-Z',`a-z')[-cflags],
+ AC_HELP_STRING([--with-]translit($1,`A-Z',`a-z')[-cppflags], [Add to $1_CPPFLAGS @<:@auto@:>@]),
+ [ ADD_$1_CPPFLAGS=$withval ])
+ AC_ARG_WITH(translit($1,`A-Z',`a-z')[-libs],
+ AC_HELP_STRING([--with-]translit($1,`A-Z',`a-z')[-libs], [Override $1_LIBS and skip search @<:@auto@:>@]),
+ [ FORCE_$1_LDFLAGS=$withval ])
+
if test x"$ENABLE_VERBOSE" = "xyes"; then
AC_MSG_CHECKING([for package $1 in current paths])
else
@@ -138,7 +145,12 @@ AC_DEFUN([AX_PKG],
else
# Test for and inherit libraries from dependencies
- PKG_$1_LIBS="$3"
+ if test -z "${FORCE_$1_LDFLAGS}"; then
+ PKG_$1_LIBS="$3"
+ else
+ PKG_$1_LIBS="${FORCE_$1_LDFLAGS}"
+ fi
+
for x in $2; do
ax_pkg_have_dep=HAVE_PKG_${x}
if test "${!ax_pkg_have_dep}" = "yes"; then
@@ -166,7 +178,9 @@ AC_DEFUN([AX_PKG],
AC_MSG_RESULT([searching...])
fi
- if test -n "${HAVE_PKG_$1}" && test "${HAVE_PKG_$1}" != "yes" && test "${HAVE_PKG_$1}" != "no"; then
+ if test -n "${FORCE_$1_LDFLAGS}"; then
+ PKG_PATHS_$1=""
+ elif test -n "${HAVE_PKG_$1}" && test "${HAVE_PKG_$1}" != "yes" && test "${HAVE_PKG_$1}" != "no"; then
PKG_PATHS_$1=${HAVE_PKG_$1}
else
PKG_PATHS_$1=${PKG_PATHS}
@@ -188,7 +202,7 @@ AC_DEFUN([AX_PKG],
fi
ax_pkg_old_libs=$LIBS
- LIBS=$PKG_$1_LIBS $LIBS
+ LIBS="$PKG_$1_LIBS $LIBS"
for path in none $PKG_PATHS_$1; do
ax_pkg_old_cppflags=$CPPFLAGS
ax_pkg_old_ldflags=$LDFLAGS
@@ -218,7 +232,7 @@ AC_DEFUN([AX_PKG],
if test -z "$5"; then
ASP_CPPFLAGS="-I$path/${AX_INCLUDE_DIR} $ASP_CPPFLAGS"
else
- ASP_CPPFLAGS="$5 $ASP_CPPFLAGS"
+ ASP_CPPFLAGS="$ADD_$1_CPPFLAGS $5 $ASP_CPPFLAGS"
fi
CPPFLAGS="$ax_pkg_old_cppflags $ASP_CPPFLAGS"
AC_LINK_IFELSE(
View
@@ -262,32 +262,36 @@ AX_PKG(SPICE, [], [-lcspice], [SpiceUsr.h SpiceZfc.h])
dnl ISIS includes QT headers without the proper qt module prefix, so
dnl we need to add this check here to force the build system to add an
-dnl extra include path at the top level of the QTCore tree.
+dnl extra include path at the top level of the QTCore tree.
AX_PKG(QT_INCLUDE, [], [], [QVector], [${QT_CPPFLAGS}])
-dnl AX_PKG(QT_CORE, [QT_INCLUDE], [-lQtCore], [QVector], [${QT_CPPFLAGS}])
-dnl AX_PKG(QT_GUI, [QT_INCLUDE], [-lQtGui], [QLabel], [${QT_CPPFLAGS}])
-dnl AX_PKG(QT_SQL, [QT_INCLUDE], [-lQtSql], [QtSql], [${QT_CPPFLAGS}])
+
+if test x"$host_vendor" = "xapple"; then
+ AX_PKG(QWT, [QT_INCLUDE], [-lqwt.5])
+ AX_PKG(GEOS, [], [-lgeos-3.0.0], [])
+ AX_PKG(GSL, [LAPACK], [-lgsl -lgsl.0 -lgslcblas.0 ])
+ AX_PKG(SUPERLU, [], [-lsuperlu_3.0], [])
+ AX_PKG(XERCESC, [], [-lxerces-c.28], [])
+ AX_PKG(QT, [QT_INCLUDE], [], [], [${QT_CPPFLAGS}])
+else
+ AX_PKG(QWT, [QT_INCLUDE], [-lqwt-qt4])
+ AX_PKG(GEOS, [], [-lgeos])
+ AX_PKG(GSL, [LAPACK], [-lgsl])
+ AX_PKG(SUPERLU, [], [-lsuperlu])
+ AX_PKG(XERCESC, [], [-lxerces-c])
+
+ AX_PKG(QT_CORE, [QT_INCLUDE], [-lQtCore], [QVector], [${QT_CPPFLAGS}])
+ AX_PKG(QT_GUI, [QT_INCLUDE], [-lQtGui], [QLabel], [${QT_CPPFLAGS}])
+ AX_PKG(QT_SQL, [QT_INCLUDE], [-lQtSql], [QtSql], [${QT_CPPFLAGS}])
+ AX_PKG(QT, [QT_INCLUDE QT_CORE QT_GUI QT_SQL], [], [], [${QT_CPPFLAGS}])
+fi
dnl We need to link ISIS3RDPARTY against LAPACK because, on some systems,
dnl the ISIS compilation does not resolve certain BLAS symbols that its
dnl dependent 3rd party libraries depend on (for whatever retarded reason).
dnl Thus, we link against LAPACK here because it defines these missing
dnl BLAS symbols in the event that we need them.
-AX_PKG(GEOS, [], [-lgeos-3.0.0], [])
-AX_PKG(SUPERLU, [], [-lsuperlu_3.0], [])
-AX_PKG(XERCESC, [], [-lxerces-c.28], [])
-AX_PKG(ISIS3RDPARTY, [LAPACK], [-lgsl.0 -lgslcblas.0 -lqwt.5.1])
-dnl AX_PKG(ISIS, [QT_INCLUDE QT_CORE QT_GUI QT_SQL SPICE ISIS3RDPARTY], [-lisis3])
-AX_PKG(ISIS, [SPICE GEOS SUPERLU XERCESC ISIS3RDPARTY], [-lisis3])
-
-dnl AX_PKG(SPICE, [], [-lcspice -lcsupport], [SpiceUsr.h SpiceZfc.h])
-dnl AX_PKG(QT_CORE, [], [-lQtCore], [QVector], [QtCore QtCore])
-dnl AX_PKG(QT_GUI, [], [-lQtGui], [QLabel], [QtGui])
-dnl AX_PKG(QT_NETWORK, [], [-lQtNetwork], [], [QtNetwork])
-dnl AX_PKG(QT_SQL, [], [-lQtSql], [], [QtSql])
-dnl AX_PKG(QT, [QT_CORE QT_GUI QT_NETWORK QT_SQL], [])
-dnl AX_PKG(ISIS3RDPARTY, [], [-lgeos -lgeos_c -lxerces-c -lgsl -lgslcblas -liconv -lqwt -lpq -lqwt -lz])
-dnl AX_PKG(ISIS, [SPICE QT ISIS3RDPARTY], [-lisis3])
+AX_PKG(ISIS3RDPARTY, [LAPACK QWT GEOS GSL SUPERLU SPICE XERCESC], [])
+AX_PKG(ISIS, [QT ISIS3RDPARTY], [-lisis3])
# These are here (instead of inside the PKG macro where they belong)
# for backwards compatability with older versions of automake.

0 comments on commit 3a92ea1

Please sign in to comment.