Commit 77ee28f1 authored by legoc's avatar legoc
Browse files

(split) Removed dependencies to protobuf

parent 91ba2c06
......@@ -25,16 +25,10 @@ AC_SUBST(LIBRARY_VERSION)
AX_CXX_COMPILE_STDCXX_11
AC_ZMQ
AC_PROTOBUF_LITE
CAMEO_CXXFLAGS="$ZMQ_CFLAGS \
$PROTOBUF_CFLAGS"
CAMEO_LDFLAGS="$ZMQ_LDFLAGS \
$PROTOBUF_LDFLAGS"
CAMEO_LIBS="$ZMQ_LIB \
$PROTOBUF_LIB"
CAMEO_CXXFLAGS="$ZMQ_CFLAGS"
CAMEO_LDFLAGS="$ZMQ_LDFLAGS"
CAMEO_LIBS="$ZMQ_LIB"
AC_SUBST(CAMEO_CXXFLAGS)
AC_SUBST(CAMEO_LDFLAGS)
......
###############################################################################
# Version 29/04/2019
# Version 18/03/2020
# defines CAMEO_CFLAGS, CAMEO_LDFLAGS, CAMEO_LIBS
#
AC_DEFUN([AC_CAMEO],
......@@ -10,7 +10,6 @@ AC_DEFUN([AC_CAMEO],
[with_cameo=yes])
AC_LIBZMQ
AC_LIBPROTOBUF_LITE
CAMEO_CFLAGS=
CAMEO_LIBS=
......@@ -44,7 +43,7 @@ AC_DEFUN([AC_CAMEO],
CXXFLAGS="$CXXFLAGS $CAMEO_CFLAGS"
# search for library
LIBS="$LIBS $CAMEO_LIBS $LIBZMQ_LDFLAGS $LIBPROTOBUF_LDFLAGS $LIBZMQ_LIB $LIBPROTOBUF_LIB -lcameo"
LIBS="$LIBS $CAMEO_LIBS $LIBZMQ_LDFLAGS $LIBZMQ_LIB -lcameo"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
[[]])],
......@@ -56,8 +55,8 @@ AC_DEFUN([AC_CAMEO],
HAVE_CAMEO=1
LIBS="$cameo_save_LIBS"
CAMEO_LDFLAGS="$LIBZMQ_LDFLAGS $LIBPROTOBUF_LDFLAGS $CAMEO_LIBS"
CAMEO_LIBS="-lcameo $LIBZMQ_LIB $LIBPROTOBUF_LIB -pthread"
CAMEO_LDFLAGS="$LIBZMQ_LDFLAGS $CAMEO_LIBS"
CAMEO_LIBS="-lcameo $LIBZMQ_LIB -pthread"
fi
if test $cameo_found = yes; then
......
###############################################################################
# Version 01/07/2015
# defines LIBPROTOBUF_LDFLAGS, LIBPROTOBUF_LIB
#
AC_DEFUN([AC_LIBPROTOBUF_LITE],
[
AC_ARG_WITH([protobuf],
AS_HELP_STRING([--with-protobuf=PREFIX],[Specify protobuf library location]),
[],
[with_protobuf=yes])
PROTOBUF_LIBS=
protobuf_save_LIBS="$LIBS"
if test $with_protobuf != no; then
if test $with_protobuf != yes; then
protobuf_possible_path="$with_protobuf"
else
protobuf_possible_path="/usr/local /usr /opt /var"
fi
AC_MSG_CHECKING([for protobuf -lprotobuf-lite])
protobuf_found=no
for protobuf_path_tmp in $protobuf_possible_path ; do
LIBS="$LIBS $PROTOBUF_LIBS -lprotobuf-lite"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[PROTOBUF_LIBS="-L$protobuf_path_tmp/lib"
protobuf_found=yes]
[])
if test $protobuf_found = yes; then
break;
fi
done
if test $protobuf_found = yes; then
LIBPROTOBUF_LDFLAGS="$PROTOBUF_LIBS"
LIBPROTOBUF_LIB="-lprotobuf-lite"
AC_MSG_RESULT(yes)
AC_SUBST(LIBPROTOBUF_LDFLAGS)
AC_SUBST(LIBPROTOBUF_LIB)
else
AC_MSG_RESULT(no)
fi
fi
LIBS="$protobuf_save_LIBS"
])
###############################################################################
# Version 01/07/2015
# defines PROTOBUF_CFLAGS, PROTOBUF_LDFLAGS, PROTOBUF_LIB
#
AC_DEFUN([AC_PROTOBUF_LITE],
[ AC_ARG_WITH([protobuf],
AS_HELP_STRING([--with-protobuf=PREFIX],[Specify protobuf library location]),
[],
[with_protobuf=yes])
PROTOBUF_CFLAGS=
PROTOBUF_LIBS=
if test $with_protobuf != no; then
if test $with_protobuf != yes; then
protobuf_possible_path="$with_protobuf"
else
protobuf_possible_path="/usr/local /usr /opt /var"
fi
AC_MSG_CHECKING([for protobuf headers])
protobuf_save_CXXFLAGS="$CXXFLAGS"
protobuf_found=no
for protobuf_path_tmp in $protobuf_possible_path ; do
# test include
CXXFLAGS="$CXXFLAGS -I$protobuf_path_tmp/include"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <google/protobuf/descriptor.h>]],[[]])],
[PROTOBUF_CFLAGS="-I$protobuf_path_tmp/include"
PROTOBUF_LIBS="-L$protobuf_path_tmp/lib"
protobuf_found=yes]
[])
CXXFLAGS="$protobuf_save_CXXFLAGS"
if test $protobuf_found = yes; then
break;
fi
done
AC_MSG_RESULT($protobuf_found)
if test $protobuf_found = yes; then
AC_MSG_CHECKING([for protobuf -lprotobuf-lite])
protobuf_save_LIBS="$LIBS"
CXXFLAGS="$CXXFLAGS $PROTOBUF_CFLAGS"
# search for library
LIBS="$LIBS $PROTOBUF_LIBS -lprotobuf-lite"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <google/protobuf/descriptor.h>]],
[[]])],
[ protobuf_found=yes],
[ protobuf_found=no])
CXXFLAGS="$protobuf_save_CXXFLAGS"
LIBS="$protobuf_save_LIBS"
if test $protobuf_found = yes; then
HAVE_PROTOBUF=1
LIBS="$protobuf_save_LIBS"
PROTOBUF_LDFLAGS="$PROTOBUF_LIBS"
PROTOBUF_LIB="-lprotobuf-lite"
break;
fi
if test $protobuf_found = yes; then
AC_MSG_RESULT(yes)
AC_SUBST(PROTOBUF_CFLAGS)
AC_SUBST(PROTOBUF_LDFLAGS)
AC_SUBST(PROTOBUF_LIB)
else
AC_MSG_RESULT(no)
fi
fi
fi
])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment