Skip to content
Snippets Groups Projects
Commit da7076b7 authored by Ger van Diepen's avatar Ger van Diepen
Browse files

%[BugId: 76]%

Added with-blitz-libdir
Added option to make blitz++ mandatory
parent 2f6ccc41
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
# #
# Macro to check for BLITZ installation # Macro to check for BLITZ installation
# #
# lofar_BLITZ([DEFAULT-PREFIX]) # lofar_BLITZ(option, [DEFAULT-PREFIX])
# option 0 means that Blitz++ is optional, otherwise mandatory.
# #
# e.g. lofar_BLITZ(["/usr/local/blitz"]) # e.g. lofar_BLITZ(["/usr/local/blitz"])
# ------------------------- # -------------------------
...@@ -33,40 +34,74 @@ ...@@ -33,40 +34,74 @@
AC_DEFUN(lofar_BLITZ,dnl AC_DEFUN(lofar_BLITZ,dnl
[dnl [dnl
AC_PREREQ(2.13)dnl AC_PREREQ(2.13)dnl
ifelse($1, [], define(DEFAULT_BLITZ_PREFIX,[/usr/local/blitz]), define(DEFAULT_BLITZ_PREFIX,$1)) ifelse($1, [], [lfr_option=0], [lfr_option=$1])
ifelse($2, [], define(DEFAULT_BLITZ_PREFIX,[/usr/local]), define(DEFAULT_BLITZ_PREFIX,$2))
AC_ARG_WITH(blitz, AC_ARG_WITH(blitz,
[ --with-blitz[=PFX] prefix where Blitz is installed (default=]DEFAULT_BLITZ_PREFIX[)], [ --with-blitz[=PFX] prefix where Blitz is installed (default=]DEFAULT_BLITZ_PREFIX[)],
[with_blitz=$withval], [with_blitz=$withval],
[with_blitz="no"]) [with_blitz=""])
[ AC_ARG_WITH(blitz-libdir,
if test "$with_blitz" = "no"; then [ --with-blitz-libdir=PFX prefix where Blitz library is installed],
enable_blitz=no [with_blitzdir=$withval],
else [with_blitzdir=""])
if test "$with_blitz" = "yes"; then
blitz_prefix=]DEFAULT_BLITZ_PREFIX
[ [
enable_blitz=no
if test "$lfr_option" = "1"; then
enable_blitz=yes
fi
if test "$with_blitz" != "no"; then
if test "$with_blitz" = ""; then
blitz_prefix=]DEFAULT_BLITZ_PREFIX[
if test "$with_blitzdir" != ""; then
enable_blitz=yes
fi
else else
blitz_prefix=$withval if test "$with_blitz" = "yes"; then
blitz_prefix=]DEFAULT_BLITZ_PREFIX[
else
blitz_prefix=$withval
fi
enable_blitz=yes
fi fi
enable_blitz=yes
] ]
## ##
## Check in normal location and suggested location ## Look for header file in suggested location or in its include subdir
## ##
AC_CHECK_FILE([$blitz_prefix/blitz/array.h], AC_CHECK_FILE([$blitz_prefix/blitz/array.h],
[lofar_cv_header_blitz=yes], [lfr_header_blitz=$blitz_prefix/blitz],
[lofar_cv_header_blitz=no])dnl [lfr_header_blitz=no])dnl
[ [
if test $lofar_cv_header_blitz = yes ; then if test "$lfr_header_blitz" != "no" ; then
if test "$with_blitzdir" = ""; then
BLITZ_PATH="$blitz_prefix" with_blitzdir=$blitz_prefix/blitz/lib
fi
else
]
AC_CHECK_FILE([$blitz_prefix/include/blitz/array.h],
[lfr_header_blitz=$blitz_prefix/include],
[lfr_lib_blitz=no])dnl
[
if test "$lfr_header_blitz" != "no"; then
if test "$with_blitzdir" = ""; then
with_blitzdir=$blitz_prefix/lib
fi
fi
fi
if test "$with_blitzdir" != ""; then
]
AC_CHECK_FILE([$with_blitzdir/libblitz.a],
[lfr_lib_blitz=$with_blitzdir],
[lfr_lib_blitz=no])dnl
[
fi
BLITZ_CPPFLAGS="-I$BLITZ_PATH" if test "$lfr_header_blitz" != "no" -a "$lfr_lib_blitz" != "no" ; then
BLITZ_CPPFLAGS="-I$lfr_header_blitz"
BLITZ_CXXFLAGS= BLITZ_CXXFLAGS=
if test "$lofar_compiler" = "gnu"; then if test "$lofar_compiler" = "gnu"; then
BLITZ_CXXFLAGS="-Wno-unused -ftemplate-depth-30" BLITZ_CXXFLAGS="-Wno-unused -ftemplate-depth-30"
fi fi
BLITZ_LDFLAGS="-L$BLITZ_PATH/lib" BLITZ_LDFLAGS="-L$lfr_lib_blitz"
BLITZ_LIBS="-lblitz -lm" BLITZ_LIBS="-lblitz -lm"
CPPFLAGS="$CPPFLAGS $BLITZ_CPPFLAGS" CPPFLAGS="$CPPFLAGS $BLITZ_CPPFLAGS"
...@@ -75,16 +110,19 @@ AC_CHECK_FILE([$blitz_prefix/blitz/array.h], ...@@ -75,16 +110,19 @@ AC_CHECK_FILE([$blitz_prefix/blitz/array.h],
LIBS="$LIBS $BLITZ_LIBS" LIBS="$LIBS $BLITZ_LIBS"
] ]
dnl dnl
AC_SUBST(CPPFLAGS)dnl AC_SUBST(CPPFLAGS)dnl
AC_SUBST(CXXFLAGS)dnl AC_SUBST(CXXFLAGS)dnl
AC_SUBST(LDFLAGS)dnl AC_SUBST(LDFLAGS)dnl
AC_SUBST(LIBS)dnl AC_SUBST(LIBS)dnl
dnl dnl
AC_DEFINE(HAVE_BLITZ, 1, [Define if Blitz is installed])dnl AC_DEFINE(HAVE_BLITZ, 1, [Define if Blitz is installed])dnl
[ [
else] else
AC_MSG_ERROR([Could not find Blitz in $blitz_prefix]) if test "$enable_blitz" = "yes" ; then
]
AC_MSG_ERROR([Could not find Blitz headers or library in $blitz_prefix])
[ [
fi
enable_blitz=no enable_blitz=no
fi fi
fi] fi]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment