4 AC_CONFIG_HEADER(ddconfig.h:ddconfig_in.h)
8 AC_MSG_CHECKING(version of the package)
9 if test -f .version; then
10 VERSION=`cat .version`
11 AC_MSG_RESULT($VERSION)
14 AC_MSG_RESULT(unknown using 0.0.0)
16 VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
17 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
18 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
23 AC_DEFINE_UNQUOTED(VERSIONSTR, "${VERSION}")
24 AC_DEFINE_UNQUOTED(VERSIONHI, $VERSIONHI)
25 AC_DEFINE_UNQUOTED(VERSIONLO, $VERSIONLO)
26 AC_DEFINE_UNQUOTED(VERSIONP, $VERSIONP)
38 # Checking for header files.
39 # ===========================================================================
41 if test -d /stuff/include; then
42 CPPFLAGS="$CPPFLAGS -I/stuff/include"
46 AC_CHECK_HEADERS(getopt.h)
47 AC_CHECK_HEADERS(unistd.h)
48 AC_CHECK_HEADER(sys/socket.h,
49 AC_DEFINE(SOCKET_AVAIL)
50 AC_DEFINE(HAVE_SYS_SOCKET_H))
53 # This must be after CXXCPP
55 AC_CACHE_CHECK(which header file defines FD_ macros, s51_cv_fd,
61 #endif], s51_cv_fd="<sys/time.h>")
63 #include <sys/types.h>
66 #endif], s51_cv_fd="<sys/types.h>")
68 #include <sys/select.h>
71 #endif], s51_cv_fd="<sys/types.h>")])
73 AC_DEFINE(FD_HEADER_OK, 0)
74 if echo $s51_cv_fd|grep time >/dev/null 2>&1; then
75 AC_DEFINE(FD_NEED_TIME_H, 1)
76 AC_DEFINE(FD_HEADER_OK, 1)
78 AC_DEFINE(FD_NEED_TIME_H, 0)
80 if echo $s51_cv_fd|grep types >/dev/null 2>&1; then
81 AC_DEFINE(FD_NEED_TYPES_H, 1)
82 AC_DEFINE(FD_HEADER_OK, 1)
84 AC_DEFINE(FD_NEED_TYPES_H, 0)
86 if echo $s51_cv_fd|grep select >/dev/null 2>&1; then
87 AC_DEFINE(FD_NEED_SELECT_H, 1)
88 AC_DEFINE(FD_HEADER_OK, 1)
90 AC_DEFINE(FD_NEED_SELECT_H, 0)
93 AC_DEFINE_UNQUOTED(HEADER_FD, ${s51_cv_fd})
96 # Checking for functions/libs
97 # ===========================================================================
99 AC_DEFUN(AC_CHECK_FUNC_NOCACHE,
100 [AC_MSG_CHECKING([for $1])
102 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
103 dnl which includes <sys/select.h> which contains a prototype for
104 dnl select. Similarly for bzero.
105 [/* System header to define __stub macros and hopefully few prototypes,
106 which can conflict with char $1(); below. */
108 /* Override any gcc2 internal prototype to avoid an error. */
109 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
113 [/* We use char because int might match the return type of a gcc2
114 builtin and then its argument prototype would still apply. */
117 /* The GNU C library defines this for functions which it implements
118 to always fail with ENOSYS. Some functions are actually named
119 something starting with __ and the normal name is an alias. */
120 #if defined (__stub_$1) || defined (__stub___$1)
125 ], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")
126 if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
128 ifelse([$2], , :, [$2])
136 AC_CHECK_LIB(socket,socket)
137 AC_CHECK_LIB(nsl,xdr_short)
138 AC_CHECK_LIB(panel,panel_above,
141 CURSES_LIBS="-lpanel -lcurses"
144 AC_CHECK_LIB(curses,nl,
146 CURSES_LIBS="-lcurses"
153 AC_SUBST(CURSES_LIBS)
156 dnl Do not cache the result of the vasprintf test.
157 dnl This is because vasprintf is defined in the C++ runtime
158 dnl for egcs, but not in the C runtime. Thus, caching the result
159 dnl of this test (which is done with C++) will cause later C
160 dnl based tests to falsely conclude that vasprintf is available
162 dnl It's a bloody stupid function anyway.
163 AC_CHECK_FUNC_NOCACHE(vasprintf)
164 AC_CHECK_FUNCS(strlen strcpy strcat strstr strcmp strerror strtok strdup)
165 AC_CHECK_FUNCS(vsnprintf strchr memcpy)
166 dnl AC_CHECK_FUNCS(getline)
167 dnl AC_CHECK_FUNCS(getdelim)
168 AC_CHECK_FUNCS(fgets)
169 AC_CHECK_FUNCS(yylex)
171 AC_CACHE_CHECK(whether scanf knows %a, s51_cv_scanf_a,
172 [echo "a b" >conftest.data
180 if ((f= fopen("conftest.data", "r")) == NULL)
182 i= fscanf(f, " %a[a-z] ", &a);
190 s51_cv_scanf_a="yes",
192 s51_cv_scanf_a="unknown")
194 if test "$s51_cv_scanf_a" = "yes"; then
198 AC_CACHE_CHECK(whether getcwd is GNUish, s51_cv_getcwd,
203 if ((getcwd(NULL, 0)) == NULL)
209 s51_cv_getcwd="unknown")
211 if test "$s51_cv_getcwd" = "yes"; then
212 AC_DEFINE(GNU_GETCWD)
219 # DD_COPT macro checks if the compiler specified as the 1st parameter
220 # supports option specified as the 2nd parameter
221 # For example: DD_CPORT(CXX, fPIC)
224 AC_CACHE_CHECK(whether $$1 accepts -$2,s51_cv_$1$2,
229 $$1 -v -$2 -c _test_.c 1>&5 2>&5
230 if test "$?" = "0"; then
235 rm -f _test_.* a.out)
239 # Checking characteristics of compilers and other programs
240 # --------------------------------------------------------
242 AC_CACHE_CHECK(whether preprocessor accepts -MM or -M,s51_cv_MM,
243 echo "#include <stdio.h>" >_test_.c
245 $CXXCPP -v -MM _test_.c 1>&5 2>&5
246 if test "$?" = "0"; then
255 # This is the first time when CFLAGS are set/modified!!
258 if test "$s51_cv_CXXggdb" = "yes"; then
259 if test "$CXXFLAGS"x = x ;then
262 CXXFLAGS="$CXXFLAGS -ggdb"
267 if test "$s51_cv_CXXpipe" = "yes"; then
268 CXXFLAGS="$CXXFLAGS -pipe"
272 # Checks for typedefs, structures, and compiler characteristics.
273 # ===========================================================================
276 AC_CHECK_SIZEOF(char)
277 AC_CHECK_SIZEOF(short)
279 AC_CHECK_SIZEOF(long)
280 AC_CHECK_SIZEOF(long long)
284 if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
288 if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
292 if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
296 if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
300 if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
307 AC_MSG_CHECKING(type name for byte)
308 TYPE_BYTE=`type_name 1`
309 AC_MSG_RESULT($TYPE_BYTE)
310 AC_MSG_CHECKING(type name for word)
311 TYPE_WORD=`type_name 2`
312 AC_MSG_RESULT($TYPE_WORD)
313 AC_MSG_CHECKING(type name for dword)
314 TYPE_DWORD=`type_name 4`
315 AC_MSG_RESULT($TYPE_DWORD)
316 AC_DEFINE_UNQUOTED(TYPE_BYTE, $TYPE_BYTE)
317 AC_DEFINE_UNQUOTED(TYPE_WORD, $TYPE_WORD)
318 AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD)
320 # Generating output files
321 # ===========================================================================
323 AC_OUTPUT(main.mk:main_in.mk
330 gui.src/serio.src/Makefile
331 gui.src/portmon.src/Makefile
336 # End of configure/configure.in