Updates to make Linux work... still lost of issues.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1157 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
coppro
2008-08-21 02:41:30 +00:00
parent 30afb08930
commit d13b721b41
10 changed files with 129 additions and 33 deletions
+45 -2
View File
@@ -6,7 +6,7 @@
# Process this file with autoconf to produce a configure script.
AC_INIT(magicseteditor, 0.3.4, twanvl@users.sourceforge.net)
AC_INIT(magicseteditor, 0.3.7b, twanvl@users.sourceforge.net)
AC_CONFIG_SRCDIR([src/main.cpp])
# TODO: Actually use the config header
AC_CONFIG_HEADER([src/config.h])
@@ -15,7 +15,8 @@ AM_INIT_AUTOMAKE([-Wall foreign])
# Checks for programs.
AC_PROG_CXX
# Do not pass -O2, because that causes failures for now.
CXXFLAGS=-g
# Checks for libraries.
# TODO: Check for boost
@@ -46,6 +47,48 @@ AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([floor memset pow select sqrt])
AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins],
[AC_TRY_RUN([
int main()
{
unsigned long val = 1010, tmp, *mem = &val;
if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020)
return 1;
tmp = val;
if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010)
return 1;
if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0)
return 1;
tmp = 3030;
if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp)
return 1;
if (__sync_lock_test_and_set(&val, 4040) != 3030)
return 1;
mem = &tmp;
if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp)
return 1;
__sync_synchronize();
if (mem != &val)
return 1;
return 0;
}], [ap_cv_atomic_builtins=yes], [ap_cv_atomic_builtins=no], [ap_cv_atomic_builtins=no])])
if test "$ap_cv_atomic_builtins" = "yes"; then
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins])
fi
AC_OUTPUT([
Makefile
])