Subversion Repositories Scribus

Rev

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