]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-common.m4
Add strlcat() and strlcpy() checks and emulation functions.
[thirdparty/cups.git] / config-scripts / cups-common.m4
1 dnl
2 dnl "$Id: cups-common.m4,v 1.17 2002/05/16 13:44:53 mike Exp $"
3 dnl
4 dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2002 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 dnl We need at least autoconf 2.13...
26 AC_PREREQ(2.13)
27
28 dnl Set the name of the config header file...
29 AC_CONFIG_HEADER(config.h)
30
31 dnl Default compiler flags...
32 CFLAGS="${CFLAGS:=}"
33 CPPFLAGS="${CPPFLAGS:=}"
34 CXXFLAGS="${CXXFLAGS:=}"
35 LDFLAGS="${LDFLAGS:=}"
36
37 dnl Checks for programs...
38 AC_PROG_AWK
39 AC_PROG_CC
40 AC_PROG_CXX
41 AC_PROG_CPP
42 AC_PROG_INSTALL
43 if test "$INSTALL" = "$ac_install_sh"; then
44 # Use full path to install-sh script...
45 INSTALL="`pwd`/install-sh -c"
46 fi
47 AC_PROG_RANLIB
48 AC_PATH_PROG(AR,ar)
49 AC_PATH_PROG(HTMLDOC,htmldoc)
50 AC_PATH_PROG(MV,mv)
51 AC_PATH_PROG(NROFF,nroff)
52 if test "$NROFF" = ""; then
53 AC_PATH_PROG(GROFF,groff)
54 if test "$GROFF" = ""; then
55 NROFF="echo"
56 else
57 NROFF="$GROFF -T ascii"
58 fi
59 fi
60 AC_PATH_PROG(RM,rm)
61 AC_PATH_PROG(SED,sed)
62 AC_PATH_PROG(STRIP,strip)
63
64 dnl Architecture checks...
65 AC_C_BIGENDIAN
66
67 dnl Check for libraries...
68 AC_SEARCH_LIBS(crypt, crypt)
69 AC_SEARCH_LIBS(getspent, sec gen)
70
71 LIBMALLOC=""
72 AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
73 if test "$ac_cv_lib_c_mallinfo" = "no"; then
74 AC_CHECK_LIB(malloc,mallinfo,
75 LIBS="$LIBS"
76 LIBMALLOC="-lmalloc"
77 AC_DEFINE(HAVE_MALLINFO),
78 LIBS="$LIBS")
79 fi
80 AC_SUBST(LIBMALLOC)
81
82 dnl Checks for header files.
83 AC_HEADER_STDC
84 AC_HEADER_DIRENT
85 AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
86 AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
87 AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
88 AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
89 AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
90 AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
91 AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
92
93 dnl Checks for string functions.
94 AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
95 if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
96 echo Forcing snprintf emulation for HP-UX.
97 else
98 AC_CHECK_FUNCS(snprintf vsnprintf)
99 fi
100
101 dnl Check OS version and use appropriate format string for strftime...
102 AC_MSG_CHECKING(for correct format string to use with strftime)
103
104 case "$uname" in
105 IRIX* | SunOS*)
106 # IRIX and SunOS
107 AC_MSG_RESULT(NULL)
108 AC_DEFINE(CUPS_STRFTIME_FORMAT, NULL)
109 ;;
110 *)
111 # All others
112 AC_MSG_RESULT("%c")
113 AC_DEFINE(CUPS_STRFTIME_FORMAT, "%c")
114 ;;
115 esac
116
117 dnl Checks for mkstemp and mkstemps functions.
118 AC_CHECK_FUNCS(mkstemp mkstemps)
119
120 dnl Checks for vsyslog function.
121 AC_CHECK_FUNCS(vsyslog)
122
123 dnl Checks for signal functions.
124 if test "$uname" != "Linux"; then
125 AC_CHECK_FUNCS(sigset)
126 fi
127
128 AC_CHECK_FUNCS(sigaction)
129
130 dnl Checks for wait functions.
131 AC_CHECK_FUNCS(waitpid)
132 AC_CHECK_FUNCS(wait3)
133
134 dnl See if the tm structure has the tm_gmtoff member...
135 AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
136 AC_TRY_COMPILE([#include <time.h>],[struct tm t;
137 int o = t.tm_gmtoff;],
138 AC_MSG_RESULT(yes)
139 AC_DEFINE(HAVE_TM_GMTOFF),
140 AC_MSG_RESULT(no))
141
142 dnl Flags for "ar" command...
143 case $uname in
144 Darwin* | *BSD*)
145 ARFLAGS="-rcv"
146 ;;
147 *)
148 ARFLAGS="crvs"
149 ;;
150 esac
151
152 AC_SUBST(ARFLAGS)
153
154 dnl
155 dnl End of "$Id: cups-common.m4,v 1.17 2002/05/16 13:44:53 mike Exp $".
156 dnl