Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
3 paul 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)
456 fschmid 16
AM_INIT_AUTOMAKE(scribus,1.3.0cvs)
3 paul 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
 
68 Franz 26
 
27
LIBART_LIBS=""
28
LIBART_CFLAGS=""
29
LIBART_CONFIG=""
516 fschmid 30
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 31
])
32
if test -n "$LIBART_CONFIG"; then
33
  vers=`$LIBART_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
34
  if test -n "$vers" && test "$vers" -ge 2003008
35
  then
36
     LIBART_LIBS="`$LIBART_CONFIG --libs`"
37
     LIBART_CFLAGS="`$LIBART_CONFIG --cflags`"
38
     AC_DEFINE_UNQUOTED(HAVE_LIBART, 1, [Defines if your system has the libart library])
39
  else
40
     AC_MSG_ERROR([You need at least libart 2.3.8])
41
  fi
42
fi
43
AC_SUBST(LIBART_LIBS)
44
AC_SUBST(LIBART_CFLAGS)
86 Franz 45
AC_C_BIGENDIAN
68 Franz 46
 
3 paul 47
LIBFREETYPE_LIBS=""
48
LIBFREETYPE_CFLAGS=""
49
 
50
FREETYPE_CONFIG=""
516 fschmid 51
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 52
 
68 Franz 53
hafree=no
3 paul 54
if test -n "$FREETYPE_CONFIG"; then
59 Franz 55
	LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
56
  LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
705 fschmid 57
	AC_CHECK_LIB(freetype, FT_Get_First_Char, [hafree=yes],[hafree=no], "$LIBFREETYPE_LIBS")
58
	AC_CHECK_LIB(freetype, FT_Get_Next_Char, [hafree=yes],[hafree=no], "$LIBFREETYPE_LIBS")
68 Franz 59
	if test $hafree = yes; then
60
		AC_DEFINE_UNQUOTED(HAVE_FREETYPE, 1, [Defines if your system has the libfreetype library])
61
	else
62
  	AC_MSG_ERROR([You need at least freetype 2.1.0])
63
	fi
59 Franz 64
	AC_SUBST(LIBFREETYPE_LIBS)
65
	AC_SUBST(LIBFREETYPE_CFLAGS)
66
else
68 Franz 67
  AC_MSG_ERROR([You need at least freetype 2.1.0])
3 paul 68
fi
494 fschmid 69
 
70
LIBFONTCONFIG_LIBS=""
71
LIBFONTCONFIG_CFLAGS=""
72
 
73
FONTCONFIG_CONFIG=""
692 fschmid 74
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 75
 
76
hafontconfig=no
77
if test -n "$FONTCONFIG_CONFIG"; then
78
	LIBFONTCONFIG_LIBS="`$FONTCONFIG_CONFIG --libs`"
79
	LIBFONTCONFIG_CFLAGS="`$FONTCONFIG_CONFIG --cflags`"
80
	AC_CHECK_LIB(fontconfig, FcPatternBuild, [hafontconfig=yes],[hafontconfig=no])
81
	if test $hafontconfig = yes; then
82
		AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
83
	else
537 fschmid 84
		AC_MSG_WARN([Couldn't find a usable libfontconfig])
494 fschmid 85
	fi
86
	AC_SUBST(LIBFONTCONFIG_LIBS)
87
	AC_SUBST(LIBFONTCONFIG_CFLAGS)
88
dnl else
537 fschmid 89
dnl 	AC_MSG_WARN([Couldn't find a usable libfontconfig])
494 fschmid 90
fi
91
 
399 Franz 92
XML_LIBS=""
93
XML_CFLAGS=""
3 paul 94
 
399 Franz 95
XML_CONFIG=""
516 fschmid 96
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 97
 
98
haxml=no
99
if test -n "$XML_CONFIG"; then
100
	XML_LIBS="`$XML_CONFIG --libs`"
101
	XML_CFLAGS="`$XML_CONFIG --cflags`"
102
	AC_CHECK_LIB(xml2, attribute, [haxml=yes],[haxml=no])
103
	if test $hafree = yes; then
104
		AC_DEFINE_UNQUOTED(HAVE_XML, 1, [Defines if your system has the libxml2 library])
105
		AC_SUBST(XML_LIBS)
106
		AC_SUBST(XML_CFLAGS)
107
	fi
400 Franz 108
	vers=`$XML_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
109
  	if test -n "$vers" && test "$vers" -ge 2006000
110
	then
111
		AC_DEFINE_UNQUOTED(HAVE_XML26, 1, [Defines if your system has the libxml2 library6])
112
	fi
399 Franz 113
fi
114
 
