summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 3c93dc095f6a29c529a6d699ff47f879248b423f (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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
AC_INIT([argyll], [1.3.7])
AM_INIT_AUTOMAKE([1.9 foreign])

AC_PROG_CC
LT_INIT
AC_PROG_INSTALL

AM_PROG_LIBTOOL
AC_PROG_LIBTOOL

AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])

AC_PATH_XTRA

AC_CHECK_LIB(m, sqrt)
AC_CHECK_LIB(pthread, pthread_create)

AC_CHECK_LIB(tiff, TIFFOpen, TIFF_LIBS="-ltiff", , -lm)
AC_SUBST([TIFF_LIBS])

AC_CHECK_LIB(rt, clock_gettime)

AC_ARG_WITH(system-libicc, [ --with-system-libicc use system libicc instead of argyllcms copy],system_libicc=$withval,system_libicc=no)
AC_MSG_CHECKING([whether to use system libicc or not])
if test x$system_libicc = xno ; then
  HAVE_ICC=false
  AC_MSG_RESULT(no)
else
  AC_MSG_RESULT(yes)
  AC_CHECK_LIB(icc, new_icmFileStd_name, HAVE_ICC="true", , -lm)
  if test "$HAVE_ICC" != "true" ; then
     AC_MSG_ERROR([system libicc missing or not compatible with argyllcms])
  fi
fi
if test "$HAVE_ICC" = "true" ; then
   ICC_LIBS="-licc"
else
   ICC_LIBS='$(top_srcdir)/icc/libicc.la'
   ICC_CFLAGS='-I$(top_srcdir)/icc'
   ICC_SUBDIRS='icc'
fi
AC_SUBST([ICC_LIBS])
AC_SUBST([ICC_CFLAGS])
AC_SUBST([ICC_SUBDIRS])

AC_ARG_WITH(system-libyajl, [ --with-system-libyajl use system libyajl instead of argyllcms copy],system_libyajl=$withval,system_libyajl=no)
AC_MSG_CHECKING([whether to use system libyajl or not])
if test x$system_libyajl = xno ; then
  HAVE_YAJL=false
  AC_MSG_RESULT(no)
else
  AC_MSG_RESULT(yes)
  AC_CHECK_LIB(yajl, yajl_gen_c_comment, HAVE_YAJL="true", , -lm)
  if test "$HAVE_YAJL" != "true" ; then
    AC_MSG_ERROR([system libyajl missing or not compatible with argyllcms])
  fi
fi
if test "$HAVE_YAJL" = "true" ; then
  YAJL_LIBS="-lyajl"
else
  YAJL_LIBS='$(top_srcdir)/jcnf/yajl/libyajl.la'
  YAJL_CFLAGS='-I$(top_srcdir)/jcnf/yajl'
  YAJL_SUBDIRS='yajl'
fi
AC_SUBST([YAJL_LIBS])
AC_SUBST([YAJL_CFLAGS])
AC_SUBST([YAJL_SUBDIRS])

AC_CHECK_LIB(X11, XOpenDisplay, X_LIBS="$X_LIBS -lX11")
AC_CHECK_LIB(Xext, XextFindDisplay, X_LIBS="$X_LIBS -lXext",,-lX11)
AC_CHECK_LIB(Xss, XScreenSaverSuspend, X_LIBS="$X_LIBS -lXss",,-lXext -lX11)
AC_CHECK_LIB(Xrandr, XRRRootToScreen, X_LIBS="$X_LIBS -lXrandr",,-LXext -lX11)
AC_CHECK_LIB(Xinerama, XineramaQueryScreens, X_LIBS="$X_LIBS -lXinerama",,-LXext -lX11)
AC_CHECK_LIB(Xxf86vm, XF86VidModeGetGamma, X_LIBS="$X_LIBS -lXxf86vm",,-lXext -lX11)
AC_SUBST([X_LIBS])

AC_SUBST(OS_LINUX)
AC_SUBST(OS_BSD)
case $host in
    *-linux*)
        OS_LINUX=1
	OS_BSD=0
	AC_DEFINE([OS_LINUX],[1],[Linux kernel])
	AM_CONDITIONAL([OS_LINUX],[true])
	;;
    *-freebsd*|*-kfreebsd*-gnu|*-openbsd*|*-netbsd*)
        OS_LINUX=0
	OS_BSD=1
	AC_DEFINE([OS_LINUX],[0],[Linux kernel])
	AM_CONDITIONAL([OS_LINUX],[false])
	;;
    *)
        OS_LINUX=0
	OS_BSD=0
	AC_DEFINE([OS_LINUX],[0],[Linux kernel])
	AM_CONDITIONAL([OS_LINUX],[false])
        ;;
esac
AC_DEFINE([API_EXPORTED],[],[Default visibility])

AC_C_BIGENDIAN
if test "$ac_cv_c_bigendian" = "yes"; then
  BIGENDIAN="1"
else
  BIGENDIAN="0"
fi
AC_SUBST(BIGENDIAN)

AC_CONFIG_FILES([Makefile
                 h/Makefile
                 doc/Makefile
                 ref/Makefile
                 numlib/Makefile
                 cgats/Makefile
		 plot/Makefile
		 rspl/Makefile
		 icc/Makefile
		 gamut/Makefile
		 xicc/Makefile
		 link/Makefile
		 spectro/Makefile
		 profile/Makefile
		 tweak/Makefile
		 scanin/Makefile
		 render/Makefile
		 target/Makefile
		 imdi/Makefile
		 jcnf/Makefile
		 jcnf/yajl/Makefile
		 ucmm/Makefile])

AC_OUTPUT