Subversion Repositories Scribus

Rev

Rev 780 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
780 fschmid 1
dnl =======================================================
2
dnl FILE: configure.in.in
3
dnl =======================================================
4
 
3 paul 5
# Original Author was Kalle@kde.org
6
# I lifted it in some mater. (Stephan Kulow)
7
# I used much code from Janos Farkas
8
 
9
dnl Process this file with autoconf to produce a configure script.
10
 
11
AC_INIT(acinclude.m4) dnl a source file from your sub dir
12
 
13
dnl This is so we can use kde-common
14
AC_CONFIG_AUX_DIR(admin)
15
 
16
AC_CANONICAL_SYSTEM
17
AC_ARG_PROGRAM
18
 
19
dnl Automake doc recommends to do this only here. (Janos)
456 fschmid 20
AM_INIT_AUTOMAKE(scribus,1.3.0cvs)
3 paul 21
 
22
dnl KDE_SET_PREFIX
23
 
24
AC_PREFIX_DEFAULT(/usr/local)
25
if test "x$prefix" = "xNONE"; then
26
  prefix=$ac_default_prefix
27
  ac_configure_args="$ac_configure_args --prefix $prefix"
28
fi
29
 
68 Franz 30
 
31
LIBART_LIBS=""
32
LIBART_CFLAGS=""
33
LIBART_CONFIG=""
516 fschmid 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])
68 Franz 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)
86 Franz 49
AC_C_BIGENDIAN
68 Franz 50
 
3 paul 51
LIBFREETYPE_LIBS=""
52
LIBFREETYPE_CFLAGS=""
53
 
54
FREETYPE_CONFIG=""
516 fschmid 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])
3 paul 56
 
68 Franz 57
hafree=no
3 paul 58
if test -n "$FREETYPE_CONFIG"; then
59 Franz 59
	LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
60
  LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
705 fschmid 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")
68 Franz 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
59 Franz 68
	AC_SUBST(LIBFREETYPE_LIBS)
69
	AC_SUBST(LIBFREETYPE_CFLAGS)
70
else
68 Franz 71
  AC_MSG_ERROR([You need at least freetype 2.1.0])
3 paul 72
fi
494 fschmid 73
 
74
LIBFONTCONFIG_LIBS=""
75
LIBFONTCONFIG_CFLAGS=""
76
 
