diff --git a/configure.ac b/configure.ac index 44cce4a6..afaff1f3 100644 --- a/configure.ac +++ b/configure.ac @@ -64,12 +64,16 @@ fi with_local_protobuf_c=no PKG_CHECK_MODULES([LIBPROTOBUF_C], [libprotobuf-c],, - AC_CHECK_LIB(protobuf-c, [protobuf_c_message_pack], - AC_SUBST(LIBPROTOBUF_C_LIBS, [-lprotobuf-c]), +[AC_LIB_HAVE_LINKFLAGS(protobuf-c,, [#include ], [protobuf_c_message_pack(0,0);]) + if test x$ac_cv_libprotobuf_c = xyes; then + AC_SUBST([LIBPROTOBUF_C_LIBS], [$LIBPROTOBUF_C]) + else AC_MSG_WARN([*** libprotobuf-c was not found.]) -with_local_protobuf_c=yes - ) + AC_SUBST([LIBPROTOBUF_C_CFLAGS], [-Iprotobuf/]) + with_local_protobuf_c=yes + fi +] ) AM_CONDITIONAL(LOCAL_PROTOBUF_C, test "x$with_local_protobuf_c" != xno) diff --git a/src/Makefile.am b/src/Makefile.am index 3d4786a7..2e87433e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -60,7 +60,7 @@ ocserv_SOURCES = main.c main-auth.c worker-vpn.c worker-auth.c tlslib.c \ ocserv_SOURCES += ipc.pb-c.h ipc.pb-c.c if LOCAL_PROTOBUF_C -ocserv_SOURCES += google/protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.c +ocserv_SOURCES += protobuf/google/protobuf-c/protobuf-c.h protobuf/google/protobuf-c/protobuf-c.c endif ocserv_LDADD = ../gl/libgnu.a $(NEEDED_LIBOPTS) libcmd-ocserv.a diff --git a/src/google/protobuf-c/protobuf-c.c b/src/protobuf/google/protobuf-c/protobuf-c.c similarity index 100% rename from src/google/protobuf-c/protobuf-c.c rename to src/protobuf/google/protobuf-c/protobuf-c.c diff --git a/src/google/protobuf-c/protobuf-c.h b/src/protobuf/google/protobuf-c/protobuf-c.h similarity index 100% rename from src/google/protobuf-c/protobuf-c.h rename to src/protobuf/google/protobuf-c/protobuf-c.h