changeset 3:f17d95ccee74

hercules
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Wed, 09 Nov 2011 16:31:35 -0500
parents b4aea2297716
children 459550954634
files build.sh hercules.patch
diffstat 2 files changed, 105 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/build.sh	Wed Nov 09 16:16:41 2011 -0500
+++ b/build.sh	Wed Nov 09 16:31:35 2011 -0500
@@ -7,6 +7,7 @@
 MPC_DIR="mpc-0.9"
 GDB_DIR="gdb-7.3.1"
 CMAKE_DIR="cmake-2.8.6"
+HERCULES_DIR="hercules-svn"
 
 GCC_TAR="${GCC_DIR}.tar.bz2"
 BINUTILS_TAR="${BINUTILS_DIR}.tar.bz2"
@@ -23,6 +24,7 @@
 MPC_URL="http://www.multiprecision.org/mpc/download/${MPC_TAR}"
 GDB_URL="http://ftp.gnu.org/gnu/gdb/${GDB_TAR}"
 CMAKE_URL="http://www.cmake.org/files/v2.8/${CMAKE_TAR}"
+HERCULES_REPO="svn://svn.hercules-390.org/hercules/trunk"
 
 PREFIX=$HOME/bin/cross
 MAKEOPTS=-j6
@@ -36,9 +38,10 @@
 BUILD_MPC=false
 BUILD_GCC=false
 BUILD_GDB=false
-BUILD_CMAKE=true
+BUILD_CMAKE=false
+BUILD_HERCULES=true
 
-for x in wget tar patch rm mkdir gmake ar ; do
+for x in wget tar patch rm mkdir gmake ar svn ; do
 	which $x 2> /dev/null && continue
 
 	echo "Error: cannot find '$x'"
@@ -164,3 +167,22 @@
 	cd ..
 fi
 
+if $BUILD_HERCULES ; then
+	if [ ! -e "$HERCULES_DIR" ]; then
+	       svn checkout $HERCULES_REPO $HERCULES_DIR
+
+	       cd $HERCULES_DIR
+	       patch -p1 < ../hercules.patch
+	       sh ./autogen.sh
+	       cd ..
+	fi
+
+	rm -rf hercules-objs
+	mkdir hercules-objs
+	cd hercules-objs
+	../${HERCULES_DIR}/configure \
+		--prefix=$PREFIX
+	gmake $MAKEOPTS
+	gmake install
+	cd ..
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hercules.patch	Wed Nov 09 16:31:35 2011 -0500
@@ -0,0 +1,81 @@
+diff --git a/autogen.sh b/autogen.sh
+index 4cb1a4f..ab6e453 100644
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -21,9 +21,9 @@ EOF
+ 
+ rm -f autogen.log
+ 
+-echo $ECHO_N "aclocal...    $ECHO_C" && aclocal -I m4 -I autoconf >>./autogen.log 2>&1 && echo "OK.  (25% done)" &&
++echo $ECHO_N "aclocal...    $ECHO_C" && aclocal-1.10 -I m4 -I autoconf >>./autogen.log 2>&1 && echo "OK.  (25% done)" &&
+ echo $ECHO_N "autoheader... $ECHO_C" && autoheader                >>./autogen.log 2>&1 && echo "OK.  (50% done)" &&
+-echo $ECHO_N "automake...   $ECHO_C" && automake                  >>./autogen.log 2>&1 && echo "OK.  (75% done)" &&
++echo $ECHO_N "automake...   $ECHO_C" && automake-1.10             >>./autogen.log 2>&1 && echo "OK.  (75% done)" &&
+ echo $ECHO_N "autoconf...   $ECHO_C" && autoconf                  >>./autogen.log 2>&1 && echo "OK.  (100% done)"
+ 
+ R=$?
+diff --git a/hercifc.h b/hercifc.h
+index e4c9bd1..ed82872 100644
+--- a/hercifc.h
++++ b/hercifc.h
+@@ -49,7 +49,7 @@
+   /* The in6_ifreq structure can be found in include/linux/ipv6.h */
+   struct in6_ifreq {
+     struct in6_addr ifr6_addr;
+-    __u32   ifr6_prefixlen;
++    uint32_t   ifr6_prefixlen;
+     int   ifr6_ifindex;
+   };
+ 
+diff --git a/hscutl.c b/hscutl.c
+index 1b244e7..2e6df26 100644
+--- a/hscutl.c
++++ b/hscutl.c
+@@ -884,7 +884,7 @@ void socket_keepalive( int sfd, int idle_time, int probe_interval,
+     if (rc) WRMSG(HHC02219, "E", "setsockopt(TCP_KEEPALIVE)", strerror(errno));
+   #elif defined(TCP_KEEPIDLE)
+     optval = idle_time;
+-    rc = setsockopt(sfd, SOL_TCP, TCP_KEEPIDLE, &optval, sizeof(optval));
++    rc = setsockopt(sfd, IPPROTO_TCP, TCP_KEEPIDLE, &optval, sizeof(optval));
+     if (rc) WRMSG(HHC02219, "E", "setsockopt(TCP_KEEPIDLE)", strerror(errno));
+   #else
+     UNREFERENCED(idle_time);
+@@ -892,7 +892,7 @@ void socket_keepalive( int sfd, int idle_time, int probe_interval,
+ 
+   #if defined(TCP_KEEPINTVL)
+     optval = probe_interval;
+-    rc = setsockopt(sfd, SOL_TCP, TCP_KEEPINTVL, &optval, sizeof(optval));
++    rc = setsockopt(sfd, IPPROTO_TCP, TCP_KEEPINTVL, &optval, sizeof(optval));
+     if (rc) WRMSG(HHC02219, "E", "setsockopt(TCP_KEEPALIVE)", strerror(errno));
+   #else
+     UNREFERENCED(probe_interval);
+@@ -900,7 +900,7 @@ void socket_keepalive( int sfd, int idle_time, int probe_interval,
+ 
+   #if defined(TCP_KEEPCNT)
+     optval = probe_count;
+-    rc = setsockopt(sfd, SOL_TCP, TCP_KEEPCNT, &optval, sizeof(optval));
++    rc = setsockopt(sfd, IPPROTO_TCP, TCP_KEEPCNT, &optval, sizeof(optval));
+     if (rc) WRMSG(HHC02219, "E", "setsockopt(TCPKEEPCNT)", strerror(errno));
+   #else
+     UNREFERENCED(probe_count);
+diff --git a/hthreads.h b/hthreads.h
+index 7d0182e..4cdab8b 100644
+--- a/hthreads.h
++++ b/hthreads.h
+@@ -15,7 +15,7 @@
+ 
+ #if defined(HAVE_SYS_SYSCALL_H) && !defined(HAVE_GETTID)
+  #include <sys/syscall.h>
+- #define gettid() ((pid_t)(syscall(SYS_gettid)))
++ #define gettid() ((pid_t)(pthread_self()))
+  #define USE_GETTID
+ #endif
+ 
+diff --git a/po/LINGUAS b/po/LINGUAS
+index 4b82095..c06b424 100644
+--- a/po/LINGUAS
++++ b/po/LINGUAS
+@@ -1,3 +1 @@
+ # Set of available languages
+-nl
+-de