77
FONTCONFIG_CONFIG=""
692 fschmid 78
AC_PATH_PROG(FONTCONFIG_CONFIG, fontconfig-config, [AC_MSG_WARN([Could not find libfontconfig anywhere])], [$PATH ${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin /usr/nekoware/bin /usr/X11/bin])
494 fschmid 79
 
80
hafontconfig=no
81
if test -n "$FONTCONFIG_CONFIG"; then
82
	LIBFONTCONFIG_LIBS="`$FONTCONFIG_CONFIG --libs`"
83
	LIBFONTCONFIG_CFLAGS="`$FONTCONFIG_CONFIG --cflags`"
84
	AC_CHECK_LIB(fontconfig, FcPatternBuild, [hafontconfig=yes],[hafontconfig=no])
85
	if test $hafontconfig = yes; then
86
		AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
87
	else
537 fschmid 88
		AC_MSG_WARN([Couldn't find a usable libfontconfig])
494 fschmid 89
	fi
90
	AC_SUBST(LIBFONTCONFIG_LIBS)
91
	AC_SUBST(LIBFONTCONFIG_CFLAGS)
776 fschmid 92
else
93
	PKG_CONFIG=""
94
	AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
95
	if test -n "$PKG_CONFIG"; then
788 fschmid 96
		LIBFONTCONFIG_LIBS="`$PKG_CONFIG fontconfig --libs`"
97
		LIBFONTCONFIG_CFLAGS="`$PKG_CONFIG fontconfig --cflags`"
776 fschmid 98
		AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
99
		AC_SUBST(LIBFONTCONFIG_LIBS)
100
		AC_SUBST(LIBFONTCONFIG_CFLAGS)
101
		hafontconfig=yes
102
	fi
494 fschmid 103
fi
104
 
399 Franz 105
XML_LIBS=""
106
XML_CFLAGS=""
3 paul 107
 
399 Franz 108
XML_CONFIG=""
516 fschmid 109
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])
399 Franz 110
 
111
haxml=no
112
if test -n "$XML_CONFIG"; then
113
	XML_LIBS="`$XML_CONFIG --libs`"
114
	XML_CFLAGS="`$XML_CONFIG --cflags`"
115
	AC_CHECK_LIB(xml2, attribute, [haxml=yes],[haxml=no])
776 fschmid 116
	if test $haxml = yes; then
399 Franz 117
		AC_DEFINE_UNQUOTED(HAVE_XML, 1, [Defines if your system has the libxml2 library])
118
		AC_SUBST(XML_LIBS)
119
		AC_SUBST(XML_CFLAGS)
120
	fi
400 Franz 121
	vers=`$XML_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
122
  	if test -n "$vers" && test "$vers" -ge 2006000
123
	then
124
		AC_DEFINE_UNQUOTED(HAVE_XML26, 1, [Defines if your system has the libxml2 library6])
125
	fi
399 Franz 126
fi
127
 
3 paul 128
AC_CHECK_LIB(socket,socket,
129
if test "$uname" != "IRIX"; then
130
	LIBS="-lsocket $LIBS"
131
else
132
	echo "Not using -lsocket since you are running IRIX."
133
fi)
134
AC_CHECK_LIB(nsl,gethostbyaddr,
135
if test "$uname" != "IRIX"; then
136
	LIBS="-lnsl $LIBS"
137
else
138
	echo "Not using -lnsl since you are running IRIX."
139
fi)
140
LIBCUPS=""
141
hacups=
263 Franz 142
AC_CHECK_PROG(hacups, cups-config, yes)
143
if test x"$hacups" = x"yes"
144
then
145
	LIBCUPS="`cups-config --libs`"
146
	AC_SUBST(LIBCUPS)
147
fi
148
 
3 paul 149
LIBLCMS=""
150
hacms=
106 Franz 151
AC_CHECK_LIB(lcms, _cmsChannelsOf, [LIBLCMS="-llcms";hacms=yes],[LIBLCMS="";hacms=no],[-lm])
3 paul 152
hacmsh=
153
AC_CHECK_HEADER(lcms.h, [hacmsh=yes],[hacmsh=no])
154
if test $hacmsh = no; then
155
	AC_CHECK_HEADER(lcms/lcms.h, [hacmsh=yes],[hacmsh=no])
44 Franz 156
	if test $hacmsh = yes; then
157
 		AC_DEFINE_UNQUOTED(CMS_INC, "lcms/lcms.h", [ColorManagementInclude])
158
	fi
159
else
160
 AC_DEFINE_UNQUOTED(CMS_INC, "lcms.h", [ColorManagementInclude])
3 paul 161
fi
162
AC_SUBST(LIBLCMS)
163
if test $hacms = yes && test $hacmsh = yes; then
164
 AC_DEFINE_UNQUOTED(HAVE_CMS, 1, [ColorManagement])
165
fi
166
LIBTIFF=""
167
hastif=
82 Franz 168
AC_CHECK_LIB(tiff, TIFFOpen, [LIBTIFF="-ltiff";hastif=yes],[LIBTIFF="";hastif=no],[-lm])
3 paul 169
AC_SUBST(LIBTIFF)
170
if test $hastif = yes; then
171
 AC_DEFINE_UNQUOTED(HAVE_TIFF, 1, [Tifflib])
172
fi
173
LIBDL2=""
174
AC_CHECK_LIB(c, dlopen, [LIBDL2="-lc"],[LIBDL2=""])
175
AC_SUBST(LIBDL2)
176
 
177
dnl generate the config header
178
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
179
 
180
AC_DEFINE_UNQUOTED(PREL, "$prefix", [Dataprefix])
181
dnl Checks for programs.
182
AC_CHECK_COMPILERS
183
AC_ENABLE_SHARED(yes)
184
AC_ENABLE_STATIC(no)
185
KDE_PROG_LIBTOOL
400 Franz 186
 
99 Franz 187
hapython=yes
399 Franz 188
kde_python_link_found=no
82 Franz 189
KDE_CHECK_PYTHON(1.5)
96 Franz 190
COMPILE_PYTHON=no
191
AC_ARG_WITH(python, [  --without-python     Do not compile the Scripter Plugin],[ COMPILE_PYTHON=no ],[ COMPILE_PYTHON=yes ])
399 Franz 192
if test $kde_python_link_found = no; then
96 Franz 193
	COMPILE_PYTHON=no
194
fi
399 Franz 195
if test $kde_python_link_found = yes; then
99 Franz 196
  AC_CHECK_HEADER(python2.3/Python.h, [foo=""],[hapython=no])
197
   if test $hapython = yes; then
198
    AC_DEFINE_UNQUOTED(HAVE_PYTHON_23, 1, [Python])
199
   fi
200
fi
96 Franz 201
AM_CONDITIONAL(COMPILE_PYTHON, test x$COMPILE_PYTHON = xyes)
202
 
3 paul 203
AC_CHECK_HEADER(cups/cups.h, [foo=""],[hacups=no])
204
if test $hacups = yes; then
205
 AC_DEFINE_UNQUOTED(HAVE_CUPS, 1, [Cups])
206
fi
207
 
692 fschmid 208
COMPILE_DEBUG=no
209
AC_ARG_ENABLE(debug, [  --enable-debug     Enables Debug-Code],
210
[if test "x$enable_debug" = "xyes"; then
211
	COMPILE_DEBUG=yes
212
    CXXFLAGS="$CXXFLAGS -g3 -fno-inline -O0 "
213
    CFLAGS="$CFLAGS -g3 -fno-inline -O0 "
214
fi])
215
AM_CONDITIONAL(COMPILE_DEBUG, test x$COMPILE_DEBUG = xyes)
216
 
3 paul 217
all_libraries="$all_libraries $USER_LDFLAGS"
218
all_includes="$all_includes $USER_INCLUDES"
219
AC_SUBST(all_includes)
220
AC_SUBST(all_libraries)
221
 
222
AC_PATH_QT
223
 
780 fschmid 224
KDE_CREATE_SUBDIRSLIST
225
AC_CONFIG_FILES([ Makefile ])
226
AC_CONFIG_FILES([ scribus/Makefile ])
227
AC_CONFIG_FILES([ scribus/dicts/Makefile ])
228
AC_CONFIG_FILES([ scribus/doc/Makefile ])
229
AC_CONFIG_FILES([ scribus/doc/en/Makefile ])
230
AC_CONFIG_FILES([ scribus/doc/en/images/Makefile ])
231
AC_CONFIG_FILES([ scribus/doc/en/tutorials/Makefile ])
232
AC_CONFIG_FILES([ scribus/doc/en/tutorials/freedomyug/Makefile ])
233
AC_CONFIG_FILES([ scribus/icons/Makefile ])
234
AC_CONFIG_FILES([ scribus/libabout/Makefile ])
235
AC_CONFIG_FILES([ scribus/libpdf/Makefile ])
236
AC_CONFIG_FILES([ scribus/libpostscript/Makefile ])
237
AC_CONFIG_FILES([ scribus/libprefs/Makefile ])
238
AC_CONFIG_FILES([ scribus/plugins/Makefile ])
239
AC_CONFIG_FILES([ scribus/plugins/fileloader/Makefile ])
240
AC_CONFIG_FILES([ scribus/plugins/fileloader/oodraw/Makefile ])
241
AC_CONFIG_FILES([ scribus/plugins/fontpreview/Makefile ])
242
AC_CONFIG_FILES([ scribus/plugins/gettext/Makefile ])
243
AC_CONFIG_FILES([ scribus/plugins/gettext/csvim/Makefile ])
244
AC_CONFIG_FILES([ scribus/plugins/gettext/htmlim/Makefile ])
245
AC_CONFIG_FILES([ scribus/plugins/gettext/sxwim/Makefile ])
246
AC_CONFIG_FILES([ scribus/plugins/gettext/textfilter/Makefile ])
247
AC_CONFIG_FILES([ scribus/plugins/gettext/txtim/Makefile ])
248
AC_CONFIG_FILES([ scribus/plugins/libchar/Makefile ])
249
AC_CONFIG_FILES([ scribus/plugins/newfromtemplateplugin/Makefile ])
250
AC_CONFIG_FILES([ scribus/plugins/pixmapexport/Makefile ])
251
AC_CONFIG_FILES([ scribus/plugins/printpreview/Makefile ])
252
AC_CONFIG_FILES([ scribus/plugins/psimport/Makefile ])
253
AC_CONFIG_FILES([ scribus/plugins/saveastemplateplugin/Makefile ])
254
AC_CONFIG_FILES([ scribus/plugins/scriptplugin/Makefile ])
255
AC_CONFIG_FILES([ scribus/plugins/scriptplugin/samples/Makefile ])
256
AC_CONFIG_FILES([ scribus/plugins/scriptplugin/scripts/Makefile ])
257
AC_CONFIG_FILES([ scribus/plugins/svgexplugin/Makefile ])
258
AC_CONFIG_FILES([ scribus/plugins/svgimplugin/Makefile ])
259
AC_CONFIG_FILES([ scribus/po/Makefile ])
260
AC_CONFIG_FILES([ scribus/profiles/Makefile ])
261
AC_CONFIG_FILES([ scribus/qm/Makefile ])
262
AC_CONFIG_FILES([ scribus/templates/Makefile ])
3 paul 263
AC_OUTPUT
264
echo "Configuration Summary:"
265
echo ""
59 Franz 266
if test $hafree = yes; then
267
	echo "FreeType2 installed: Yes"
268
else
3 paul 269
	echo "FreeType2 installed: No"
270
fi
271
if test $hacups = yes; then
103 Franz 272
	echo "CUPS installed:      Yes"
3 paul 273
else
103 Franz 274
	echo "CUPS installed:      No"
3 paul 275
fi
276
if test $hacms = yes; then
277
	echo "LittleCMS installed: Yes"
278
else
279
	echo "LittleCMS installed: No"
280
fi
281
if test $hastif = yes; then
103 Franz 282
	echo "TiffLib installed:   Yes"
3 paul 283
else
103 Franz 284
	echo "TiffLib installed:   No"
3 paul 285
fi
399 Franz 286
if test $haxml = yes; then
287
	echo "Libxml2 installed:   Yes"
288
else
289
	echo "Libxml2 installed:   No"
290
fi
96 Franz 291
if test $COMPILE_PYTHON = no; then
102 Franz 292
	echo "The Scripter-Plugin will not be compiled."
99 Franz 293
else
103 Franz 294
	if test $hapython = yes; then
295
  	echo "Using Python 2.3"
296
	else
297
  	echo "Using Python < 2.3"
298
	fi
99 Franz 299
fi
3 paul 300
echo ""
780 fschmid 301
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
302
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
303
  # And if so, warn when they don't match
304
  if test "$kde_libs_prefix" != "$given_prefix"; then
305
    # And if kde doesn't know about the prefix yet
306
    echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
307
    if test $? -ne 0; then
308
      echo ""
309
      echo "Warning: you chose to install this package in $given_prefix,"
310
      echo "but KDE was found in $kde_libs_prefix."
311
      echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
312
      echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
313
      echo "Then restart KDE."
314
      echo ""
315
    fi
316
  fi
317
fi
318
 
319
if test "$all_tests" = "bad"; then
320
  if test ! "$cache_file" = "/dev/null"; then
321
    echo ""
322
    echo "Please remove the file $cache_file after changing your setup"
323
    echo "so that configure will find the changes next time."
324
    echo ""
325
  fi
326
else
327
  echo ""
328
  echo "Good - your configure finished. Start make now"
329
  echo ""
330
fi