fi
])
-dnl ---------------------------------------------------------------------------
-dnl WX_CPP_SIZE_T_IS_NOT_INT checks whether size_t and int are different types,
-dnl i.e. whether we may overload operator[] on its argument type
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN(WX_CPP_SIZE_T_IS_NOT_INT,
-[
- AC_CACHE_CHECK([if size_t and int are different types], wx_cv_cpp_sizet_not_int,
- [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
- AC_TRY_RUN([
- #include <stdlib.h>
-
- class S
- {
- public:
- S(char *s) { m_s = s; }
-
- char operator[](size_t n) const { return m_s[n]; }
- char operator[](int n) const { return m_s[n]; }
-
- private:
- char *m_s;
- };
-
- int main()
- {
- S s("dummy");
- size_t n1 = 2;
- int n2 = 3;
-
- return s[n1] == s[n2];
- }
- ],
- AC_DEFINE(wxUSE_SIZE_T_STRING_OPERATOR) wx_cv_cpp_sizet_not_int=yes,
- wx_cv_cpp_sizet_not_int=no,
- wx_cv_cpp_sizet_not_int=no
- )
-
- AC_LANG_RESTORE
- ])
-])
-
dnl ---------------------------------------------------------------------------
dnl a slightly better AC_C_BIGENDIAN macro which allows cross-compiling
dnl ---------------------------------------------------------------------------
dnl notice that /usr/include should not be in this list, otherwise it breaks
dnl compilation on Solaris/gcc because standard headers are included instead
-dnl of the gcc ones
+dnl of the gcc ones (correction: it *is* needed for broken AIX compiler - but
+dnl do put it last!)
+dnl
+dnl Also try to put all directories which may contain X11R6 before those which
+dnl may contain X11R5/4 - we want to use R6 on machines which have both!
SEARCH_INCLUDE="\
/usr/local/include \
\
\
/usr/Motif1.2/include \
/usr/dt/include \
+ /usr/openwin/include \
+ \
/usr/include/Xm \
\
/usr/X11R6/include \
+ /usr/X11R6.4/include \
/usr/X11R5/include \
/usr/X11R4/include \
\
- /usr/X11R6/lib \
- /usr/X11R5/lib \
- /usr/X11R4/lib \
- \
/usr/include/X11R6 \
/usr/include/X11R5 \
/usr/include/X11R4 \
/usr/local/x11r5/include \
/usr/lpp/Xamples/include \
\
- /usr/openwin/include \
/usr/openwin/share/include \
-"
+ \
+ /usr/include"
SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` "
AC_MSG_WARN(library will be compiled without support for images in XPM format)
fi
- GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXt -lX11 -lm"
+ GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXext -lXt -lX11 -lm"
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
TOOLKIT=MOTIF
dnl check whether C++ compiler supports bool built-in type
WX_CPP_BOOL
-dnl check whether overloading on size_t/int parameter works
-WX_CPP_SIZE_T_IS_NOT_INT
-
dnl check whether we should define _GNU_SOURCE
WX_GNU_EXTENSIONS
dnl check for MT-safe version of strtok
AC_CHECK_FUNCS(strtok_r)
-dnl check for inet_addr, inet_aton, ...
-AC_CHECK_FUNCS(inet_addr)
-AC_CHECK_FUNCS(inet_aton)
-AC_CHECK_LIB(resolv, inet_aton)
+dnl check for inet_addr and inet_aton (these may live either in libc, or in
+dnl libnsl or libresolv)
+INET_LINK=
+AC_CHECK_FUNCS(inet_addr,
+ AC_DEFINE(HAVE_INET_ADDR),
+ [
+ AC_CHECK_LIB(nsl, inet_addr,
+ INET_LINK="nsl",
+ AC_CHECK_LIB(resolv, inet_addr,
+ INET_LINK="resolv"
+ )
+ )
+ ]
+)
+
+AC_CHECK_FUNCS(inet_aton,
+ AC_DEFINE(HAVE_INET_ATON),
+ [
+ dnl only check it in the same lib
+ AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON))
+ ])
+
+if test "x$INET_LINK" != "x"; then
+ AC_DEFINE(HAVE_INET_ADDR)
+ INET_LINK="-l$INET_LINK"
+fi
fi
dnl Unix
AC_DEFINE(wxUSE_APPLE_IEEE)
fi
-if test "$wxUSE_TIMEDATE" = "yes"; then
- AC_DEFINE(wxUSE_TIMEDATE)
- SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
-fi
-
if test "$wxUSE_WAVE" = "yes"; then
AC_DEFINE(wxUSE_WAVE)
fi
AC_DEFINE(wxUSE_LONGLONG)
fi
-if test "$wxUSE_SOCKETS" = "yes" ; then
- AC_DEFINE(wxUSE_SOCKETS)
- SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wxsocket"
- INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS protocol"
-fi
-
if test "$wxUSE_DIALUP_MANAGER" = "yes" ; then
AC_DEFINE(wxUSE_DIALUP_MANAGER)
fi
AC_DEFINE(wxUSE_SERIAL)
fi
+dnl ------------------------------------------------------------------------
+dnl time/date functions
+dnl ------------------------------------------------------------------------
+
+if test "$wxUSE_TIMEDATE" = "yes"; then
+ AC_CHECK_FUNCS(gettimeofday localtime ftime)
+
+ if test "$ac_cv_func_gettimeofday" = "yes"; then
+ AC_CACHE_CHECK([whether gettimeofday takes two arguments],
+ wx_cv_func_gettimeofday_has_2_args,
+ [
+ dnl on some _really_ old systems it takes only 1 argument
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ AC_TRY_COMPILE(
+ [
+ #include <sys/time.h>
+ #include <unistd.h>
+ ],
+ [
+ struct timeval tv;
+ struct timezone tz;
+ gettimeofday(&tv, &tz);
+ ],
+ wx_cv_func_gettimeofday_has_2_args=yes,
+ AC_TRY_COMPILE(
+ [
+ #include <sys/time.h>
+ #include <unistd.h>
+ ],
+ [
+ struct timeval tv;
+ gettimeofday(&tv);
+ ],
+ wx_cv_func_gettimeofday_has_2_args=no,
+ wx_cv_func_gettimeofday_has_2_args=unknown
+ )
+ )
+ AC_LANG_RESTORE
+ ])
+
+ if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
+ AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ)
+ fi
+ fi
+
+ AC_DEFINE(wxUSE_TIMEDATE)
+ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
+fi
+
dnl ------------------------------------------------------------------------
dnl wxSocket
dnl ------------------------------------------------------------------------
if test "$wxUSE_SOCKETS" = "yes"; then
+ dnl under Solaris, socket functions live in -lsocket
+ AC_CHECK_FUNC(socket,,
+ AC_CHECK_LIB(socket, socket,
+ INET_LINK="$INET_LINK -lsocket",
+ [
+ AC_MSG_WARN([socket library not found - sockets will be disabled])
+ wxUSE_SOCKETS=no
+ ]
+ )
+ )
+fi
+
+if test "$wxUSE_SOCKETS" = "yes" ; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
dnl determine the type of third argument for getsockname
[#include <sys/socket.h>],
[int len; getsockname(0, 0, &len);],
AC_DEFINE(SOCKLEN_T, int) AC_MSG_RESULT(int),
- AC_MSG_RESULT(unknown)
- )
+ AC_MSG_RESULT(unknown)
+ )
)
)
AC_LANG_RESTORE
+
+ AC_DEFINE(wxUSE_SOCKETS)
+ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wxsocket"
+ INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS protocol"
fi
dnl ---------------------------------------------------------------------------
GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK"
dnl all additional libraries (except wxWindows itself) we link with
-EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $DL_LINK"
+EXTRA_LIBS="$LIBS $POSIX4_LINK $INET_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $DL_LINK"
if test "$wxUSE_GUI" = "yes"; then
EXTRA_LIBS="$EXTRA_LIBS $GUILIBS"
fi
if test ! -d include/wx/${TOOLKIT_DIR}; then
mkdir include/wx/${TOOLKIT_DIR}
fi
- mv -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
+ if test -f setup.h; then
+ mv -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
+ fi
],
[
TOOLKIT_DIR="${TOOLKIT_DIR}"