File: config.sh

package info (click to toggle)
popplerkit.framework 0.0.20051227svn-6
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,396 kB
  • ctags: 120
  • sloc: objc: 2,303; sh: 914; cpp: 574; ansic: 55; makefile: 24
file content (63 lines) | stat: -rwxr-xr-x 1,898 bytes parent folder | download | duplicates (9)
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
#!/bin/sh

PKG_CONFIG=`which pkg-config 2>/dev/null`
if [ -z "${PKG_CONFIG}" ]; then
   echo "pkg-config not found!"
   exit 1
fi

# poppler
${PKG_CONFIG} --exists poppler
if [ $? -ne 0 ]; then
   echo "poppler library required but not found!"
   exit 1
fi
POPPLER_CFLAGS=`${PKG_CONFIG} --cflags poppler`
POPPLER_LIBS="${POPPLER_LDFLAGS} `${PKG_CONFIG} --libs poppler`"

# poppler splash device
${PKG_CONFIG} --exists poppler-splash
if [ $? -ne 0 ]; then
    echo "poppler-splash required not found!"
    exit 1
fi
POPPLER_CFLAGS="${POPPLER_CFLAGS} `${PKG_CONFIG} --cflags poppler-splash`"
POPPLER_LIBS="${POPPLER_LDFLAGS} `${PKG_CONFIG} --libs poppler-splash`"

# poppler cairo device
${PKG_CONFIG} --exists poppler-cairo
if [ $? -ne 0 ]; then
   echo "poppler-cairo not found, building without cairo rendering"
   HAVE_CAIRO="NO"
else
   HAVE_CAIRO="YES"
   POPPLER_CFLAGS="${POPPLER_CFLAGS} `${PKG_CONFIG} --cflags poppler-cairo`"
   POPPLER_LIBS="${POPPLER_LDFLAGS} `${PKG_CONFIG} --libs poppler-cairo`"
fi

# include freetype, just to be sure
${PKG_CONFIG} --exists freetype2
if [ $? -eq 0 ]; then
   FT_CFLAGS=`${PKG_CONFIG} --cflags freetype2`
   FT_LIBS=`${PKG_CONFIG} --libs freetype2`
else
   FT_CONFIG=`which freetype-config 2>/dev/null`
   if [ -z "${FT_CONFIG}" ]; then
      echo "freetype2 library required but not found!"
      exit 1
   fi
   FT_CFLAGS=`${FT_CONFIG} --cflags`
   FT_LIBS=`${FT_CONFIG} --libs`
fi

# write config.make
echo "# config.make, generated at `date`" >config.make
echo "POPPLER_CFLAGS=${POPPLER_CFLAGS}" >>config.make
echo "POPPLER_LIBS=${POPPLER_LIBS}" >>config.make
echo "FT_CFLAGS=${FT_CFLAGS}" >> config.make
echo "FT_LIBS=${FT_LIBS}" >> config.make
echo "ADDITIONAL_CFLAGS=\$(POPPLER_CFLAGS) \$(FT_CFLAGS)" >> config.make
echo "ADDITIONAL_LDFLAGS=\$(POPPLER_LIBS) \$(POPPLER_LIBS)" >> config.make
echo "HAVE_CAIRO=${HAVE_CAIRO}" >>config.make

exit 0