3 paul 115
AC_CHECK_LIB(socket,socket,
116
if test "$uname" != "IRIX"; then
117
	LIBS="-lsocket $LIBS"
118
else
119
	echo "Not using -lsocket since you are running IRIX."
120
fi)
121
AC_CHECK_LIB(nsl,gethostbyaddr,
122
if test "$uname" != "IRIX"; then
123
	LIBS="-lnsl $LIBS"
124
else
125
	echo "Not using -lnsl since you are running IRIX."
126
fi)
127
LIBCUPS=""
128
hacups=
263 Franz 129
AC_CHECK_PROG(hacups, cups-config, yes)
130
if test x"$hacups" = x"yes"
131
then
132
	LIBCUPS="`cups-config --libs`"
133
	AC_SUBST(LIBCUPS)
134
fi
135
 
3 paul 136
LIBLCMS=""
137
hacms=
106 Franz 138
AC_CHECK_LIB(lcms, _cmsChannelsOf, [LIBLCMS="-llcms";hacms=yes],[LIBLCMS="";hacms=no],[-lm])
3 paul 139
hacmsh=
140
AC_CHECK_HEADER(lcms.h, [hacmsh=yes],[hacmsh=no])
141
if test $hacmsh = no; then
142
	AC_CHECK_HEADER(lcms/lcms.h, [hacmsh=yes],[hacmsh=no])
44 Franz 143
	if test $hacmsh = yes; then
144
 		AC_DEFINE_UNQUOTED(CMS_INC, "lcms/lcms.h", [ColorManagementInclude])
145
	fi
146
else
147
 AC_DEFINE_UNQUOTED(CMS_INC, "lcms.h", [ColorManagementInclude])
3 paul 148
fi
149
AC_SUBST(LIBLCMS)
150
if test $hacms = yes && test $hacmsh = yes; then
151
 AC_DEFINE_UNQUOTED(HAVE_CMS, 1, [ColorManagement])
152
fi
153
LIBTIFF=""
154
hastif=
82 Franz 155
AC_CHECK_LIB(tiff, TIFFOpen, [LIBTIFF="-ltiff";hastif=yes],[LIBTIFF="";hastif=no],[-lm])
3 paul 156
AC_SUBST(LIBTIFF)
157
if test $hastif = yes; then
158
 AC_DEFINE_UNQUOTED(HAVE_TIFF, 1, [Tifflib])
159
fi
160
LIBDL2=""
161
AC_CHECK_LIB(c, dlopen, [LIBDL2="-lc"],[LIBDL2=""])
162
AC_SUBST(LIBDL2)
163
 
164
dnl generate the config header
165
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
166
 
167
AC_DEFINE_UNQUOTED(PREL, "$prefix", [Dataprefix])
168
dnl Checks for programs.
169
AC_CHECK_COMPILERS
170
AC_ENABLE_SHARED(yes)
171
AC_ENABLE_STATIC(no)
172
KDE_PROG_LIBTOOL
400 Franz 173
 
99 Franz 174
hapython=yes
399 Franz 175
kde_python_link_found=no
82 Franz 176
KDE_CHECK_PYTHON(1.5)
96 Franz 177
COMPILE_PYTHON=no
178
AC_ARG_WITH(python, [  --without-python     Do not compile the Scripter Plugin],[ COMPILE_PYTHON=no ],[ COMPILE_PYTHON=yes ])
399 Franz 179
if test $kde_python_link_found = no; then
96 Franz 180
	COMPILE_PYTHON=no
181
fi
399 Franz 182
if test $kde_python_link_found = yes; then
99 Franz 183
  AC_CHECK_HEADER(python2.3/Python.h, [foo=""],[hapython=no])
184
   if test $hapython = yes; then
185
    AC_DEFINE_UNQUOTED(HAVE_PYTHON_23, 1, [Python])
186
   fi
187
fi
96 Franz 188
AM_CONDITIONAL(COMPILE_PYTHON, test x$COMPILE_PYTHON = xyes)
189
 
3 paul 190
AC_CHECK_HEADER(cups/cups.h, [foo=""],[hacups=no])
191
if test $hacups = yes; then
192
 AC_DEFINE_UNQUOTED(HAVE_CUPS, 1, [Cups])
193
fi
194
 
692 fschmid 195
COMPILE_DEBUG=no
196
AC_ARG_ENABLE(debug, [  --enable-debug     Enables Debug-Code],
197
[if test "x$enable_debug" = "xyes"; then
198
	COMPILE_DEBUG=yes
199
    CXXFLAGS="$CXXFLAGS -g3 -fno-inline -O0 "
200
    CFLAGS="$CFLAGS -g3 -fno-inline -O0 "
201
fi])
202
AM_CONDITIONAL(COMPILE_DEBUG, test x$COMPILE_DEBUG = xyes)
203
 
3 paul 204
all_libraries="$all_libraries $USER_LDFLAGS"
205
all_includes="$all_includes $USER_INCLUDES"
206
AC_SUBST(all_includes)
207
AC_SUBST(all_libraries)
208
 
209
AC_PATH_QT
210
 
