Subversion Repositories Scribus

Rev

Rev 1585 | Rev 1595 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
779 fschmid 1
# Original Author was Kalle@kde.org
2
# I lifted it in some mater. (Stephan Kulow)
3
# I used much code from Janos Farkas
4
 
5
dnl Process this file with autoconf to produce a configure script.
6
 
7
AC_INIT(acinclude.m4) dnl a source file from your sub dir
8
 
9
dnl This is so we can use kde-common
10
AC_CONFIG_AUX_DIR(admin)
11
 
12
AC_CANONICAL_SYSTEM
13
AC_ARG_PROGRAM
14
 
15
dnl Automake doc recommends to do this only here. (Janos)
16
AM_INIT_AUTOMAKE(scribus,1.3.0cvs)
17
 
18
dnl KDE_SET_PREFIX
19
 
20
AC_PREFIX_DEFAULT(/usr/local)
21
if test "x$prefix" = "xNONE"; then
22
  prefix=$ac_default_prefix
23
  ac_configure_args="$ac_configure_args --prefix $prefix"
24
fi
25
 
1592 craig 26
dnl Look for pkg-config, which we use to find fontconfig and
27
dnl will probably need for other things in future.
28
PKG_CONFIG=""
29
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
779 fschmid 30
 
31
LIBART_LIBS=""
32
LIBART_CFLAGS=""
33
LIBART_CONFIG=""
34
AC_PATH_PROG(LIBART_CONFIG, libart2-config,[AC_MSG_ERROR([Could not find libart anywhere, check http://www.levien.com/libart/], [$PATH ${prefix}/bin ${exec_prefix}/bin /usr/local/bin /usr/nekoware/bin /opt/local/bin])
35
])
36
if test -n "$LIBART_CONFIG"; then
37
  vers=`$LIBART_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
38
  if test -n "$vers" && test "$vers" -ge 2003008
39
  then
40
     LIBART_LIBS="`$LIBART_CONFIG --libs`"
41
     LIBART_CFLAGS="`$LIBART_CONFIG --cflags`"
42
     AC_DEFINE_UNQUOTED(HAVE_LIBART, 1, [Defines if your system has the libart library])
43
  else
44
     AC_MSG_ERROR([You need at least libart 2.3.8])
45
  fi
46
fi
47
AC_SUBST(LIBART_LIBS)
48
AC_SUBST(LIBART_CFLAGS)
49
AC_C_BIGENDIAN
50
 
51
LIBFREETYPE_LIBS=""
52
LIBFREETYPE_CFLAGS=""
53
 
54
FREETYPE_CONFIG=""
55
AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, [AC_MSG_ERROR([Could not find libfreetype anywhere, check http://www.freetype.org/])], [$PATH ${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin /usr/nekoware/bin /usr/X11/bin])
56
 
57
hafree=no
58
if test -n "$FREETYPE_CONFIG"; then
59
	LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
60
  LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
61
	AC_CHECK_LIB(freetype, FT_Get_First_Char, [hafree=yes],[hafree=no], "$LIBFREETYPE_LIBS")
62
	AC_CHECK_LIB(freetype, FT_Get_Next_Char, [hafree=yes],[hafree=no], "$LIBFREETYPE_LIBS")
63
	if test $hafree = yes; then
64
		AC_DEFINE_UNQUOTED(HAVE_FREETYPE, 1, [Defines if your system has the libfreetype library])
65
	else
66
  	AC_MSG_ERROR([You need at least freetype 2.1.0])
67
	fi
68
	AC_SUBST(LIBFREETYPE_LIBS)
69
	AC_SUBST(LIBFREETYPE_CFLAGS)
70
else
71
  AC_MSG_ERROR([You need at least freetype 2.1.0])
72
fi
73
 
1592 craig 74
dnl Try to find fontconfig using fontconfig-config or pkg-config.
779 fschmid 75
LIBFONTCONFIG_LIBS=""
76
LIBFONTCONFIG_CFLAGS=""
77
FONTCONFIG_CONFIG=""
1592 craig 78
AC_PATH_PROG(FONTCONFIG_CONFIG, fontconfig-config, [], [$PATH ${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin /usr/nekoware/bin /usr/X11/bin])
779 fschmid 79
 
80
hafontconfig=no
81
if test -n "$FONTCONFIG_CONFIG"; then
1592 craig 82
	dnl found fontconfig-config, use it's results
779 fschmid 83
	LIBFONTCONFIG_LIBS="`$FONTCONFIG_CONFIG --libs`"
84
	LIBFONTCONFIG_CFLAGS="`$FONTCONFIG_CONFIG --cflags`"
1592 craig 85
elif test -n "$PKG_CONFIG"; then
86
	dnl Try to find fontconfig with pkg-config
87
	LIBFONTCONFIG_LIBS="`$PKG_CONFIG fontconfig --libs`"
88
	LIBFONTCONFIG_CFLAGS="`$PKG_CONFIG fontconfig --cflags`"
779 fschmid 89
else
1592 craig 90
	AC_MSG_WARN([Couldn't find fontconfig-config or pkg-config])
779 fschmid 91
fi
1592 craig 92
AC_CHECK_LIB(fontconfig, FcPatternBuild, [hafontconfig=yes],[hafontconfig=no])
93
if test $hafontconfig = yes; then
94
	AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
95
else
96
	AC_MSG_WARN([Couldn't find a usable libfontconfig])
97
fi
98
AC_SUBST(LIBFONTCONFIG_LIBS)
99
AC_SUBST(LIBFONTCONFIG_CFLAGS)
779 fschmid 100
 
1592 craig 101
 
779 fschmid 102
XML_LIBS=""
103
XML_CFLAGS=""
104
 
105
XML_CONFIG=""
106
AC_PATH_PROG(XML_CONFIG, xml2-config, [AC_MSG_ERROR([Could not find libxml2 anywhere, check http://www.xmlsoft.org/])], [${PATH} ${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin /usr/nekoware/bin /usr/X11/bin])
107
 
108
haxml=no
109
if test -n "$XML_CONFIG"; then
110
	XML_LIBS="`$XML_CONFIG --libs`"
111
	XML_CFLAGS="`$XML_CONFIG --cflags`"
112
	AC_CHECK_LIB(xml2, attribute, [haxml=yes],[haxml=no])
113
	if test $haxml = yes; then
114
		AC_DEFINE_UNQUOTED(HAVE_XML, 1, [Defines if your system has the libxml2 library])
115
		AC_SUBST(XML_LIBS)
116
		AC_SUBST(XML_CFLAGS)
117
	fi
118
	vers=`$XML_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
119
  	if test -n "$vers" && test "$vers" -ge 2006000
120
	then
121
		AC_DEFINE_UNQUOTED(HAVE_XML26, 1, [Defines if your system has the libxml2 library6])
122
	fi
123
fi
124
 
125
AC_CHECK_LIB(socket,socket,
126
if test "$uname" != "IRIX"; then
127
	LIBS="-lsocket $LIBS"
128
else
129
	echo "Not using -lsocket since you are running IRIX."
130
fi)
131
AC_CHECK_LIB(nsl,gethostbyaddr,
132
if test "$uname" != "IRIX"; then
133
	LIBS="-lnsl $LIBS"
134
else
135
	echo "Not using -lnsl since you are running IRIX."
136
fi)
137
LIBCUPS=""
138
hacups=
139
AC_CHECK_PROG(hacups, cups-config, yes)
140
if test x"$hacups" = x"yes"
141
then
142
	LIBCUPS="`cups-config --libs`"
143
	AC_SUBST(LIBCUPS)
144
fi
145
 
146
LIBLCMS=""
147
hacms=
148
AC_CHECK_LIB(lcms, _cmsChannelsOf, [LIBLCMS="-llcms";hacms=yes],[LIBLCMS="";hacms=no],[-lm])
149
hacmsh=
150
AC_CHECK_HEADER(lcms.h, [hacmsh=yes],[hacmsh=no])
151
if test $hacmsh = no; then
152
	AC_CHECK_HEADER(lcms/lcms.h, [hacmsh=yes],[hacmsh=no])
153
	if test $hacmsh = yes; then
154
 		AC_DEFINE_UNQUOTED(CMS_INC, "lcms/lcms.h", [ColorManagementInclude])
155
	fi
156
else
157
 AC_DEFINE_UNQUOTED(CMS_INC, "lcms.h", [ColorManagementInclude])
158
fi
159
AC_SUBST(LIBLCMS)
160
if test $hacms = yes && test $hacmsh = yes; then
161
 AC_DEFINE_UNQUOTED(HAVE_CMS, 1, [ColorManagement])
162
fi
1580 craig 163
 
164
dnl Checks for libtiff - library exists, tiffvers.h can be found, and new enough.
779 fschmid 165
LIBTIFF=""
166
hastif=
1580 craig 167
dnl Check if we have libtiff
779 fschmid 168
AC_CHECK_LIB(tiff, TIFFOpen, [LIBTIFF="-ltiff";hastif=yes],[LIBTIFF="";hastif=no],[-lm])
1585 craig 169
if test $hastif = yes; then
170
	dnl Check for tiffvers.h
171
	AC_CHECK_HEADER(tiffvers.h, [], [LIBTIFF="";hastif=no])
172
	if test $hastif = yes; then
173
		dnl Now attempt to check if libtiff is new enough
174
		AC_MSG_CHECKING(libtiff version > 3.6.0)
175
		AC_TRY_COMPILE([
176
		#include "tiffvers.h"
177
		#if TIFFLIB_VERSION < 20031007
178
		#error libtiff is too old, need libtiff 3.6.0 or newer.
179
		#endif
180
		], [], [], [LIBTIFF="";hastif=pre36])
181
		AC_MSG_RESULT($hastif)
182
	fi
183
fi
779 fschmid 184
AC_SUBST(LIBTIFF)
185
if test $hastif = yes; then
186
 AC_DEFINE_UNQUOTED(HAVE_TIFF, 1, [Tifflib])
187
fi
1580 craig 188
 
779 fschmid 189
LIBDL2=""
190
AC_CHECK_LIB(c, dlopen, [LIBDL2="-lc"],[LIBDL2=""])
191
AC_SUBST(LIBDL2)
192
 
193
dnl generate the config header
194
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
195
 
196
dnl Checks for programs.
197
AC_CHECK_COMPILERS
198
AC_ENABLE_SHARED(yes)
199
AC_ENABLE_STATIC(no)
200
KDE_PROG_LIBTOOL
201
 
202
hapython=yes
203
kde_python_link_found=no
204
KDE_CHECK_PYTHON(1.5)
205
COMPILE_PYTHON=no
206
AC_ARG_WITH(python, [  --without-python     Do not compile the Scripter Plugin],[ COMPILE_PYTHON=no ],[ COMPILE_PYTHON=yes ])
207
if test $kde_python_link_found = no; then
208
	COMPILE_PYTHON=no
209
fi
210
if test $kde_python_link_found = yes; then
211
  AC_CHECK_HEADER(python2.3/Python.h, [foo=""],[hapython=no])
212
   if test $hapython = yes; then
213
    AC_DEFINE_UNQUOTED(HAVE_PYTHON_23, 1, [Python])
214
   fi
215
fi
216
AM_CONDITIONAL(COMPILE_PYTHON, test x$COMPILE_PYTHON = xyes)
217
 
218
AC_CHECK_HEADER(cups/cups.h, [foo=""],[hacups=no])
219
if test $hacups = yes; then
220
 AC_DEFINE_UNQUOTED(HAVE_CUPS, 1, [Cups])
221
fi
222
 
223
COMPILE_DEBUG=no
224
AC_ARG_ENABLE(debug, [  --enable-debug     Enables Debug-Code],
225
[if test "x$enable_debug" = "xyes"; then
226
	COMPILE_DEBUG=yes
227
    CXXFLAGS="$CXXFLAGS -g3 -fno-inline -O0 "
228
    CFLAGS="$CFLAGS -g3 -fno-inline -O0 "
229
fi])
230
AM_CONDITIONAL(COMPILE_DEBUG, test x$COMPILE_DEBUG = xyes)
231
 
232
all_libraries="$all_libraries $USER_LDFLAGS"
233
all_includes="$all_includes $USER_INCLUDES"
234
AC_SUBST(all_includes)
235
AC_SUBST(all_libraries)
236
 
237
AC_PATH_QT
238