Add packaging/epson-laser-printer-escpage.changes file
[platform/upstream/epson-laser-printer-escpage.git] / configure.ac
1 dnl configure.in -- Process this file with autoconf to produce a configure script.
2 dnl Epson Inkjet Printer Driver (ESC/P-R) for Linux
3 dnl Copyright (C) 2006-2009 AVASYS CORPORATION.
4 dnl Copyright (C) Seiko Epson Corporation 2006-2012.
5 dnl  This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 2 of the License, or
8 dnl (at your option) any later version.
9 dnl
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl GNU General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this program; if not, write to the Free Software
17 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.
18
19 AC_PREREQ(2.53)
20 AC_INIT([Epson Laser Printer Driver (ESC/Page) for Linux],
21         [1.0.1],
22         [Seiko Epson Corporation <linux-printer@epson.jp>],
23         [epson-laser-printer-escpage])
24
25 AC_SUBST(PACKAGE_RELEASE, [1])
26 AC_SUBST(LSB_VER, [3.2])
27 AC_SUBST(VENDOR_NAME, ["Seiko Epson Corporation"])
28
29 AC_CONFIG_HEADER([config.h])
30 AC_CONFIG_SRCDIR(src/filter.c)
31
32 LIBARCH=lib32
33 BUILD_MACHINE_ARCH=`uname -m`
34 if test "x$BUILD_MACHINE_ARCH" = "xx86_64"; then
35         LIBARCH=lib64
36 fi
37 AC_SUBST(LIBARCH)
38 AM_INIT_AUTOMAKE([gnu 1.7])
39
40 dnl Checks for programs.
41 AC_PROG_CC
42 AC_C_CONST
43 AC_PROG_CPP
44 AC_PROG_INSTALL
45 AC_PROG_LN_S
46 AC_PROG_LIBTOOL
47 AM_PROG_CC_C_O
48
49 dnl Checks for argments.
50 AC_CHECK_PROG([have_cups_config], [cups-config], [yes], [no])
51
52 if test "xNONE" != "x${prefix}" ; then
53    cups_default_prefix="${prefix}"
54 else
55    cups_default_prefix="${ac_default_prefix}"
56 fi
57
58 AC_ARG_WITH([cupsfilterdir],
59   [AS_HELP_STRING([--with-cupsfilterdir=DIR],
60         [CUPS binary directory, where filters are stored.])],
61   [],
62   [with_cupsfilterdir=no])
63 if test "xno" = "x${with_cupsfilterdir}"; then
64    if test "xyes" = "x$have_cups_config" ; then
65       dnl `@<:@' , `@:>@' are replaced with  `[' , `]'
66       CUPS_FILTER_DIR="${cups_default_prefix}`cups-config --serverbin | sed -e 's,^/@<:@^/@:>@@<:@^/@:>@*,,'`/filter"
67    else
68       CUPS_FILTER_DIR="${cups_default_prefix}/lib/cups/filter"
69    fi
70 else
71    CUPS_FILTER_DIR="${with_cupsfilterdir}"
72 fi
73
74 AC_ARG_WITH([cupsppddir],
75   [AS_HELP_STRING([--with-cupsppddir=DIR],
76         [CUPS ppd directory])],
77   [],
78   [with_cupsppddir=no])
79 if test "xno" = "x${with_cupsppddir}"; then
80    if test -d "${cups_default_prefix}/share/ppd" ; then
81       CUPS_PPD_DIR="${cups_default_prefix}/share/ppd"
82    elif test "xyes" = "x$have_cups_config" ; then
83       dnl `@<:@' , `@:>@' are replaced with  `[' , `]'
84       CUPS_PPD_DIR="${cups_default_prefix}/`cups-config --datadir | sed -e 's,^/@<:@^/@:>@@<:@^/@:>@*,,'`/model"
85    else
86       CUPS_PPD_DIR="${cups_default_prefix}/share/cups/model"
87    fi
88 else
89    CUPS_PPD_DIR="${with_cupsppddir}"
90 fi
91
92 AC_SUBST(CUPS_FILTER_DIR)
93 AC_SUBST(CUPS_PPD_DIR)
94
95
96 dnl Checks for header files.
97 AC_HEADER_STDC
98 AC_HEADER_STAT
99 AC_HEADER_TIME
100 AC_STRUCT_TM
101 AC_TYPE_PID_T
102 AC_TYPE_SIZE_T
103
104 AC_CHECK_HEADERS([\
105         cups/cups.h \
106         cups/ppd.h \
107         cups/raster.h \
108         ])
109 AC_CHECK_HEADERS([\
110         ctype.h \
111         errno.h \
112         fcntl.h \
113         malloc.h \
114         signal.h \
115         stdarg.h \
116         stddef.h \
117         stdlib.h \
118         string.h \
119         sys/stat.h \
120         sys/types.h \
121         time.h \
122         unistd.h \
123         ])
124
125 # Checks for libraries.
126 AC_CHECK_LIB([cups], [ppdOpenFile])
127 AC_CHECK_LIB([cupsimage], [cupsRasterOpen])
128
129 # Checks for library functions.
130 AC_FUNC_MALLOC
131 AC_FUNC_MEMCMP
132 AC_TYPE_SIGNAL
133 AC_CHECK_FUNCS([\
134         memset \
135         strcspn \
136         strerror \
137         strrchr \
138         ])
139
140 AC_CONFIG_FILES([\
141         Makefile \
142         lib/Makefile \
143         epson-laser-printer-escpage.spec \
144         ppd/Makefile \
145         src/Makefile \
146         ])
147
148 AC_OUTPUT