211
AC_CONFIG_FILES([Makefile])
212
AC_CONFIG_FILES([scribus/Makefile])
213
AC_CONFIG_FILES([scribus/icons/Makefile])
214
AC_CONFIG_FILES([scribus/libabout/Makefile])
215
AC_CONFIG_FILES([scribus/libprefs/Makefile])
304 Franz 216
AC_CONFIG_FILES([scribus/libpdf/Makefile])
217
AC_CONFIG_FILES([scribus/libpostscript/Makefile])
218
AC_CONFIG_FILES([scribus/plugins/fontpreview/Makefile])
3 paul 219
AC_CONFIG_FILES([scribus/plugins/libchar/Makefile])
304 Franz 220
AC_CONFIG_FILES([scribus/plugins/newfromtemplateplugin/Makefile])
221
AC_CONFIG_FILES([scribus/plugins/pixmapexport/Makefile])
222
AC_CONFIG_FILES([scribus/plugins/printpreview/Makefile])
290 Franz 223
AC_CONFIG_FILES([scribus/plugins/psimport/Makefile])
304 Franz 224
AC_CONFIG_FILES([scribus/plugins/saveastemplateplugin/Makefile])
82 Franz 225
AC_CONFIG_FILES([scribus/plugins/scriptplugin/Makefile])
226
AC_CONFIG_FILES([scribus/plugins/scriptplugin/samples/Makefile])
224 Franz 227
AC_CONFIG_FILES([scribus/plugins/scriptplugin/scripts/Makefile])
304 Franz 228
AC_CONFIG_FILES([scribus/plugins/svgexplugin/Makefile])
229
AC_CONFIG_FILES([scribus/plugins/svgimplugin/Makefile])
3 paul 230
AC_CONFIG_FILES([scribus/plugins/Makefile])
364 Franz 231
AC_CONFIG_FILES([scribus/plugins/gettext/Makefile])
232
AC_CONFIG_FILES([scribus/plugins/gettext/txtim/Makefile])
377 Franz 233
AC_CONFIG_FILES([scribus/plugins/gettext/csvim/Makefile])
399 Franz 234
AC_CONFIG_FILES([scribus/plugins/gettext/htmlim/Makefile])
411 Franz 235
AC_CONFIG_FILES([scribus/plugins/gettext/sxwim/Makefile])
418 Franz 236
AC_CONFIG_FILES([scribus/plugins/gettext/textfilter/Makefile])
541 fschmid 237
AC_CONFIG_FILES([scribus/plugins/fileloader/Makefile])
238
AC_CONFIG_FILES([scribus/plugins/fileloader/oodraw/Makefile])
3 paul 239
AC_CONFIG_FILES([scribus/profiles/Makefile])
240
AC_CONFIG_FILES([scribus/dicts/Makefile])
400 Franz 241
AC_CONFIG_FILES([scribus/po/Makefile])
3 paul 242
AC_CONFIG_FILES([scribus/qm/Makefile])
560 cbradney 243
AC_CONFIG_FILES([scribus/doc/Makefile])
244
AC_CONFIG_FILES([scribus/doc/en/Makefile])
609 cbradney 245
AC_CONFIG_FILES([scribus/doc/en/images/Makefile])
574 cbradney 246
AC_CONFIG_FILES([scribus/doc/en/tutorials/Makefile])
247
AC_CONFIG_FILES([scribus/doc/en/tutorials/freedomyug/Makefile])
304 Franz 248
AC_CONFIG_FILES([scribus/templates/Makefile])
3 paul 249
AC_OUTPUT
250
echo "Configuration Summary:"
251
echo ""
59 Franz 252
if test $hafree = yes; then
253
	echo "FreeType2 installed: Yes"
254
else
3 paul 255
	echo "FreeType2 installed: No"
256
fi
257
if test $hacups = yes; then
103 Franz 258
	echo "CUPS installed:      Yes"
3 paul 259
else
103 Franz 260
	echo "CUPS installed:      No"
3 paul 261
fi
262
if test $hacms = yes; then
263
	echo "LittleCMS installed: Yes"
264
else
265
	echo "LittleCMS installed: No"
266
fi
267
if test $hastif = yes; then
103 Franz 268
	echo "TiffLib installed:   Yes"
3 paul 269
else
103 Franz 270
	echo "TiffLib installed:   No"
3 paul 271
fi
399 Franz 272
if test $haxml = yes; then
273
	echo "Libxml2 installed:   Yes"
274
else
275
	echo "Libxml2 installed:   No"
276
fi
96 Franz 277
if test $COMPILE_PYTHON = no; then
102 Franz 278
	echo "The Scripter-Plugin will not be compiled."
99 Franz 279
else
103 Franz 280
	if test $hapython = yes; then
281
  	echo "Using Python 2.3"
282
	else
283
  	echo "Using Python < 2.3"
284
	fi
99 Franz 285
fi
3 paul 286
echo ""
287
echo "Start make now."