AC_CHECK_HEADERS(iostream)
- if test "x$HAVE_IOSTREAM" = x ; then
- ifelse([$2], , :, [$2])
- else
+ if test "$ac_cv_header_iostream" = "yes" ; then
ifelse([$1], , :, [$1])
+ else
+ ifelse([$2], , :, [$2])
fi
AC_LANG_RESTORE
return 0;
],
[
- AC_DEFINE(HAVE_BOOL)
wx_cv_cpp_bool=yes
],
[
dnl usage: WX_ARG_SYS_WITH(option, helpmessage, variable-name)
AC_DEFUN(WX_ARG_SYS_WITH,
[
- AC_MSG_CHECKING("for --with-$1")
+ AC_MSG_CHECKING([for --with-$1])
no_cache=0
AC_ARG_WITH($1, $2,
[
dnl usage: WX_ARG_WITH(option, helpmessage, variable-name)
AC_DEFUN(WX_ARG_WITH,
[
- AC_MSG_CHECKING("for --with-$1")
+ AC_MSG_CHECKING([for --with-$1])
no_cache=0
AC_ARG_WITH($1, $2,
[
dnl usage: WX_ARG_ENABLE(option, helpmessage, variable-name)
AC_DEFUN(WX_ARG_ENABLE,
[
- AC_MSG_CHECKING("for --enable-$1")
+ AC_MSG_CHECKING([for --enable-$1])
no_cache=0
AC_ARG_ENABLE($1, $2,
[
echo "$var=$value" >> ${wx_arg_cache_file}
fi
if test "$value" = 1; then
- AC_MSG_RESULT(`echo $toolkit | tr [[A-Z]] [[a-z]]`)
+ AC_MSG_RESULT([`echo $toolkit | tr [[A-Z]] [[a-z]]`])
fi
fi
done
AC_CHECK_PROG(STRIP, strip, strip, true)
dnl check if VPATH works
-AC_MSG_CHECKING("make for VPATH support")
+AC_MSG_CHECKING([make for VPATH support])
dnl create Makefile
cat - << EOF > confMake
check : file
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(
+ AC_MSG_ERROR([
You need a make-utility that is able to use the variable
VPATH correctly.
If your version of make does not support VPATH correctly,
setenv MAKE gmake; ./configure for csh-type shells
Also please do remember to use gmake in this case every time
you are trying to compile.
-)
+])
fi
dnl YACC checks
WX_ALL="CREATE_LINKS"
fi
dnl add the resources target
- WX_ALL="${WX_ALL} ./lib/lib${WX_LIBRARY}-${WX_RELEASE}.${WX_CURRENT}.r"
+ WX_ALL="${WX_ALL} ./lib/lib${WX_LIBRARY}-${WX_RELEASE}.r"
dnl the name of the shared library
- WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}-${WX_RELEASE}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}.dylib"
- WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY}_gl-${WX_RELEASE}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}.dylib"
+ WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}-${WX_RELEASE}.dylib.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
+ WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY}_gl-${WX_RELEASE}.dylib.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
dnl the name of the links to the shared library
- WX_LIBRARY_LINK1="lib${WX_LIBRARY}-${WX_RELEASE}.${WX_CURRENT}.dylib"
+ WX_LIBRARY_LINK1="lib${WX_LIBRARY}-${WX_RELEASE}.dylib.${WX_CURRENT}"
WX_LIBRARY_LINK2="lib${WX_LIBRARY}-${WX_RELEASE}.dylib"
WX_LIBRARY_LINK3="lib${WX_LIBRARY}.dylib"
- WX_LIBRARY_LINK1_GL="lib${WX_LIBRARY}_gl-${WX_RELEASE}.${WX_CURRENT}.dylib"
+ WX_LIBRARY_LINK1_GL="lib${WX_LIBRARY}_gl-${WX_RELEASE}.dylib.${WX_CURRENT}"
WX_LIBRARY_LINK2_GL="lib${WX_LIBRARY}_gl-${WX_RELEASE}.dylib"
WX_LIBRARY_LINK3_GL="lib${WX_LIBRARY}_gl.dylib"
;;
dnl defines HAVE_STRINGS_H (where some string functions live on AIX for example)
AC_CHECK_HEADERS(strings.h)
+dnl defines HAVE_STDLIB_H
+AC_CHECK_HEADERS(stdlib.h)
dnl defines HAVE_UNISTD_H
AC_CHECK_HEADERS(unistd.h)
dnl defines HAVE_WCHAR_H
[
AC_TRY_COMPILE([#include <wchar.h>],
[
- wchar_t wc, *ws;
- wc = L'a';
- ws = L"Hello, world!";
+ wchar_t wc, *ws;
+ wc = L'a';
+ ws = L"Hello, world!";
],
- wx_cv_type_wchar_t=yes,
- wx_cv_type_wchar_t=no)
+ wx_cv_type_wchar_t=yes,
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [
+ wchar_t wc, *ws;
+ wc = L'a';
+ ws = L"Hello, world!";
+ ],
+ wx_cv_type_wchar_t=yes,
+ wx_cv_type_wchar_t=no)
+ )
])
-if test "$wx_cv_type_wchar_t" = yes ; then
+
+if test "$wx_cv_type_wchar_t" = "yes"; then
AC_DEFINE(wxUSE_WCHAR_T)
fi
+dnl check what exactly size_t is on this machine - this is necessary to avoid
+dnl ambiguos overloads in several places, notably wx/string.h and wx/array.h
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_CACHE_CHECK([if size_t is unsigned int],
+ wx_cv_size_t_is_uint,
+ dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work
+ dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate
+ dnl methods in a local class (i.e. class inside a function) declaration
+ dnl without any objections!!
+ dnl
+ dnl hence the hack below: we must have Foo at global scope!
+ AC_TRY_COMPILE([#include <stddef.h>],
+ [
+ return 0; }
+
+ struct Foo { void foo(size_t); void foo(unsigned int); };
+
+ int bar() {
+ ],
+ wx_cv_size_t_is_uint=no,
+ wx_cv_size_t_is_uint=yes
+ )
+)
+
+if test "$wx_cv_size_t_is_uint" = "yes"; then
+ AC_DEFINE(wxSIZE_T_IS_UINT)
+else
+ AC_CACHE_CHECK([if size_t is unsigned long],
+ wx_cv_size_t_is_ulong,
+ AC_TRY_COMPILE([#include <stddef.h>],
+ [
+ return 0; }
+
+ struct Foo { void foo(size_t); void foo(unsigned long); };
+
+ int bar() {
+ ],
+ wx_cv_size_t_is_ulong=no,
+ wx_cv_size_t_is_ulong=yes
+ )
+ )
+
+ if test "$wx_cv_size_t_is_ulong" = "yes"; then
+ AC_DEFINE(wxSIZE_T_IS_ULONG)
+ fi
+fi
+
+AC_LANG_RESTORE
+
dnl ---------------------------------------------------------------------------
dnl Checks for structures
dnl ---------------------------------------------------------------------------
dnl we have to do it ourselves because SGI/Irix's stdio.h does not include
dnl wchar_t an AC_CHECK_SIZEOF only includes stdio.h
+dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
AC_CACHE_CHECK([size of wchar_t], wx_cv_sizeof_wchar_t,
[
AC_TRY_RUN(
[
- #include <wchar.h>
+ #ifdef HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+ #ifdef HAVE_STDLIB_H
+ # include <stdlib.h>
+ #endif
#include <stdio.h>
int main()
{
AC_DEFINE(HAVE_VSSCANF)
fi
-AC_LANG_RESTORE
-
dnl the following tests are for Unix(like) systems only
if test "$TOOLKIT" != "MSW"; then
AC_TRY_COMPILE([#include <iconv.h>],
[
char **inbuf, **outbuf;
- iconv_t cd;
- size_t insz, outsz;
- iconv(cd, inbuf, &insz, outbuf, &outsz);
+ iconv_t cd;
+ size_t insz, outsz;
+ iconv(cd, inbuf, &insz, outbuf, &outsz);
],
wx_cv_iconv_takes_char=yes,
wx_cv_iconv_takes_char=no)
dnl AIX calls the library libpthreads - thanks IBM!
if test "$USE_AIX" = 1; then
THREADS_LIB=pthreads
- elif test "$USE_MAC" = 1; then
- THREADS_LIB=cc_dynamic
else
THREADS_LIB=pthread
fi
THREADS_OBJ="threadpsx.lo"
THREADS_LINK="c_r"
], [
- dnl thread functions are in libcc_dynamic under Mac OS X/Darwin
- AC_CHECK_LIB(cc_dynamic, pthread_create, [
- THREADS_OBJ="threadpsx.lo"
- THREADS_LINK="cc_dynamic"
- ], [
- dnl VZ: SGI threads are not supported currently
- AC_CHECK_HEADER(sys/prctl.h, [
- THREADS_OBJ="threadsgi.lo"
- ])
+ dnl VZ: SGI threads are not supported currently
+ AC_CHECK_HEADER(sys/prctl.h, [
+ THREADS_OBJ="threadsgi.lo"
])
])
])
dnl [
dnl AC_CHECK_LIB($THREADS_LINK, $1,
dnl AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'),
- dnl [AC_CHECK_LIB("posix4", $1,
+ dnl [AC_CHECK_LIB([posix4], $1,
dnl [AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'))
dnl POSIX4_LINK="-lposix4"
dnl ])
AC_CHECK_LIB($THREADS_LINK, sched_yield,
AC_DEFINE(HAVE_SCHED_YIELD),
- [AC_CHECK_LIB("posix4", sched_yield,
+ [AC_CHECK_LIB([posix4], sched_yield,
[AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK="-lposix4"],
AC_MSG_WARN(wxThread::Yield will not work properly)
)]
AC_CHECK_LIB($THREADS_LINK, pthread_attr_setschedparam,
AC_CHECK_LIB($THREADS_LINK, sched_get_priority_max,
HAVE_PRIOR_FUNCS=1,
- AC_CHECK_LIB("posix4", sched_get_priority_max,
+ AC_CHECK_LIB([posix4], sched_get_priority_max,
[
HAVE_PRIOR_FUNCS=1
POSIX4_LINK="-lposix4"
if test "$wxUSE_MAC" = 1 ; then
TOOLKIT_DEF="${TOOLKIT_DEF} -D__UNIX__ -D__POWERPC__ -DTARGET_CARBON"
CFLAGS="${CFLAGS} -fno-common -fpascal-strings"
- CPPFLAGS="${CPPFLAGS} -fno-common -fpascal-strings"
+ CPPFLAGS="${CPPFLAGS} -cpp-precomp -fno-common -fpascal-strings"
AC_CHECK_PROG(REZ, Rez, Rez, /Developer/Tools/Rez)
AC_CHECK_PROG(DEREZ, Derez, Derez, /Developer/Tools/Derez)
RESCOMP=${REZ}
],
[
wx_cv_struct_tm_has_gmtoff=yes
- AC_DEFINE(WX_GMTOFF_IN_TM)
],
wx_cv_struct_tm_has_gmtoff=no
)
])
fi
+ if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then
+ AC_DEFINE(WX_GMTOFF_IN_TM)
+ fi
+
dnl check for gettimeofday (SVr4, BSD 4.3) and ftime (V7, BSD 4.3) for the
dnl function to be used for high resolution timers
AC_CHECK_FUNCS(gettimeofday ftime, break)
AC_CHECK_HEADERS(ole2.h)
- dnl for some reason this test always fails here??
- dnl if test "x$HAVE_OLE2_H" != x ; then
- dnl this one does the right thing though
if test "$ac_cv_header_ole2_h" = "yes" ; then
if test "$GCC" = yes ; then
ALL_OBJECTS="$ALL_OBJECTS \$(OLEOBJS)"
fi
if test "$wxUSE_TOGGLEBTN" = "yes"; then
- AC_DEFINE(wxUSE_TOGGLEBTN)
+ if test "$wxUSE_MAC" = 1; then
+ AC_MSG_WARN([Toggle button is not yet supported under Mac OS X])
+ wxUSE_TOGGLEBTN=no
+ fi
+
+ if test "$wxUSE_TOGGLEBTN" = "yes"; then
+ AC_DEFINE(wxUSE_TOGGLEBTN)
+ fi
fi
if test "$wxUSE_TOOLBAR_SIMPLE" = "yes"; then
wx_cv_program_ext=$PROGRAM_EXT
wx_cv_target_library=$WX_TARGET_LIBRARY
wx_cv_target_libtype=$WX_TARGET_LIBRARY_TYPE
+ dnl we need to export them because passing them through cache won't
+ dnl work when cache=/dev/null (which is default for autoconf 2.50)
+ export wx_cv_path_samplesubdirs wx_cv_path_ifs wx_cv_program_ext \
+ wx_cv_target_library wx_cv_target_libtype
AC_CONFIG_SUBDIRS(demos samples utils contrib)
fi
dnl from wxUSE_GUI
Makefile
],
[
- chmod +x wx-config
- mv wx-config wx${TOOLKIT_NAME}-config
- ${LN_S} wx${TOOLKIT_NAME}-config wx-config
+ dnl don't move the file on itself - this happens when we run
+ dnl config.status which, as configure, executes these commands
+ dnl but, unlike it, doesn't create wx-config (which already
+ if test ! -f wx${TOOLKIT_NAME}-config; then
+ chmod +x wx-config
+ mv wx-config wx${TOOLKIT_NAME}-config
+ ${LN_S} wx${TOOLKIT_NAME}-config wx-config
+ fi
dnl the debian build process wants setup.h in the lib subdir so we
dnl can pretend wxWin is already installed, so we *copy* it there