dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
dnl default CFLAGS (something like "-g -O2") - we don't need this as add
dnl -g and -O flags ourselves below
-CFLAGS=${CFLAGS=}
+CFLAGS=${CFLAGS:=}
AC_PROG_CC
dnl is -traditional needed for correct compilations
dnl defines CXXFLAGS
dnl
dnl see CFLAGS line above
-CXXFLAGS=${CXXFLAGS=}
+CXXFLAGS=${CXXFLAGS:=}
AC_PROG_CXX
AC_LANG_RESTORE
dnl and finally the userland threads
THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
;;
- *-*-aix* )
+ *-*-darwin*)
+ dnl Darwin / Mac OS X just uses -lpthread tested below
+ THREAD_OPTS=""
+ ;;
+ *-*-aix*)
dnl AIX calls the library libpthreads - thanks IBM!
THREAD_OPTS="pthreads"
;;
wxUSE_THREADS=no
AC_MSG_WARN([No thread support on this system... disabled])
else
+ dnl yes, these special compiler flags should be used with the
+ dnl linker as well
+ LIBS="$THREADS_LINK $THREADS_CFLAGS $LIBS"
+
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host}" in
THREADS_CFLAGS="$THREADS_CFLAGS $flag"
fi
- if test "x$THREADS_LINK" != "x"; then
- LIBS="$THREADS_LINK $LIBS"
- fi
-
if test "x$THREADS_CFLAGS" != "x"; then
- dnl don't add this to CPPFLAGS as cpp might not recognize them
+ dnl don't add these options to CPPFLAGS as cpp might not know them
CFLAGS="$CFLAGS $THREADS_CFLAGS"
CXXFLAGS="$CXXFLAGS $THREADS_CFLAGS"
-
- dnl yes, these special compiler flags should be used with the
- dnl linker as well
- LIBS="$LIBS $THREADS_CFLAGS"
fi
fi
fi
EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
+dnl remove the extra white space from the cc/c++/ld options
CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
+LIBS=`echo $LIBS | sed 's/ \+/ /g'`
-LDFLAGS="$LDFLAGS$PROFILE"
+LDFLAGS="$LDFLAGS $PROFILE"
dnl for convenience, sort the samples in alphabetical order
dnl