File: aclocal.m4

package info (click to toggle)
gworkspace 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 20,832 kB
  • sloc: objc: 69,382; sh: 488; makefile: 39
file content (77 lines) | stat: -rw-r--r-- 1,760 bytes parent folder | download
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
AC_DEFUN(AC_CHECK_PDFKIT,[
  
  GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes
  . "$GNUSTEP_MAKEFILES/GNUstep.sh"
  unset GNUSTEP_SH_EXPORT_ALL_VARIABLES

  OLD_CFLAGS=$CFLAGS  
  CFLAGS="-xobjective-c `gnustep-config --objc-flags`"

  OLD_LIBS="$LIBS"
  LIBS="$LIBS -lPDFKit `gnustep-config --gui-libs`"

  AC_MSG_CHECKING([for PDFKit])

  AC_LINK_IFELSE(
          [AC_LANG_PROGRAM(
                  [[#include <PDFKit/PDFDocument.h>]],
                  [[[PDFDocument class]];])],
	  $1;
	  have_pdfkit=yes,
	  $2;
	  have_pdfkit=no)

  LIBS="$OLD_LIBS"
  CFLAGS="$OLD_CFLAGS"

  AC_MSG_RESULT($have_pdfkit)
])


AC_DEFUN(AC_CHECK_PDFKIT_DARWIN,[
  AC_MSG_CHECKING([for PDFKit])
  PDF_H="PDFKit/PDFDocument.h"
  PDF_H_PATH="$GNUSTEP_SYSTEM_HEADERS/$PDF_H"

  if test -e $PDF_H_PATH; then
    have_pdfkit=yes
  else 
    PDF_H_PATH="$GNUSTEP_LOCAL_HEADERS/$PDF_H"
    if test -e $PDF_H_PATH; then
      have_pdfkit=yes
    else 
      have_pdfkit=no
    fi
  fi
  
  AC_MSG_RESULT($have_pdfkit)
])


AC_DEFUN([GW_CHECK_POPPLERKIT],
[AC_REQUIRE([AC_PROG_OBJC])
AC_LANG_PUSH([Objective C])

OLD_OBJCFLAGS=$OBJCFLAGS
OBJCFLAGS="$OBJCFLAGS `gnustep-config --objc-flags`"
OLD_LIBS="$LIBS"
LIBS="$LIBS `gnustep-config --gui-libs` -lPopplerKit"

AC_CACHE_CHECK([for PopplerKit], [gw_cv_lib_popplerkit],
  [AC_LINK_IFELSE([AC_LANG_PROGRAM(
	[[@%:@import <PopplerKit/PopplerDocument.h>]],
        [[[PopplerDocument class];]])],
	[gw_cv_lib_popplerkit=yes],
	[gw_cv_lib_popplerkit=no])])
AS_IF([test "x$gw_cv_lib_popplerkit" = xyes],
	[have_popplerkit=yes
	AC_DEFINE([HAVE_POPPLERKIT], [1],
		  [Define if the PopplerKit framework is available])],
	[have_popplerkit=no])

LIBS="$OLD_LIBS"
OBJCFLAGS="$OLD_OBJCFLAGS"

AC_LANG_POP([Objective C])
AC_SUBST([have_popplerkit])
])