The system was upgraded and everything is back online. If you experience any issues, please send an email to atlas_admin@aei.mpg.de - thanks a lot for your patience!

Commit 34fbfd32 authored by U-X1\korpela's avatar U-X1\korpela

WIN32 Cross Compile Fixes

parent b86e0fcc
......@@ -22,6 +22,9 @@
#define strdup _strdup
#define snprintf _snprintf
#endif
#ifdef _WIN32
#include <boinc_win.h>
#endif
#include "util.h"
#include "app_ipc.h"
......
......@@ -519,8 +519,11 @@ AX_CHECK_GL
AX_CHECK_GLU
dnl check for glut and prerequesites to the glut-test: libXmu and libXi
dnl or on windows libGDI32 and libWinMM
AC_CHECK_LIB([Xmu], [fopen], [have_Xmu="yes"], [have_Xmu="no"])
AC_CHECK_LIB([Xi], [fopen], [have_Xi="yes"], [have_Xi="no"])
AC_CHECK_LIB([gdi32], [fopen])
AC_CHECK_LIB([winmm], [fopen])
AX_CHECK_GLUT
if test "X${no_x}" != "Xyes" -a "$no_glut" = yes; then
......@@ -621,7 +624,75 @@ AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_TYPE_SIGNAL
AC_CHECK_HEADERS(windows.h sys/types.h sys/un.h arpa/inet.h dirent.h grp.h fcntl.h inttypes.h stdint.h memory.h netdb.h netinet/in.h netinet/tcp.h netinet/ether.h net/if.h net/if_arp.h signal.h strings.h sys/auxv.h sys/file.h sys/fcntl.h sys/ipc.h sys/ioctl.h sys/msg.h sys/param.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h ieeefp.h setjmp.h)
AC_CHECK_HEADERS(winsock2.h windows.h ws2tcpip.h sys/types.h sys/un.h arpa/inet.h dirent.h grp.h fcntl.h inttypes.h stdint.h memory.h netdb.h netinet/in.h netinet/tcp.h netinet/ether.h net/if.h net/if_arp.h signal.h strings.h sys/auxv.h sys/file.h sys/fcntl.h sys/ipc.h sys/ioctl.h sys/msg.h sys/param.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h ieeefp.h setjmp.h)
if test x${ac_cv_header_windows_h} = xyes ; then
AC_CHECK_HEADER(winhttp.h, [
AC_DEFINE(HAVE_WINHTTP_H,1,[Define to 1 if your compiler has the security.h header file])
], [], [[
#if HAVE_WINDOWS_H
# include <windows.h>
#endif
]])
AC_CHECK_HEADER(security.h, [
AC_DEFINE(HAVE_SECURITY_H,1,[Define to 1 if your compiler has the security.h header file])
AC_DEFINE(SECURITY_WIN32,1,[Define to 1 if your compiler has the security.h header file])
], [], [[
#define SECURITY_WIN32 1
#if HAVE_WINDOWS_H
# include <windows.h>
#endif
]])
AC_CHECK_HEADER(dbghelp.h, [
AC_DEFINE(HAVE_DBGHELP_H,1,[Define to 1 if your compiler has the dbghelp.h header])
], [], [[
#if HAVE_WINDOWS_H
# include <windows.h>
#endif
]])
fi
AC_CHECK_TYPES([socklen_t],[],[],[[
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
#ifdef HAVE_SYS_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#ifdef HAVE_WINHTTP_H
#include <winhttp.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
]])
AC_CHECK_HEADER(net/if.h, [], [], [[
#if HAVE_SYS_SOCKET_H
......@@ -664,6 +735,7 @@ AC_CHECK_HEADERS(netinet/if_ether.h,[],[],[[
#include <net/if.h>
#endif
]])
AC_CHECK_TYPES([struct lifconf, struct lifreq, struct ifconf, struct ifreq, struct ether_addr],[],[],[[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
......@@ -849,6 +921,10 @@ SAH_CHECK_LIB([wsock32],[fopen],[
AC_DEFINE([HAVE_LIBWSOCK32],[1],[Define to 1 if you have the wsock32 library])
CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"])
echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5
SAH_CHECK_LIB([userenv],[fopen],[
AC_DEFINE([HAVE_LIBUSERENV],[1],[Define to 1 if you have the userenv library])
CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"])
echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5
svlibs=$LIBS
if test "${ac_cv_func_res_init}" != "yes" ; then
......
......@@ -103,7 +103,9 @@
#endif
#include <winhttp.h>
#ifndef HAVE_SOCKLEN_T
typedef size_t socklen_t;
#endif
#else
......@@ -142,6 +144,12 @@ typedef size_t socklen_t;
#include <raserror.h>
#if defined(__MINGW32__)
#include <stdint.h>
#ifdef HAVE_SECURITY_H
#include <security.h>
#endif
#ifdef HAVE_DBGHELP_H
#include <dbghelp.h>
#endif
#include <imagehlp.h>
#else
#include <security.h>
......@@ -149,6 +157,7 @@ typedef size_t socklen_t;
#endif
#include <tlhelp32.h>
#include <io.h>
#if !defined(__CYGWIN32__)
#include <direct.h>
......
......@@ -311,7 +311,7 @@ int diagnostics_update_thread_list() {
// Enumerate the threads
for(uiSystemIndex = 0; uiSystemIndex < pProcesses->ThreadCount; uiSystemIndex++) {
pThread = &pProcesses->Threads[uiSystemIndex];
pThreadEntry = diagnostics_find_thread_entry(pThread->ClientId.UniqueThread);
pThreadEntry = diagnostics_find_thread_entry((DWORD)pThread->ClientId.UniqueThread);
if (pThreadEntry) {
pThreadEntry->crash_kernel_time = (FLOAT)pThread->KernelTime.QuadPart;
......@@ -325,12 +325,12 @@ int diagnostics_update_thread_list() {
hThread = OpenThread(
THREAD_ALL_ACCESS,
FALSE,
pThread->ClientId.UniqueThread
(DWORD)(pThread->ClientId.UniqueThread)
);
pThreadEntry = new BOINC_THREADLISTENTRY;
diagnostics_init_thread_entry(pThreadEntry);
pThreadEntry->thread_id = pThread->ClientId.UniqueThread;
pThreadEntry->thread_id = (DWORD)(pThread->ClientId.UniqueThread);
pThreadEntry->thread_handle = hThread;
pThreadEntry->crash_kernel_time = (FLOAT)pThread->KernelTime.QuadPart;
pThreadEntry->crash_user_time = (FLOAT)pThread->UserTime.QuadPart;
......
......@@ -18,6 +18,12 @@ else
if test "X${no_x}" != "Xyes"; then
GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"
fi
#
# If were running under windows assume we need GDI32 and WinMM
#
if echo $host_os | egrep '^mingw|^winnt' > /dev/null ; then
GLUT_LIBS="${GLUT_LIBS} -lgdi32 -lwinmm"
fi
AC_LANG_PUSH(C)
......
......@@ -9,5 +9,5 @@ AC_DEFUN([AX_WINSOCK],[
ac_cv_header_winsock2_h="no"
ac_cv_header_winsock_h="no"
fi
AC_CHECK_HEADERS([windows.h winsock2.h winsock.h sys/socket.h])
AC_CHECK_HEADERS([winsock2.h winsock.h windows.h sys/socket.h])
])
#! /bin/sh -x
for target_host in ${TARGET_HOST} i686-w64-mingw32 i686-pc-mingw32 none ; do
#! /bin/sh
case $1 in
--help) echo Usage:
echo "$0 \<target_host_triplet\> (default i686-\*-mingw32)"
echo " Expects to find build root in /usr/\<target_host_triplet\>/sys-root/mingw"
;;
i686*mingw32|x86_64*mingw32)
export TARGET_HOST=$1
;;
esac
for target_host in ${TARGET_HOST} i686-w64-mingw32 i686-pc-mingw32 x86_64-w64-mingw32 x86_64-pc-mingw32 none ; do
if test ${target_host} = none ; then
echo Cross compiling environment not found in /usr
exit 1
......@@ -11,6 +20,11 @@ for target_host in ${TARGET_HOST} i686-w64-mingw32 i686-pc-mingw32 none ; do
fi
done
build_manager=no
build_client=no
build_libs=yes
build_server=no
export XCOMPILE_ROOT="/usr/${TARGET_HOST}/sys-root/mingw"
guess=`../config.guess`
export BUILD_HOST=`../config.sub ${guess}`
......@@ -39,78 +53,141 @@ for dir in `find /usr/share -name pkgconfig` ; do
pkgsearchpath="${pkgsearchpath}:${dir}"
done
export PKG_CONFIG_PATH=`echo ${pkgsearchpath} | sed 's/dummy://'`
if ! ( test -e ../configure && find .. -name configure -mtime -1 ) ; then
cd ..
./_autosetup
cd xcompile
fi
if ! test -f ${XCOMPILE_ROOT}/lib/libssl.a ; then
opensslver=1.0.1g
wget http://www.openssl.org/source/openssl-${opensslver}.tar.gz
tar zxf openssl-${opensslver}.tar.gz
/bin/rm openssl-${opensslver}.tar.gz
cd openssl-${opensslver}
./Configure --prefix=${XCOMPILE_ROOT}/ no-shared zlib mingw
make all
make install
cd ..
rm -rf openssl-${opensslver}
if test $build_manager != no -o $build_libs != no ; then
if ! test -f ${XCOMPILE_ROOT}/lib/libjpeg.a ; then
jpegver=9a
wget http://ijg.org/files/jpegsrc.v${jpegver}.tar.gz
tar zxf jpegsrc.v${jpegver}.tar.gz
/bin/rm jpegsrc.v${jpegver}.tar.gz
cd jpeg-${jpegver}
./configure --prefix=${XCOMPILE_ROOT}/ --disable-shared --host=$TARGET_HOST --build=$BUILD_HOST
make -j 4 all
make install
cd ..
rm -rf jpeg-${jpegver}
fi
# if ! test -f ${XCOMPILE_ROOT}/lib/libbmp.a ; then
# svn checkout svn://svn.code.sf.net/p/libbmp/svn/trunk libbmp
# cd libbmp
# sed -e 's/ gcc/'${TARGET_HOST}'-gcc/' -e 's/ g++/'${TARGET_HOST}'-g++/' -e 's/ar/'${TARGET_HOST}'-ar/' Makefile > Makefile.mingw
# make -f Makefile.mingw libbmp.a bmp_go
# cp bmp.h ${XCOMPILE_ROOT}/include
# cp libbmp.a ${XCOMPILE_ROOT}/lib
# cd ..
# rm -rf libbmp
# fi
fi
if ! test -f ${XCOMPILE_ROOT}/lib/libcurl.a ; then
curlver=7.36.0
wget http://curl.haxx.se/download/curl-${curlver}.tar.bz2
tar jxf curl-${curlver}.tar.bz2
/bin/rm curl-${curlver}.tar.bz2
cd curl-${curlver}
./configure --prefix=${XCOMPILE_ROOT} --enable-static --disable-shared --host=$TARGET_HOST --build=$BUILD_HOST --with-zlib=${XCOMPILE_ROOT}
make all
make install
cd ..
rm -rf curl-${curlver}
if test $build_client != no -o $build_manager != no -o $build_libs != no ; then
if ! test -f ${XCOMPILE_ROOT}/lib/libssl.a ; then
opensslver=1.0.1g
wget http://www.openssl.org/source/openssl-${opensslver}.tar.gz
tar zxf openssl-${opensslver}.tar.gz
/bin/rm openssl-${opensslver}.tar.gz
cd openssl-${opensslver}
./Configure --prefix=${XCOMPILE_ROOT}/ no-shared zlib mingw
make -j 4 all
make install
cd ..
rm -rf openssl-${opensslver}
fi
fi
#if ! test -f ${XCOMPILE_ROOT}/lib/libwxbase30u.a ; then
# z7=`which 7z`
# if test "x${z7}" = x ; then
# echo you must install 7z in the path in order to install wxwidgets
# exit 1
# fi
# wxver=3.0.0
# gccver=481
# filename=wxMSW-${wxver}_gcc${gccver}TDM_Dev.7z
# wget http://sourceforge.net/projects/wxwindows/files/3.0.0/binaries/$filename/download
# mv download $filename
# 7z x $filename
# rm $filename
# rsync lib/gcc${gccver}TDM_dll/*.a ${XCOMPILE_ROOT}/lib
# rsync lib/gcc${gccver}TDM_dll/*.dll ${XCOMPILE_ROOT}/bin
# filename=wxWidgets-${wxver}_headers.7z
# wget http://sourceforge.net/projects/wxwindows/files/3.0.0/$filename/download
# mv download $filename
# 7z x $filename
# rm $filename
# rsync -va include/wx ${XCOMPILE_ROOT}/include
# rsync -va lib/gcc${gccver}TDM_dll/mswu/wx ${XCOMPILE_ROOT}/include
# rm -rf lib/gcc${gccver}TDM_dll
# rm -rf include/wx
#fi
if ! test -f ${XCOMPILE_ROOT}/lib/libfreeglut_static.a ; then
svn co http://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut freeglut
cd freeglut
mkdir build
cd build
/usr/bin/cmake -D GNU_HOST=${TARGET_HOST} \
-D CMAKE_TOOLCHAIN_FILE=mingw_cross_toolchain.cmake \
-D CMAKE_INSTALL_PREFIX=${XCOMPILE_ROOT}\
-D FREEGLUT_BUILD_STATIC_LIBS=ON \
-D FREEGLUT_BUILD_SHARED_LIBS=OFF \
-D FREEGLUT_BUILD_DEMOS=OFF \
..
make -j4
make install
cd ../..
/bin/rm -rf freeglut
if test $build_client != no -o $build_manager != no ; then
if ! test -f ${XCOMPILE_ROOT}/lib/libcurl.a ; then
curlver=7.36.0
wget http://curl.haxx.se/download/curl-${curlver}.tar.bz2
tar jxf curl-${curlver}.tar.bz2
/bin/rm curl-${curlver}.tar.bz2
cd curl-${curlver}
./configure --prefix=${XCOMPILE_ROOT} --enable-static --disable-shared --host=$TARGET_HOST --build=$BUILD_HOST --with-zlib=${XCOMPILE_ROOT}
make -j 4 all
make install
cd ..
rm -rf curl-${curlver}
fi
fi
if test $build_manager != no ; then
if ! test -f ${XCOMPILE_ROOT}/lib/libwxbase30u.a ; then
z7=`which 7z`
if test "x${z7}" = x ; then
echo you must install 7z in the path in order to install wxwidgets
exit 1
fi
wxver=3.0.0
gccver=481
filename=wxMSW-${wxver}_gcc${gccver}TDM_Dev.7z
mkdir wxdist
cd wxdist
wget http://sourceforge.net/projects/wxwindows/files/3.0.0/binaries/$filename/download
mv download $filename
7z x $filename
rm $filename
rsync lib/gcc${gccver}TDM_dll/*.a ${XCOMPILE_ROOT}/lib
rsync lib/gcc${gccver}TDM_dll/*.dll ${XCOMPILE_ROOT}/bin
filename=wxWidgets-${wxver}_headers.7z
wget http://sourceforge.net/projects/wxwindows/files/3.0.0/$filename/download
mv download $filename
7z x $filename
rm $filename
rsync -va include/wx ${XCOMPILE_ROOT}/include
rsync -va lib/gcc${gccver}TDM_dll/mswu/wx ${XCOMPILE_ROOT}/include
cd ..
rm -rf wxdist
fi
fi
if test $build_manager != no -o $build_libs != no ; then
if ! test -f ${XCOMPILE_ROOT}/include/GL/glut.h ; then
svn co http://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut freeglut
cd freeglut
mkdir build
cd build
/usr/bin/cmake -D GNU_HOST=${TARGET_HOST} \
-D CMAKE_TOOLCHAIN_FILE=mingw_cross_toolchain.cmake \
-D CMAKE_INSTALL_PREFIX=${XCOMPILE_ROOT}\
-D FREEGLUT_BUILD_STATIC_LIBS=ON \
-D FREEGLUT_BUILD_SHARED_LIBS=OFF \
-D FREEGLUT_BUILD_DEMOS=OFF \
..
make -j 4 all
make install
cd ../..
/bin/rm -rf freeglut
fi
fi
enables="--enable-static --disable-shared"
if test $build_client != no ; then
enables="${enables} --enable-client"
else
enables="${enables} --disable-client"
fi
if test $build_server != no ; then
enables="${enables} --enable-server"
else
enables="${enables} --disable-server"
fi
if test $build_libs != no ; then
enables="${enables} --enable-libraries"
else
enables="${enables} --disable-libraries"
fi
if test $build_manager != no ; then
enables="${enables} --enable-manager"
else
enables="${enables} --disable-manager"
fi
../configure -C --host=$TARGET_HOST --build=$BUILD_HOST --enable-static --disable-shared --enable-libraries --disable-client --disable-server --with-libcurl=${XCOMPILE_ROOT} --with-ssl=${XCOMPILE_ROOT} --with-winsock
make all
../configure -C --host=$TARGET_HOST --build=$BUILD_HOST ${enables} --with-libcurl=${XCOMPILE_ROOT} --with-ssl=${XCOMPILE_ROOT} --with-winsock --prefix=${XCOMPILE_ROOT}
make -j 4 all
exit 0
......@@ -9,38 +9,55 @@ SUBDIRS = zip unzip
AM_CFLAGS += -I$(top_srcdir) -I$(top_srcdir)/zip/zip -I$(top_srcdir)/zip/unzip -I$(top_srcdir)/lib -DUNIX -DDLL -DUSE_ZIPMAIN -DNO_OFF_T -DNO_CRYPT -DNO_LCHOWN -DNO_LCHMOD -DIZ_PWLEN=80 -Dinflate=inflate_boinc -Ddeflate=deflate_boinc -Dget_crc_table=get_crc_table_boinc -Dlongest_match=longest_match_boinc -Dinflate_codes=inflate_codes_boinc -Dcrc32=crc32_boinc
AM_CXXFLAGS += -I$(top_srcdir) -I$(top_srcdir)/zip/zip -I$(top_srcdir)/zip/unzip -I$(top_srcdir)/lib -DUNIX -DDLL -DUSE_ZIPMAIN -DNO_OFF_T -DNO_CRYPT -DNO_LCHOWN -DNO_LCHMOD -DIZ_PWLEN=80 -Dinflate=inflate_boinc -Ddeflate=deflate_boinc -Dget_crc_table=get_crc_table_boinc -Dlongest_match=longest_match_boinc -Dinflate_codes=inflate_codes_boinc -Dcrc32=crc32_boinc
if OS_WIN32
AM_CFLAGS += -DFORCE_WIN32_OVER_UNIX
AM_CXXFLAGS += -DFORCE_WIN32_OVER_UNIX
endif
if INSTALL_HEADERS
pkginclude_HEADERS = boinc_zip.h
endif
libboinc_zip_sources = \
boinc_zip.cpp \
./unzip/api.c \
./unzip/apihelp.c \
./unzip/crc32.c \
./unzip/explode.c \
./unzip/extract.c \
./unzip/fileio.c \
./unzip/globals.c \
./unzip/inflate.c \
./unzip/list.c \
./unzip/match.c \
./unzip/process.c \
./unzip/ttyio.c \
./unzip/unix/unix.c \
./unzip/unreduce.c \
./unzip/unshrink.c \
./unzip/unzip.c \
./unzip/zipinfo.c \
./zip/deflate.c \
./zip/trees.c \
./zip/util.c \
./zip/z_fileio.c \
./zip/z_globals.c \
./zip/zip.c \
./zip/zipfile.c \
./zip/zipup.c \
./zip/unix/z_unix.c
./unzip/api.c \
./unzip/apihelp.c \
./unzip/crc32.c \
./unzip/explode.c \
./unzip/extract.c \
./unzip/fileio.c \
./unzip/globals.c \
./unzip/inflate.c \
./unzip/list.c \
./unzip/match.c \
./unzip/process.c \
./unzip/ttyio.c \
./unzip/unreduce.c \
./unzip/unshrink.c \
./unzip/unzip.c \
./unzip/zipinfo.c \
./zip/deflate.c \
./zip/trees.c \
./zip/util.c \
./zip/z_fileio.c \
./zip/z_globals.c \
./zip/zip.c \
./zip/zipfile.c \
./zip/zipup.c
if OS_WIN32
libboinc_zip_sources += \
./unzip/win32/nt.c \
./unzip/win32/win32.c \
./zip/win32/win32_boinc.c \
./zip/win32/win32i64.c \
./zip/win32/z_nt.c \
./zip/win32/win32zip.c
else
libboinc_zip_sources += \
./unzip/unix/unix.c \
./zip/unix/z_unix.c
endif
lib_LTLIBRARIES = libboinc_zip.la
libboinc_zip_la_SOURCES = $(libboinc_zip_sources)
......
......@@ -105,6 +105,19 @@
# endif
#endif
#ifdef UNZIP
#warning UNZIP defined
#endif
#ifdef FUNZIP
#warning FUNZIP defined
#endif
#ifdef UNIX
#warning UNIX defined
#endif
#ifdef MORE
#warning MORE defined
#endif
#if (defined(UNZIP) && !defined(FUNZIP) && defined(UNIX) && defined(MORE))
# include <sys/ioctl.h>
# define GOT_IOCTL_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment