summarylogtreecommitdiffstats
path: root/libshp.m4
blob: 5a7cc8b1daf6ad7cddfca96c76ab7560b8df9aa1 (plain)
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 GA_CHECK_LIB_SHP : check for shp library
dnl args :             action-if-yes, action-if-no

AC_DEFUN([GA_CHECK_LIB_SHP],
[
  ga_check_shp="no"
  SHP_LIBS=
  SHP_CFLAGS=
  SHP_LDFLAGS=

  ac_save_LIBS="$LIBS"
  ac_save_CPPFLAGS="$CPPFLAGS"
  ac_save_LDFLAGS="$LDFLAGS"

dnl check for the header shp.h, SHPOpen
  AC_CHECK_HEADER([shapefil.h],
  [  AC_CHECK_LIB([shp], [SHPOpen],
     [  ga_check_shp=yes
     ],
     [
        SHP_LDFLAGS=
        SHP_LIBS=
        LIBS="$ac_save_LIBS"
        LDFLAGS="$ac_save_LDFLAGS"
     ])
  ],
  [
    SHP_CFLAGS=
    CPPFLAGS="$ac_save_CPPFLAGS"
  ])

  LIBS="$ac_save_LIBS"
  CPPFLAGS="$ac_save_CPPFLAGS"
  LDFLAGS="$ac_save_LDFLAGS"

  if test $ga_check_shp = 'yes'; then
     m4_if([$1], [], [:], [$1])
  else
     m4_if([$2], [], [:], [$2])
  fi

#  AC_SUBST([SHP_LIBS])
#  AC_SUBST([SHP_LDFLAGS])
#  AC_SUBST([SHP_CFLAGS])
])