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 # ===========================================================================
98 AC_CHECK_LIB(socket,socket)
99 AC_CHECK_LIB(nsl,xdr_short)
100 AC_CHECK_LIB(panel,panel_above,
103 CURSES_LIBS="-lpanel -lcurses"
106 AC_CHECK_LIB(curses,nl,
108 CURSES_LIBS="-lcurses"
115 AC_SUBST(CURSES_LIBS)
118 AC_CHECK_FUNCS(vsnprintf vasprintf)
119 AC_CHECK_FUNCS(strlen strcpy strcat strstr strcmp strerror strtok strdup)
120 AC_CHECK_FUNCS(strchr memcpy)
121 dnl AC_CHECK_FUNCS(getline)
122 dnl AC_CHECK_FUNCS(getdelim)
123 AC_CHECK_FUNCS(fgets)
124 AC_CHECK_FUNCS(yylex)
126 AC_CACHE_CHECK(whether scanf knows %a, s51_cv_scanf_a,
127 [echo "a b" >conftest.data
135 if ((f= fopen("conftest.data", "r")) == NULL)
137 i= fscanf(f, " %a[a-z] ", &a);
145 s51_cv_scanf_a="yes",
147 s51_cv_scanf_a="unknown")
149 if test "$s51_cv_scanf_a" = "yes"; then
153 AC_CACHE_CHECK(whether getcwd is GNUish, s51_cv_getcwd,
158 if ((getcwd(NULL, 0)) == NULL)
164 s51_cv_getcwd="unknown")
166 if test "$s51_cv_getcwd" = "yes"; then
167 AC_DEFINE(GNU_GETCWD)
174 # DD_COPT macro checks if the compiler specified as the 1st parameter
175 # supports option specified as the 2nd parameter
176 # For example: DD_CPORT(CXX, fPIC)
179 AC_CACHE_CHECK(whether $$1 accepts -$2,s51_cv_$1$2,
184 $$1 -v -$2 -c _test_.c 1>&5 2>&5
185 if test "$?" = "0"; then
190 rm -f _test_.* a.out)
194 # Checking characteristics of compilers and other programs
195 # --------------------------------------------------------
197 AC_CACHE_CHECK(whether preprocessor accepts -MM or -M,s51_cv_MM,
198 echo "#include <stdio.h>" >_test_.c
200 $CXXCPP -v -MM _test_.c 1>&5 2>&5
201 if test "$?" = "0"; then
210 # This is the first time when CFLAGS are set/modified!!
213 if test "$s51_cv_CXXggdb" = "yes"; then
214 if test "$CXXFLAGS"x = x ;then
217 CXXFLAGS="$CXXFLAGS -ggdb"
222 if test "$s51_cv_CXXpipe" = "yes"; then
223 CXXFLAGS="$CXXFLAGS -pipe"
227 # Checks for typedefs, structures, and compiler characteristics.
228 # ===========================================================================
231 AC_CHECK_SIZEOF(char)
232 AC_CHECK_SIZEOF(short)
234 AC_CHECK_SIZEOF(long)
235 AC_CHECK_SIZEOF(long long)
239 if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
243 if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
247 if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
251 if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
255 if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
262 AC_MSG_CHECKING(type name for byte)
263 TYPE_BYTE=`type_name 1`
264 AC_MSG_RESULT($TYPE_BYTE)
265 AC_MSG_CHECKING(type name for word)
266 TYPE_WORD=`type_name 2`
267 AC_MSG_RESULT($TYPE_WORD)
268 AC_MSG_CHECKING(type name for dword)
269 TYPE_DWORD=`type_name 4`
270 AC_MSG_RESULT($TYPE_DWORD)
271 AC_DEFINE_UNQUOTED(TYPE_BYTE, $TYPE_BYTE)
272 AC_DEFINE_UNQUOTED(TYPE_WORD, $TYPE_WORD)
273 AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD)
275 # Generating output files
276 # ===========================================================================
278 AC_OUTPUT(main.mk:main_in.mk
285 gui.src/serio.src/Makefile
286 gui.src/portmon.src/Makefile
291 # End of configure/configure.in