]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-common.m4
e7bf3eec25d9631a754629c1bd4c89e171a8cca0
[thirdparty/cups.git] / config-scripts / cups-common.m4
1 dnl
2 dnl "$Id: cups-common.m4,v 1.12 2001/11/02 17:34:54 mike Exp $"
3 dnl
4 dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2001 by Easy Software Products, all rights reserved.
7 dnl
8 dnl These coded instructions, statements, and computer programs are the
9 dnl property of Easy Software Products and are protected by Federal
10 dnl copyright law. Distribution and use rights are outlined in the file
11 dnl "LICENSE.txt" which should have been included with this file. If this
12 dnl file is missing or damaged please contact Easy Software Products
13 dnl at:
14 dnl
15 dnl Attn: CUPS Licensing Information
16 dnl Easy Software Products
17 dnl 44141 Airport View Drive, Suite 204
18 dnl Hollywood, Maryland 20636-3111 USA
19 dnl
20 dnl Voice: (301) 373-9603
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
23 dnl
24
25 AC_CONFIG_HEADER(config.h)
26
27 dnl Default compiler flags...
28 CFLAGS="${CFLAGS:=}"
29 CXXFLAGS="${CXXFLAGS:=}"
30 LDFLAGS="${LDFLAGS:=}"
31
32 dnl Checks for programs...
33 AC_PROG_AWK
34 AC_PROG_CC
35 AC_PROG_CXX
36 AC_PROG_CPP
37 AC_PROG_INSTALL
38 if test "$INSTALL" = "$ac_install_sh"; then
39 # Use full path to install-sh script...
40 INSTALL="`pwd`/install-sh -c"
41 fi
42 AC_PROG_RANLIB
43 AC_PATH_PROG(AR,ar)
44 AC_PATH_PROG(HTMLDOC,htmldoc)
45 AC_PATH_PROG(MV,mv)
46 AC_PATH_PROG(NROFF,nroff)
47 if test "$NROFF" = ""; then
48 AC_PATH_PROG(GROFF,groff)
49 if test "$GROFF" = ""; then
50 NROFF="echo"
51 else
52 NROFF="$GROFF -T ascii"
53 fi
54 fi
55 AC_PATH_PROG(RM,rm)
56 AC_PATH_PROG(SED,sed)
57
58 dnl Architecture checks...
59 AC_C_BIGENDIAN
60
61 dnl Check for libraries...
62 AC_CHECK_LIB(c,crypt,LIBS="$LIBS")
63 if test "$ac_cv_lib_c_crypt" = "no"; then
64 AC_CHECK_LIB(crypt,crypt)
65 fi
66 AC_CHECK_LIB(sec,getspent)
67 AC_CHECK_LIB(gen,getspent)
68
69 LIBMALLOC=""
70 AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
71 if test "$ac_cv_lib_c_mallinfo" = "no"; then
72 AC_CHECK_LIB(malloc,mallinfo,
73 LIBS="$LIBS"
74 LIBMALLOC="-lmalloc"
75 AC_DEFINE(HAVE_MALLINFO),
76 LIBS="$LIBS")
77 fi
78 AC_SUBST(LIBMALLOC)
79
80 dnl Checks for header files.
81 AC_HEADER_STDC
82 AC_HEADER_DIRENT
83 AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
84 AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
85 AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
86 AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
87 AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
88 AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
89 AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
90
91 dnl Checks for string functions.
92 AC_CHECK_FUNCS(strdup strcasecmp strncasecmp)
93 if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
94 echo Forcing snprintf emulation for HP-UX.
95 else
96 AC_CHECK_FUNCS(snprintf vsnprintf)
97 fi
98
99 dnl Check OS version and use appropriate format string for strftime...
100 AC_MSG_CHECKING(for correct format string to use with strftime)
101
102 case "$uname" in
103 IRIX* | SunOS*)
104 # IRIX and SunOS
105 AC_MSG_RESULT(NULL)
106 AC_DEFINE(CUPS_STRFTIME_FORMAT, NULL)
107 ;;
108 *)
109 # All others
110 AC_MSG_RESULT("%c")
111 AC_DEFINE(CUPS_STRFTIME_FORMAT, "%c")
112 ;;
113 esac
114
115 dnl Checks for mkstemp and mkstemps functions.
116 AC_CHECK_FUNCS(mkstemp mkstemps)
117
118 dnl Checks for vsyslog function.
119 AC_CHECK_FUNCS(vsyslog)
120
121 dnl Checks for signal functions.
122 if test "$uname" != "Linux"; then
123 AC_CHECK_FUNCS(sigset)
124 fi
125
126 AC_CHECK_FUNCS(sigaction)
127
128 dnl Checks for wait functions.
129 AC_CHECK_FUNCS(waitpid)
130 AC_CHECK_FUNCS(wait3)
131
132 dnl See if the tm structure has the tm_gmtoff member...
133 AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
134 AC_TRY_COMPILE([#include <time.h>],[struct tm t;
135 int o = t.tm_gmtoff;],
136 AC_MSG_RESULT(yes)
137 AC_DEFINE(HAVE_TM_GMTOFF),
138 AC_MSG_RESULT(no))
139
140 dnl Flags for "ar" command...
141 case $uname in
142 Darwin* | *BSD*)
143 ARFLAGS="-rcv"
144 ;;
145 *)
146 ARFLAGS="crvs"
147 ;;
148 esac
149
150 AC_SUBST(ARFLAGS)
151
152 dnl
153 dnl End of "$Id: cups-common.m4,v 1.12 2001/11/02 17:34:54 mike Exp $".
154 dnl