Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
784 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)
4216 mrdocs 16
AM_INIT_AUTOMAKE(scribus,1.2.4)
784 fschmid 17
 
3212 craig 18
dnl Add the libs and includes from --with-extra-libs and --with-extra-includes
19
KDE_CHECK_EXTRA_LIBS
20
 
784 fschmid 21
dnl KDE_SET_PREFIX
22
 
23
AC_PREFIX_DEFAULT(/usr/local)
24
if test "x$prefix" = "xNONE"; then
25
  prefix=$ac_default_prefix
26
  ac_configure_args="$ac_configure_args --prefix $prefix"
27
fi
28
 
29
LIBART_LIBS=""
30
LIBART_CFLAGS=""
31
LIBART_CONFIG=""
32
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])
33
])
34
if test -n "$LIBART_CONFIG"; then
35
  vers=`$LIBART_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
36
  if test -n "$vers" && test "$vers" -ge 2003008
37
  then
38
     LIBART_LIBS="`$LIBART_CONFIG --libs`"
39
     LIBART_CFLAGS="`$LIBART_CONFIG --cflags`"
40
     AC_DEFINE_UNQUOTED(HAVE_LIBART, 1, [Defines if your system has the libart library])
41
  else
42
     AC_MSG_ERROR([You need at least libart 2.3.8])
43
  fi
44
fi
45
AC_SUBST(LIBART_LIBS)
46
AC_SUBST(LIBART_CFLAGS)
47
AC_C_BIGENDIAN
48
 
49
LIBFREETYPE_LIBS=""
50
LIBFREETYPE_CFLAGS=""
51
 
52
FREETYPE_CONFIG=""
53
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])
54
 
55
hafree=no
56
if test -n "$FREETYPE_CONFIG"; then
57
	LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
1682 craig 58
  LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
784 fschmid 59
	AC_CHECK_LIB(freetype, FT_Get_First_Char, [hafree=yes],[hafree=no], "$LIBFREETYPE_LIBS")
60
	AC_CHECK_LIB(freetype, FT_Get_Next_Char, [hafree=yes],[hafree=no], "$LIBFREETYPE_LIBS")
61
	if test $hafree = yes; then
62
		AC_DEFINE_UNQUOTED(HAVE_FREETYPE, 1, [Defines if your system has the libfreetype library])
63
	else
2329 craig 64
		AC_MSG_ERROR([You need at least freetype 2.1.0])
784 fschmid 65
	fi
2329 craig 66
 
67
	dnl Warn the user if they have less than freetype 2.1.9
68
	AC_MSG_CHECKING(freetype version > 2.1.9)
69
	SAVE_CFLAGS="${CFLAGS}"
70
	CFLAGS=" ${LIBFREETYPE_CFLAGS} "
71
	AC_TRY_COMPILE([
72
	#include <ft2build.h>
73
	#include FT_FREETYPE_H
74
	],[
75
	#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR == 1 && FREETYPE_PATCH < 9
76
	#error freetype 2.1 older than 2.1.9
77
	#endif
78
	], [hafree_post219=yes], [hafree_post219=no])
79
	CFLAGS="${SAVE_CFLAGS}"
80
	AC_MSG_RESULT($hafree_post219)
81
	if test hafree_post219 = no; then
82
		AC_MSG_WARN([Your libfreetype is old - version 2.1.9 or newer is recommended])
83
	fi
84
 
784 fschmid 85
	AC_SUBST(LIBFREETYPE_LIBS)
86
	AC_SUBST(LIBFREETYPE_CFLAGS)
87
else
88
  AC_MSG_ERROR([You need at least freetype 2.1.0])
89
fi
90
XML_LIBS=""
91
XML_CFLAGS=""
92
 
93
XML_CONFIG=""
1682 craig 94
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])
784 fschmid 95
 
96
haxml=no
97
if test -n "$XML_CONFIG"; then
98
	XML_LIBS="`$XML_CONFIG --libs`"
99
	XML_CFLAGS="`$XML_CONFIG --cflags`"
100
	AC_CHECK_LIB(xml2, attribute, [haxml=yes],[haxml=no])
1682 craig 101
	if test $hafree = yes; then
784 fschmid 102
		AC_DEFINE_UNQUOTED(HAVE_XML, 1, [Defines if your system has the libxml2 library])
103
		AC_SUBST(XML_LIBS)
104
		AC_SUBST(XML_CFLAGS)
105
	fi
106
	vers=`$XML_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
107
  	if test -n "$vers" && test "$vers" -ge 2006000
108
	then
109
		AC_DEFINE_UNQUOTED(HAVE_XML26, 1, [Defines if your system has the libxml2 library6])
110
	fi
111
fi
112
 
