summaryrefslogtreecommitdiffstats
path: root/chalk/configure.in.in
blob: 78702ad13d68fd4d5c80f51151df534e958140aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
KDE_CHECK_LIB(Xi, XOpenDisplay, [
	LIB_XINPUTEXT="-lXi"
	AC_DEFINE(HAVE_XINPUTEXT, 1, [Define if you have the X11 Input Extension])
	])
AC_SUBST(LIB_XINPUTEXT)

# Check for lcms
AC_MSG_CHECKING([for lcms >= 1.15])

have_lcms_header='no'
KDE_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
if test "$have_lcms_header" = 'yes'
then
        AC_DEFINE(LCMS_HEADER, <lcms/lcms.h>, [The correct header])

	echo "#include <lcms/lcms.h>" > conftest.$ac_ext
	echo "#if LCMS_VERSION < 115" >> conftest.$ac_ext
	echo "#error Need lcms >= 1.15" >> conftest.$ac_ext
	echo "#endif" >> conftest.$ac_ext
	echo "int main() {}" >> conftest.$ac_ext

else
        # Alternative! Debian does it this way...
	KDE_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)

    if test "$have_lcms_header" = 'yes'
    then
       	AC_DEFINE(LCMS_HEADER, <lcms.h>, [The correct header])

	   echo "#include <lcms.h>" > conftest.$ac_ext
	   echo "#if LCMS_VERSION < 115" >> conftest.$ac_ext
	   echo "#error Need lcms >= 1.15" >> conftest.$ac_ext
	   echo "#endif" >> conftest.$ac_ext
	   echo "int main() {}" >> conftest.$ac_ext
    else
        KDE_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
        # and now debian also does it this way... can't they decide for one way of doing stuff ?
        
       AC_DEFINE(LCMS_HEADER, <liblcms1/lcms.h>, [The correct header])

       echo "#include <liblcms1/lcms.h>" > conftest.$ac_ext
       echo "#if LCMS_VERSION < 115" >> conftest.$ac_ext
       echo "#error Need lcms >= 1.15" >> conftest.$ac_ext
       echo "#endif" >> conftest.$ac_ext
       echo "int main() {}" >> conftest.$ac_ext

   fi
fi


ac_link='$LIBTOOL_SHELL --mode=link --tag=LD ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries -ltqt conftest.$ac_ext -llcms 1>&5'

if AC_TRY_EVAL(ac_link) && test -s conftest; then
    	AC_MSG_RESULT(yes)
        HAVELCMS="yes"
        LCMS_LIBS="-llcms"
else
	AC_MSG_RESULT(no)
	HAVELCMS="no"
	LCMS_LIBS=""
        DO_NOT_COMPILE="$DO_NOT_COMPILE chalk"
fi

AC_SUBST(LCMS_LIBS)

# IM 6.1.3 changed the number of arguments to GetMagickInfoList

AC_MSG_CHECKING(if GetMagickInfoList has only 2 arguments)
CPPFLAGS_TMP="$CPPFLAGS"   # Save preprocessor flags
CPPFLAGS="$LIBMAGICK_CPPFLAGS"
LDFLAGS_TMP="$LDFLAGS"
LDFLAGS="$LDFLAGS -ltqt"

AC_TRY_COMPILE(
	[#include <stdio.h>
	#if HAVE_SYS_TYPES_H
	#include <sys/types.h>
	#endif
	#include "magick/api.h"],
	[const char *pattern; unsigned long ncolors; (void)GetMagickInfoList(pattern, &ncolors)],
	magick_info_list='yes',
	magick_info_list='no')

CPPFLAGS="$CPPFLAGS_TMP"  # Restore preprocessor flags
LDFLAGS="$LDFLAGS_TMP"

if test "$magick_info_list" = 'yes'; then
	AC_MSG_RESULT(yes)
  AC_DEFINE([HAVE_OLD_GETMAGICKINFOLIST], 1, [GetMagickInfoList has different number of arguments with versions >= 6.1.3])
else
	AC_MSG_RESULT(no)
fi

# Check for tdeunittest
AC_MSG_CHECKING([for tdeunittest])

have_tdeunittest_header="no"
KDE_CHECK_HEADER(tdeunittest/tester.h, have_tdeunittest_header="yes", , )
AM_CONDITIONAL(include_tdeunittest_tests, test "$have_tdeunittest_header" = "yes")

# --- OpenGL check ---

AC_HAVE_GL( [], [] )

# --- End of OpenGL check ---

# Check for powf.

AC_CHECK_FUNC(powf, [have_powf="yes"], [AC_CHECK_LIB(m, powf, [have_powf="yes"], [have_powf="no"])])

if test "$have_powf" = 'yes'; then
  AC_DEFINE([HAVE_POWF], 1, [Define to 1 if your system has powf in <maths.h>])
fi\