Subversion Repositories Scribus

Rev

Rev 779 | Rev 872 | 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
 
26
 
27
LIBART_LIBS=""
28
LIBART_CFLAGS=""
29
LIBART_CONFIG=""
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])
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)
45
AC_C_BIGENDIAN
46
 
47
LIBFREETYPE_LIBS=""
48
LIBFREETYPE_CFLAGS=""
49
 
50
FREETYPE_CONFIG=""
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])
52
 
53
hafree=no
54
if test -n "$FREETYPE_CONFIG"; then
55
	LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
56
  LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
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")
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
64
	AC_SUBST(LIBFREETYPE_LIBS)
65
	AC_SUBST(LIBFREETYPE_CFLAGS)
66
else
67
  AC_MSG_ERROR([You need at least freetype 2.1.0])
68
fi
69
 
70
LIBFONTCONFIG_LIBS=""
71
LIBFONTCONFIG_CFLAGS=""
72
 
73
FONTCONFIG_CONFIG=""
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])
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
84
		AC_MSG_WARN([Couldn't find a usable libfontconfig])
85
	fi
86
	AC_SUBST(LIBFONTCONFIG_LIBS)
87
	AC_SUBST(LIBFONTCONFIG_CFLAGS)
88
else
89
	PKG_CONFIG=""
90
	AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
91
	if test -n "$PKG_CONFIG"; then
783 fschmid 92
		LIBFONTCONFIG_LIBS="`$PKG_CONFIG fontconfig --libs`"
93
		LIBFONTCONFIG_CFLAGS="`$PKG_CONFIG fontconfig --cflags`"
779 fschmid 94
		AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
95
		AC_SUBST(LIBFONTCONFIG_LIBS)
96
		AC_SUBST(LIBFONTCONFIG_CFLAGS)
97
		hafontconfig=yes
98
	fi
99
fi
100
 
101
XML_LIBS=""
102
XML_CFLAGS=""
103
 
104
XML_CONFIG=""
105
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])
106
 
107
haxml=no
108
if test -n "$XML_CONFIG"; then
109
	XML_LIBS="`$XML_CONFIG --libs`"
110
	XML_CFLAGS="`$XML_CONFIG --cflags`"
111
	AC_CHECK_LIB(xml2, attribute, [haxml=yes],[haxml=no])
112
	if test $haxml = yes; then
113
		AC_DEFINE_UNQUOTED(HAVE_XML, 1, [Defines if your system has the libxml2 library])
114
		AC_SUBST(XML_LIBS)
115
		AC_SUBST(XML_CFLAGS)
116
	fi
117
	vers=`$XML_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
118
  	if test -n "$vers" && test "$vers" -ge 2006000
119
	then
120
		AC_DEFINE_UNQUOTED(HAVE_XML26, 1, [Defines if your system has the libxml2 library6])
121
	fi
122
fi
123
 
124
AC_CHECK_LIB(socket,socket,
125
if test "$uname" != "IRIX"; then
126
	LIBS="-lsocket $LIBS"
127
else
128
	echo "Not using -lsocket since you are running IRIX."
129
fi)
130
AC_CHECK_LIB(nsl,gethostbyaddr,
131
if test "$uname" != "IRIX"; then
132
	LIBS="-lnsl $LIBS"
133
else
134
	echo "Not using -lnsl since you are running IRIX."
135
fi)
136
LIBCUPS=""
137
hacups=
138
AC_CHECK_PROG(hacups, cups-config, yes)
139
if test x"$hacups" = x"yes"
140
then
141
	LIBCUPS="`cups-config --libs`"
142
	AC_SUBST(LIBCUPS)
143
fi
144
 
145
LIBLCMS=""
146
hacms=
147
AC_CHECK_LIB(lcms, _cmsChannelsOf, [LIBLCMS="-llcms";hacms=yes],[LIBLCMS="";hacms=no],[-lm])
148
hacmsh=
149
AC_CHECK_HEADER(lcms.h, [hacmsh=yes],[hacmsh=no])
150
if test $hacmsh = no; then
151
	AC_CHECK_HEADER(lcms/lcms.h, [hacmsh=yes],[hacmsh=no])
152
	if test $hacmsh = yes; then
153
 		AC_DEFINE_UNQUOTED(CMS_INC, "lcms/lcms.h", [ColorManagementInclude])
154
	fi
155
else
156
 AC_DEFINE_UNQUOTED(CMS_INC, "lcms.h", [ColorManagementInclude])
157
fi
158
AC_SUBST(LIBLCMS)
159
if test $hacms = yes && test $hacmsh = yes; then
160
 AC_DEFINE_UNQUOTED(HAVE_CMS, 1, [ColorManagement])
161
fi
162
LIBTIFF=""
163
hastif=
164
AC_CHECK_LIB(tiff, TIFFOpen, [LIBTIFF="-ltiff";hastif=yes],[LIBTIFF="";hastif=no],[-lm])
165
AC_SUBST(LIBTIFF)
166
if test $hastif = yes; then
167
 AC_DEFINE_UNQUOTED(HAVE_TIFF, 1, [Tifflib])
168
fi
169
LIBDL2=""
170
AC_CHECK_LIB(c, dlopen, [LIBDL2="-lc"],[LIBDL2=""])
171
AC_SUBST(LIBDL2)
172
 
173
dnl generate the config header
174
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
175
 
176
AC_DEFINE_UNQUOTED(PREL, "$prefix", [Dataprefix])
177
dnl Checks for programs.
178
AC_CHECK_COMPILERS
179
AC_ENABLE_SHARED(yes)
180
AC_ENABLE_STATIC(no)
181
KDE_PROG_LIBTOOL
182
 
183
hapython=yes
184
kde_python_link_found=no
185
KDE_CHECK_PYTHON(1.5)
186
COMPILE_PYTHON=no
187
AC_ARG_WITH(python, [  --without-python     Do not compile the Scripter Plugin],[ COMPILE_PYTHON=no ],[ COMPILE_PYTHON=yes ])
188
if test $kde_python_link_found = no; then
189
	COMPILE_PYTHON=no
190
fi
191
if test $kde_python_link_found = yes; then
192
  AC_CHECK_HEADER(python2.3/Python.h, [foo=""],[hapython=no])
193
   if test $hapython = yes; then
194
    AC_DEFINE_UNQUOTED(HAVE_PYTHON_23, 1, [Python])
195
   fi
196
fi
197
AM_CONDITIONAL(COMPILE_PYTHON, test x$COMPILE_PYTHON = xyes)
198
 
199
AC_CHECK_HEADER(cups/cups.h, [foo=""],[hacups=no])
200
if test $hacups = yes; then
201
 AC_DEFINE_UNQUOTED(HAVE_CUPS, 1, [Cups])
202
fi
203
 
204
COMPILE_DEBUG=no
205
AC_ARG_ENABLE(debug, [  --enable-debug     Enables Debug-Code],
206
[if test "x$enable_debug" = "xyes"; then
207
	COMPILE_DEBUG=yes
208
    CXXFLAGS="$CXXFLAGS -g3 -fno-inline -O0 "
209
    CFLAGS="$CFLAGS -g3 -fno-inline -O0 "
210
fi])
211
AM_CONDITIONAL(COMPILE_DEBUG, test x$COMPILE_DEBUG = xyes)
212
 
213
all_libraries="$all_libraries $USER_LDFLAGS"
214
all_includes="$all_includes $USER_INCLUDES"
215
AC_SUBST(all_includes)
216
AC_SUBST(all_libraries)
217
 
218
AC_PATH_QT
219