113
AC_CHECK_LIB(socket,socket,
114
if test "$uname" != "IRIX"; then
115
	LIBS="-lsocket $LIBS"
116
else
117
	echo "Not using -lsocket since you are running IRIX."
118
fi)
119
AC_CHECK_LIB(nsl,gethostbyaddr,
120
if test "$uname" != "IRIX"; then
121
	LIBS="-lnsl $LIBS"
122
else
123
	echo "Not using -lnsl since you are running IRIX."
124
fi)
125
LIBCUPS=""
126
hacups=
127
AC_CHECK_PROG(hacups, cups-config, yes)
128
if test x"$hacups" = x"yes"
129
then
130
	LIBCUPS="`cups-config --libs`"
131
	AC_SUBST(LIBCUPS)
132
fi
133
 
134
LIBLCMS=""
135
hacms=
136
AC_CHECK_LIB(lcms, _cmsChannelsOf, [LIBLCMS="-llcms";hacms=yes],[LIBLCMS="";hacms=no],[-lm])
137
hacmsh=
138
AC_CHECK_HEADER(lcms.h, [hacmsh=yes],[hacmsh=no])
139
if test $hacmsh = no; then
140
	AC_CHECK_HEADER(lcms/lcms.h, [hacmsh=yes],[hacmsh=no])
141
	if test $hacmsh = yes; then
1682 craig 142
 		AC_DEFINE_UNQUOTED(CMS_INC, "lcms/lcms.h", [ColorManagementInclude])
784 fschmid 143
	fi
144
else
1682 craig 145
 AC_DEFINE_UNQUOTED(CMS_INC, "lcms.h", [ColorManagementInclude])
784 fschmid 146
fi
147
AC_SUBST(LIBLCMS)
148
if test $hacms = yes && test $hacmsh = yes; then
149
 AC_DEFINE_UNQUOTED(HAVE_CMS, 1, [ColorManagement])
150
fi
151
LIBTIFF=""
152
hastif=
153
AC_CHECK_LIB(tiff, TIFFOpen, [LIBTIFF="-ltiff";hastif=yes],[LIBTIFF="";hastif=no],[-lm])
154
AC_SUBST(LIBTIFF)
155
if test $hastif = yes; then
156
 AC_DEFINE_UNQUOTED(HAVE_TIFF, 1, [Tifflib])
157
fi
158
LIBDL2=""
159
AC_CHECK_LIB(c, dlopen, [LIBDL2="-lc"],[LIBDL2=""])
160
AC_SUBST(LIBDL2)
161
 
162
dnl generate the config header
163
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
164
 
165
dnl Checks for programs.
166
AC_CHECK_COMPILERS
167
AC_ENABLE_SHARED(yes)
168
AC_ENABLE_STATIC(no)
169
KDE_PROG_LIBTOOL
170
 
171
hapython=yes
172
kde_python_link_found=no
173
KDE_CHECK_PYTHON(1.5)
174
COMPILE_PYTHON=no
175
AC_ARG_WITH(python, [  --without-python     Do not compile the Scripter Plugin],[ COMPILE_PYTHON=no ],[ COMPILE_PYTHON=yes ])
176
if test $kde_python_link_found = no; then
177
	COMPILE_PYTHON=no
178
fi
179
if test $kde_python_link_found = yes; then
180
  AC_CHECK_HEADER(python2.3/Python.h, [foo=""],[hapython=no])
181
   if test $hapython = yes; then
182
    AC_DEFINE_UNQUOTED(HAVE_PYTHON_23, 1, [Python])
183
   fi
184
fi
185
AM_CONDITIONAL(COMPILE_PYTHON, test x$COMPILE_PYTHON = xyes)
186
 
187
AC_CHECK_HEADER(cups/cups.h, [foo=""],[hacups=no])
188
if test $hacups = yes; then
189
 AC_DEFINE_UNQUOTED(HAVE_CUPS, 1, [Cups])
190
fi
191
 
192
COMPILE_DEBUG=no
193
AC_ARG_ENABLE(debug, [  --enable-debug     Enables Debug-Code],
1682 craig 194
[if test "x$enable_debug" = "xyes"; then
195
    COMPILE_DEBUG=yes
784 fschmid 196
    CXXFLAGS="$CXXFLAGS -g3 -fno-inline -O0 "
1682 craig 197
    CFLAGS="$CFLAGS -g3 -fno-inline  -O0 "
784 fschmid 198
fi])
199
AM_CONDITIONAL(COMPILE_DEBUG, test x$COMPILE_DEBUG = xyes)
200
 
1682 craig 201
 
784 fschmid 202
all_libraries="$all_libraries $USER_LDFLAGS"
203
all_includes="$all_includes $USER_INCLUDES"
204
AC_SUBST(all_includes)
205
AC_SUBST(all_libraries)
206
 
207
AC_PATH_QT
208