mirror of https://github.com/BOINC/boinc.git
Modernize the DC-API autoconf macros
Fix static linking for the client side Allow the caller to specify the actions when the client/master is found or not found git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@2278 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
parent
8bf1e61da7
commit
04d29d0b89
|
@ -22,4 +22,4 @@ SUBDIRS += java
|
|||
endif
|
||||
|
||||
aclocaldir = $(datadir)/aclocal
|
||||
dist_aclocal_DATA = cf/dcapi.m4
|
||||
dist_aclocal_DATA = dcapi.m4
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
dnl
|
||||
dnl SZDG_DCAPI
|
||||
dnl
|
||||
dnl Check for the Distributed Computing Platform development files
|
||||
dnl
|
||||
|
||||
AC_DEFUN([_SZDG_DCAPI_COMMON], [
|
||||
AC_ARG_WITH([dcapi_flavor], AS_HELP_STRING([--with-dcapi-flavor],
|
||||
[DCAPI flavor to use @<:@boinc@:>@]),,
|
||||
[with_dcapi_flavor=boinc])
|
||||
PKG_PROG_PKG_CONFIG([0.17])
|
||||
])
|
||||
|
||||
AC_DEFUN([SZDG_DCAPI_CLIENT], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_CLIENT], [dcapi-${with_dcapi_flavor}-client],,
|
||||
[AC_MSG_ERROR([DC-API client implementation not found])])
|
||||
dnl We want to link the client libs statically
|
||||
dnl XXX We should check if -Wl actually works
|
||||
DCAPI_CLIENT_LIBS="-Wl,-Bstatic $DCAPI_CLIENT_LIBS -Wl,-Bdynamic"
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_CLIENT_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_CLIENT_LIBS"
|
||||
AC_CHECK_HEADERS([dc_client.h], [],
|
||||
[AC_MSG_ERROR([DC-API client headers are missing or unusable])])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc_client.h>]],
|
||||
[[(void)DC_initClient()]])],
|
||||
[true],
|
||||
[AC_MSG_ERROR([DC-API client libraries are missing or unusable])])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
||||
|
||||
AC_DEFUN([SZDG_DCAPI_MASTER], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_MASTER], [dcapi-${with_dcapi_flavor}-master],,
|
||||
[AC_MSG_ERROR([DC-API master implementation not found])])
|
||||
|
||||
dnl Minimal check to see if the headers are usable
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_MASTER_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_MASTER_LIBS"
|
||||
AC_CHECK_HEADERS([dc.h], [],
|
||||
[AC_MSG_ERROR([DC-API master headers are missing or unusable])])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc.h>]],
|
||||
[[(void)DC_initMaster((char *)0)]])],
|
||||
[true],
|
||||
[AC_MSG_ERROR([DC-API master libraries are missing or unusable])])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
|
@ -7,7 +7,6 @@ AM_INIT_AUTOMAKE([foreign])
|
|||
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
dnl AC_DISABLE_SHARED
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
dnl
|
||||
dnl SZDG_DCAPI
|
||||
dnl
|
||||
dnl Check for the Distributed Computing Platform development files
|
||||
dnl
|
||||
|
||||
AC_DEFUN([_SZDG_DCAPI_COMMON], [
|
||||
AC_ARG_WITH([dcapi_flavor], AS_HELP_STRING([--with-dcapi-flavor],
|
||||
[DCAPI flavor to use @<:@boinc@:>@]),,
|
||||
[with_dcapi_flavor=boinc])
|
||||
PKG_PROG_PKG_CONFIG([0.17])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Check for DC-API client libraries.
|
||||
dnl
|
||||
dnl Usage: SZDG_DCAPI_CLIENT([ACTION-IF-FOIND], [ACTION-IF-NOT-FOUND])
|
||||
dnl
|
||||
AC_DEFUN([SZDG_DCAPI_CLIENT], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
DCAPI_CLIENT_LIBS=
|
||||
DCAPI_CLIENT_CFLAGS=
|
||||
|
||||
AC_MSG_CHECKING([for DCAPI_CLIENT])
|
||||
PKG_CHECK_EXISTS([dcapi-${with_dcapi_flavor}-client],
|
||||
[dcapi_client=yes],
|
||||
[dcapi_client=no])
|
||||
AC_MSG_RESULT([$dcapi_client])
|
||||
if test "$dcapi_client" != no; then
|
||||
DCAPI_CLIENT_LIBS=`pkg-config --libs --static dcapi-${with_dcapi_flavor}-client`
|
||||
DCAPI_CLIENT_CPPFLAGS=`pkg-config --cflags dcapi-${with_dcapi_flavor}-client`
|
||||
|
||||
DCAPI_CLIENT_LIBS="-Wl,-Bstatic $DCAPI_CLIENT_LIBS -Wl,-Bdynamic"
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_CLIENT_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_CLIENT_LIBS"
|
||||
AC_LANG_PUSH([C])
|
||||
AC_CHECK_HEADERS([dc_client.h], [], [dcapi_client=no])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc_client.h>]],
|
||||
[[(void)DC_initClient()]])],
|
||||
[true],
|
||||
[dcapi_client=no])
|
||||
AC_LANG_POP([C])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
fi
|
||||
|
||||
AC_SUBST([DCAPI_CLIENT_LIBS])
|
||||
AC_SUBST([DCAPI_CLIENT_CFLAGS])
|
||||
|
||||
dnl Backward compatibility: produce an error if the above tests fail
|
||||
dnl and both $1 and $2 are empty
|
||||
m4_ifblank([$1], [m4_ifblank([$2],
|
||||
if test "$dcapi_client" != yes; then
|
||||
AC_MSG_ERROR([DC-API client libraries were not found])
|
||||
fi)])
|
||||
|
||||
if test "$dcapi_client" = yes; then
|
||||
m4_ifblank([$1], [:], [$1])
|
||||
m4_ifnblank([$2],[else
|
||||
$2])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Check for DC-API master libraries.
|
||||
dnl
|
||||
dnl Usage: SZDG_DCAPI_MASTER([ACTION-IF-FOIND], [ACTION-IF-NOT-FOUND])
|
||||
dnl
|
||||
AC_DEFUN([SZDG_DCAPI_MASTER], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_MASTER],
|
||||
[dcapi-${with_dcapi_flavor}-master],
|
||||
[dcapi_master=yes],
|
||||
[dcapi_master=no])
|
||||
|
||||
if test "$dcapi_master" != no; then
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_MASTER_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_MASTER_LIBS"
|
||||
AC_LANG_PUSH([C])
|
||||
AC_CHECK_HEADERS([dc.h], [], [dcapi_master=no])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc.h>]],
|
||||
[[(void)DC_initMaster((char *)0)]])],
|
||||
[true],
|
||||
[dcapi_master=no])
|
||||
AC_LANG_POP([C])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
fi
|
||||
|
||||
dnl Backward compatibility: produce an error if the above tests fail
|
||||
dnl and both $1 and $2 are empty
|
||||
m4_ifblank([$1], [m4_ifblank([$2],
|
||||
if test "$dcapi_master" != yes; then
|
||||
AC_MSG_ERROR([DC-API master libraries were not found])
|
||||
fi)])
|
||||
|
||||
if test "$dcapi_master" = yes; then
|
||||
m4_ifblank([$1], [:], [$1])
|
||||
m4_ifnblank([$2],[else
|
||||
$2])
|
||||
fi
|
||||
])
|
|
@ -1,4 +1,4 @@
|
|||
AC_INIT([Message Passing Example Application], [5.01], [desktopgrid@lpds.sztaki.hu], [message-example])
|
||||
AC_INIT([Message Passing Example Application], [6.00], [desktopgrid@lpds.sztaki.hu], [message-example])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_SRCDIR([client.c])
|
||||
|
||||
|
@ -24,13 +24,11 @@ AM_CONDITIONAL([BUILD_CLIENT], [test "$enable_client" = yes])
|
|||
AM_CONDITIONAL([BUILD_MASTER], [test "$enable_master" = yes])
|
||||
|
||||
if test "$enable_client" = yes; then
|
||||
SZDG_DCAPI_CLIENT
|
||||
AC_MSG_NOTICE([will build client])
|
||||
SZDG_DCAPI_CLIENT([], [AC_MSG_ERROR([DC-API client libraries were not found])])
|
||||
fi
|
||||
|
||||
if test "$enable_master" = yes; then
|
||||
SZDG_DCAPI_MASTER
|
||||
AC_MSG_NOTICE([will build master])
|
||||
SZDG_DCAPI_MASTER([], [AC_MSG_ERROR([DC-API master libraries were not found])])
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
dnl
|
||||
dnl SZDG_DCAPI
|
||||
dnl
|
||||
dnl Check for the Distributed Computing Platform development files
|
||||
dnl
|
||||
|
||||
AC_DEFUN([_SZDG_DCAPI_COMMON], [
|
||||
AC_ARG_WITH([dcapi_flavor], AS_HELP_STRING([--with-dcapi-flavor],
|
||||
[DCAPI flavor to use @<:@boinc@:>@]),,
|
||||
[with_dcapi_flavor=boinc])
|
||||
PKG_PROG_PKG_CONFIG([0.17])
|
||||
])
|
||||
|
||||
AC_DEFUN([SZDG_DCAPI_CLIENT], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_CLIENT], [dcapi-${with_dcapi_flavor}-client],,
|
||||
[AC_MSG_ERROR([DC-API client implementation not found])])
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_CLIENT_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_CLIENT_LIBS"
|
||||
AC_CHECK_HEADERS([dc_client.h], [],
|
||||
[AC_MSG_ERROR([DC-API client headers are missing or unusable])])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc_client.h>]],
|
||||
[[(void)DC_initClient()]])],
|
||||
[true],
|
||||
[AC_MSG_ERROR([DC-API client libraries are missing or unusable])])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
||||
|
||||
AC_DEFUN([SZDG_DCAPI_MASTER], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_MASTER], [dcapi-${with_dcapi_flavor}-master],,
|
||||
[AC_MSG_ERROR([DC-API master implementation not found])])
|
||||
|
||||
dnl Minimal check to see if the headers are usable
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_MASTER_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_MASTER_LIBS"
|
||||
AC_CHECK_HEADERS([dc.h], [],
|
||||
[AC_MSG_ERROR([DC-API master headers are missing or unusable])])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc.h>]],
|
||||
[[(void)DC_initMaster((char *)0)]])],
|
||||
[true],
|
||||
[AC_MSG_ERROR([DC-API master libraries are missing or unusable])])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
|
@ -1,4 +1,4 @@
|
|||
AC_INIT([Example Application for master checkpoint], [5.01], [desktopgrid@lpds.sztaki.hu], [serialize-example])
|
||||
AC_INIT([Example Application for master checkpoint], [6.00], [desktopgrid@lpds.sztaki.hu], [serialize-example])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_SRCDIR([client.c])
|
||||
|
||||
|
@ -24,13 +24,11 @@ AM_CONDITIONAL([BUILD_CLIENT], [test "$enable_client" = yes])
|
|||
AM_CONDITIONAL([BUILD_MASTER], [test "$enable_master" = yes])
|
||||
|
||||
if test "$enable_client" = yes; then
|
||||
SZDG_DCAPI_CLIENT
|
||||
AC_MSG_NOTICE([will build client])
|
||||
SZDG_DCAPI_CLIENT([], [AC_MSG_ERROR([DC-API client libraries were not found])])
|
||||
fi
|
||||
|
||||
if test "$enable_master" = yes; then
|
||||
SZDG_DCAPI_MASTER
|
||||
AC_MSG_NOTICE([will build master])
|
||||
SZDG_DCAPI_MASTER([], [AC_MSG_ERROR([DC-API master libraries were not found])])
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
dnl
|
||||
dnl SZDG_DCAPI
|
||||
dnl
|
||||
dnl Check for the Distributed Computing Platform development files
|
||||
dnl
|
||||
|
||||
AC_DEFUN([_SZDG_DCAPI_COMMON], [
|
||||
AC_ARG_WITH([dcapi_flavor], AS_HELP_STRING([--with-dcapi-flavor],
|
||||
[DCAPI flavor to use @<:@boinc@:>@]),,
|
||||
[with_dcapi_flavor=boinc])
|
||||
PKG_PROG_PKG_CONFIG([0.17])
|
||||
])
|
||||
|
||||
AC_DEFUN([SZDG_DCAPI_CLIENT], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_CLIENT], [dcapi-${with_dcapi_flavor}-client],,
|
||||
[AC_MSG_ERROR([DC-API client implementation not found])])
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_CLIENT_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_CLIENT_LIBS"
|
||||
AC_CHECK_HEADERS([dc_client.h], [],
|
||||
[AC_MSG_ERROR([DC-API client headers are missing or unusable])])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc_client.h>]],
|
||||
[[(void)DC_initClient()]])],
|
||||
[true],
|
||||
[AC_MSG_ERROR([DC-API client libraries are missing or unusable])])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
||||
|
||||
AC_DEFUN([SZDG_DCAPI_MASTER], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_MASTER], [dcapi-${with_dcapi_flavor}-master],,
|
||||
[AC_MSG_ERROR([DC-API master implementation not found])])
|
||||
|
||||
dnl Minimal check to see if the headers are usable
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_MASTER_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_MASTER_LIBS"
|
||||
AC_CHECK_HEADERS([dc.h], [],
|
||||
[AC_MSG_ERROR([DC-API master headers are missing or unusable])])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc.h>]],
|
||||
[[(void)DC_initMaster((char *)0)]])],
|
||||
[true],
|
||||
[AC_MSG_ERROR([DC-API master libraries are missing or unusable])])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
|
@ -1,4 +1,4 @@
|
|||
AC_INIT([Uppercase Example Application], [5.01], [desktopgrid@lpds.sztaki.hu], [uppercase-example])
|
||||
AC_INIT([Uppercase Example Application], [6.00], [desktopgrid@lpds.sztaki.hu], [uppercase-example])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_SRCDIR([client.c])
|
||||
|
||||
|
@ -24,13 +24,11 @@ AM_CONDITIONAL([BUILD_CLIENT], [test "$enable_client" = yes])
|
|||
AM_CONDITIONAL([BUILD_MASTER], [test "$enable_master" = yes])
|
||||
|
||||
if test "$enable_client" = yes; then
|
||||
SZDG_DCAPI_CLIENT
|
||||
AC_MSG_NOTICE([will build client])
|
||||
SZDG_DCAPI_CLIENT([], [AC_MSG_ERROR([DC-API client libraries were not found])])
|
||||
fi
|
||||
|
||||
if test "$enable_master" = yes; then
|
||||
SZDG_DCAPI_MASTER
|
||||
AC_MSG_NOTICE([will build master])
|
||||
SZDG_DCAPI_MASTER([], [AC_MSG_ERROR([DC-API master libraries were not found])])
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
dnl
|
||||
dnl SZDG_DCAPI
|
||||
dnl
|
||||
dnl Check for the Distributed Computing Platform development files
|
||||
dnl
|
||||
|
||||
AC_DEFUN([_SZDG_DCAPI_COMMON], [
|
||||
AC_ARG_WITH([dcapi_flavor], AS_HELP_STRING([--with-dcapi-flavor],
|
||||
[DCAPI flavor to use @<:@boinc@:>@]),,
|
||||
[with_dcapi_flavor=boinc])
|
||||
PKG_PROG_PKG_CONFIG([0.17])
|
||||
])
|
||||
|
||||
AC_DEFUN([SZDG_DCAPI_CLIENT], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_CLIENT], [dcapi-${with_dcapi_flavor}-client],,
|
||||
[AC_MSG_ERROR([DC-API client implementation not found])])
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_CLIENT_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_CLIENT_LIBS"
|
||||
AC_CHECK_HEADERS([dc_client.h], [],
|
||||
[AC_MSG_ERROR([DC-API client headers are missing or unusable])])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc_client.h>]],
|
||||
[[(void)DC_initClient()]])],
|
||||
[true],
|
||||
[AC_MSG_ERROR([DC-API client libraries are missing or unusable])])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
||||
|
||||
AC_DEFUN([SZDG_DCAPI_MASTER], [
|
||||
AC_REQUIRE([_SZDG_DCAPI_COMMON])
|
||||
|
||||
PKG_CHECK_MODULES([DCAPI_MASTER], [dcapi-${with_dcapi_flavor}-master],,
|
||||
[AC_MSG_ERROR([DC-API master implementation not found])])
|
||||
|
||||
dnl Minimal check to see if the headers are usable
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DCAPI_MASTER_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $DCAPI_MASTER_LIBS"
|
||||
AC_CHECK_HEADERS([dc.h], [],
|
||||
[AC_MSG_ERROR([DC-API master headers are missing or unusable])])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dc.h>]],
|
||||
[[(void)DC_initMaster((char *)0)]])],
|
||||
[true],
|
||||
[AC_MSG_ERROR([DC-API master libraries are missing or unusable])])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
Loading…
Reference in New Issue