File: ac_protobufc_version.m4

package info (click to toggle)
postgis 3.6.0~beta1%2Bdfsg-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 73,908 kB
  • sloc: ansic: 163,308; sql: 95,138; xml: 54,220; cpp: 12,646; perl: 5,875; sh: 5,367; makefile: 3,476; python: 1,207; yacc: 447; lex: 151; pascal: 58
file content (45 lines) | stat: -rw-r--r-- 1,169 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
dnl **********************************************************************
dnl *
dnl * PostGIS - Spatial Types for PostgreSQL
dnl * http://postgis.net
dnl * Copyright 2019 Paul Ramsey <pramsey@cleverelephant.ca>
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 <stdio.h>
			#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"
	])

])