File: ac_proj4_version.m4

package info (click to toggle)
postgis 3.5.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 70,052 kB
  • sloc: ansic: 162,204; sql: 93,950; xml: 53,121; cpp: 12,646; perl: 5,658; sh: 5,369; makefile: 3,434; python: 1,205; yacc: 447; lex: 151; pascal: 58
file content (49 lines) | stat: -rw-r--r-- 1,244 bytes parent folder | download | duplicates (2)
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
46
47
48
49
dnl **********************************************************************
dnl *
dnl * PostGIS - Spatial Types for PostgreSQL
dnl * http://postgis.net
dnl * Copyright 2008 Mark Cave-Ayland
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 Extract the PROJ version number from proj.h
dnl
dnl Sets PROJ_VERSION
dnl

AC_DEFUN([AC_PROJ_VERSION], [

	CFLAGS_SAVE="$CFLAGS"
	LDFLAGS_SAVE="$LDFLAGS"
	CFLAGS="$PROJ_CPPFLAGS"
	LDFLAGS="$PROJ_LDLAGS"

  AC_MSG_CHECKING([PROJ version via compiled code])
  AC_RUN_IFELSE([
    AC_LANG_PROGRAM([
      #ifdef HAVE_STDINT_H
      #include <stdio.h>
      #endif
      #include "proj.h"
    ],[
      FILE *fp;
      fp = fopen("conftest.out", "w");
      fprintf(fp, "%d.%d.%d\n", PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH);
      fclose(fp);
    ])
  ],[
    dnl The program ran successfully
    PROJ_VERSION=`cat conftest.out`
  ],[
    AC_MSG_ERROR([Could not extract PROJ version via compiled >=6 test])
  ])
  AC_MSG_RESULT($PROJ_VERSION)

	CFLAGS="$CFLAGS_SAVE"
	LDFLAGS="$LDFLAGS_SAVE"
])