From: Paul Ramsey Date: Wed, 14 Aug 2019 22:29:10 +0000 (+0000) Subject: Add missing macro file X-Git-Tag: 3.0.0beta1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7dca5f6e5438a975f87c0252bb3b40f16ad6bdbf;p=postgis Add missing macro file git-svn-id: http://svn.osgeo.org/postgis/trunk@17715 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/macros/ac_protobufc_version.m4 b/macros/ac_protobufc_version.m4 new file mode 100644 index 000000000..c7137fee7 --- /dev/null +++ b/macros/ac_protobufc_version.m4 @@ -0,0 +1,45 @@ +dnl ********************************************************************** +dnl * +dnl * PostGIS - Spatial Types for PostgreSQL +dnl * http://postgis.net +dnl * Copyright 2019 Paul Ramsey +dnl * +dnl * This is free software; you can redistribute and/or modify it under +dnl * the terms of the GNU General Public Licence. See the COPYING file. +dnl * +dnl ********************************************************************** + +dnl +dnl Return the protobuf-c version number +dnl https://github.com/protobuf-c/protobuf-c +dnl + +dnl +dnl This function is only for use AFTER you have confirmed +dnl the presence of protobuf-c/protobuf-c.h +dnl + +AC_DEFUN([AC_PROTOBUFC_VERSION], [ + + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([ + #ifdef HAVE_STDINT_H + #include + #endif + #include "protobuf-c/protobuf-c.h" + ],[ + FILE *fp = fopen("conftest.out", "w"); + fprintf(fp, "%d\n", PROTOBUF_C_VERSION_NUMBER); + fclose(fp); + ]) + ],[ + dnl The program ran successfully, so return the version number + dnl in the form MAJOR * 1000000 + MINOR * 1000 + PATCH + $1=`cat conftest.out` + ],[ + dnl The program failed so return a low version number + $1="0" + ]) + +]) +