+2006-08-17
+ * A report by Tuilipant Gergely had shown an "unaligned access"
+ error on an alpha machine. So, I have added macro to test for
+ the condition of aligned access but the alpha platoform seems
+ to be okay. Further reports are required.
2008-08-14
* Yvan Phelizot reports a problem in zzip/mmapped.c
* Malcom MacLeod had spurious problems inside a C++ project,
$(top_srcdir)/m4/ax_cflags_no_writable_strings.m4 \
$(top_srcdir)/m4/ax_cflags_strict_prototypes.m4 \
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_aligned_access_required.m4 \
$(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \
$(top_srcdir)/m4/ax_enable_builddir_uname.m4 \
$(top_srcdir)/m4/ax_expand_prefix.m4 \
cf_powerpc = openpower-linux1
cf_sparc = sparc-solaris1
cf_solaris = x86-solaris1
-cf_all = $(cf_debian) $(cf_fedora) $(cf_freebsd) $(cf_netbsd) $(cf_openbsd) \
- $(cf_amd64) $(cf_alpha) $(cf_powerpc) $(cf_sparc) $(cf_solaris) \
- $(cf_powermac)
+linux = $(cf_fedora) $(cf_debian) $(cf_amd64) $(cf_powerpc) $(cf_alpha)
+bsd = $(cf_freebsd) $(cf_netbsd) $(cf_openbsd) $(cf_powermac)
+sun = $(cf_sparc) $(cf_solaris)
+all = $(linux) $(sun) $(bsd)
+list = all
+
+
+_paths_ = export PATH=$$PATH:X/bin
+_includes_ = CPPFLAGS=\"-IX/include -IX/include/ncurses\"
+sparc-solaris1-gcc-path = $(subst X,/usr/local,$(_paths_));
+x86-solaris1-gcc-path = $(subst X,/usr/local,$(_paths_));
+sparc-solaris1-cc-path = $(subst X,/opt/SUNWspro,$(_paths_));
+x86-solaris1-cc-path = $(subst X,/opt/SUNWspro,$(_paths_));
+sparc-solaris1-gcc-conf = $(subst X,/usr/local,$(_includes_));
+x86-solaris1-gcc-conf = $(subst X,/usr/local,$(_includes_));
+sparc-solaris1-cc-conf = $(subst X,/opt/SUNWspro,$(_includes_));
+x86-solaris1-cc-conf = $(subst X,/opt/SUNWspro,$(_includes_));
+cf_compiler=gcc
+cf_configure = sh configure $($(cf)-$(cf_compiler)-conf) $(args)
+cf_profile = $(cf_get_uname); $($(cf)-$(cf_compiler)-path)
+cf_get_uname = uname -msr
+cf_unpacked = $(PACKAGE)-$(VERSION)
cf : cf-upload cf-system-all
cf-upload: ; scp $(PUB)$(PACKAGE)-$(VERSION).tar.bz2 cf-shell.sf.net:
cf-unpack: ; ssh cf-shell.sf.net \
- "ssh $(cf) 'tar xjvf $(PACKAGE)-$(VERSION).tar.bz2'"
+ ssh $(cf) "'tar xjvf $(PACKAGE)-$(VERSION).tar.bz2 2>&1'"
cf-configure: ; ssh cf-shell.sf.net \
- "ssh $(cf) 'uname -msr; cd $(PACKAGE)-$(VERSION) && sh configure'"
+ ssh $(cf) "'$(cf_profile) cd $(cf_unpacked) && $(cf_configure) 2>&1'"
cf-build: ; ssh cf-shell.sf.net \
- "ssh $(cf) 'uname -msr; cd $(PACKAGE)-$(VERSION) && make'"
+ ssh $(cf) "'$(cf_profile) cd $(cf_unpacked) && make 2>&1'"
cf-check: ; ssh cf-shell.sf.net \
- "ssh $(cf) 'uname -msr; cd $(PACKAGE)-$(VERSION) && make check'"
+ ssh $(cf) "'$(cf_profile) cd $(cf_unpacked) && make check 2>&1'"
+cf-clean: ; ssh cf-shell.sf.net \
+ ssh $(cf) "'$(cf_profile) cd $(cf_unpacked) && make clean 2>&1'"
+cf-distclean: ; ssh cf-shell.sf.net \
+ ssh $(cf) "'$(cf_profile) cd $(cf_unpacked) && rm -rf *.d 2>&1'"
+cf-prep: dist cf-upload cf-unpack
+cf-wipe: ; ssh cf-shell.sf.net \
+ ssh $(cf) "'$(cf_profile) rm -rf $(cf_unpacked)/ 2>&1'"
cf-system: ; ssh cf-shell.sf.net \
- "ssh $(cf) 'uname -msr | sed s,^,====$(cf)====,'"
+ ssh $(cf) "'$(cf_profile) $(cf_get_uname) | sed \"s,^,: $(cf) = ,\"'"
cf-configure-all:
- @ for cf in $(cf_all) ; do echo $(MAKE) cf-configure cf=$$cf \
- ; sleep 1; $(MAKE) cf-configure cf=$$cf ; done
+ echo $@: `date` "====================" > cf.log
+ @ for cf in $($(list)) ; do echo $(MAKE) cf-configure cf=$$cf \
+ ; sleep 1; $(MAKE) cf-configure cf=$$cf \
+ | sed -e "s|^|$$cf: |" | tee -a cf.log ; done
cf-build-all:
- @ for cf in $(cf_all) ; do echo $(MAKE) cf-build cf=$$cf \
- ; sleep 1; $(MAKE) cf-build cf=$$cf ; done
+ echo $@: `date` "====================" >> cf.log
+ @ for cf in $($(list)) ; do echo $(MAKE) cf-build cf=$$cf \
+ ; sleep 1; $(MAKE) cf-build cf=$$cf \
+ | sed -e "s|^|$$cf: |" | tee -a cf.log ; done
cf-check-all:
- @ for cf in $(cf_all) ; do echo $(MAKE) cf-check cf=$$cf \
- ; sleep 1; $(MAKE) cf-check cf=$$cf ; done
+ echo $@: `date` "====================" >> cf.log
+ @ for cf in $($(list)) ; do echo $(MAKE) cf-check cf=$$cf \
+ ; sleep 1; $(MAKE) cf-check cf=$$cf \
+ | sed -e "s|^|$$cf: |" | tee -a cf.log ; done
cf-system-all:
- @ for cf in $(cf_all) ; do echo $(MAKE) cf-configure cf=$$cf \
- ; sleep 1 ; $(MAKE) cf-system cf=$$cf ; done
+ echo $@: `date` "====================" >> cf.log
+ @ for cf in $($(list)) ; do echo $(MAKE) cf-configure cf=$$cf \
+ ; sleep 1 ; $(MAKE) cf-system cf=$$cf \
+ | sed -e "s|^|$$cf: |" | tee -a cf.log ; done
$(top_srcdir)/m4/ax_cflags_no_writable_strings.m4 \
$(top_srcdir)/m4/ax_cflags_strict_prototypes.m4 \
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_aligned_access_required.m4 \
$(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \
$(top_srcdir)/m4/ax_enable_builddir_uname.m4 \
$(top_srcdir)/m4/ax_expand_prefix.m4 \
m4_include([m4/ax_cflags_no_writable_strings.m4])
m4_include([m4/ax_cflags_strict_prototypes.m4])
m4_include([m4/ax_cflags_warn_all.m4])
+m4_include([m4/ax_check_aligned_access_required.m4])
m4_include([m4/ax_create_pkgconfig_info.m4])
m4_include([m4/ax_enable_builddir_uname.m4])
m4_include([m4/ax_expand_prefix.m4])
$(top_srcdir)/m4/ax_cflags_no_writable_strings.m4 \
$(top_srcdir)/m4/ax_cflags_strict_prototypes.m4 \
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_aligned_access_required.m4 \
$(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \
$(top_srcdir)/m4/ax_enable_builddir_uname.m4 \
$(top_srcdir)/m4/ax_expand_prefix.m4 \
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define if pointers to integers require aligned access */
+#undef HAVE_ALIGNED_ACCESS_REQUIRED
+
/* Define to 1 if you have the <byteswap.h> header file. */
#undef HAVE_BYTESWAP_H
{ (exit 1); exit 1; }; } ;;
esac
+echo "$as_me:$LINENO: checking if pointers to integers require aligned access" >&5
+echo $ECHO_N "checking if pointers to integers require aligned access... $ECHO_C" >&6
+if test "${ax_cv_have_aligned_access_required+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ax_cv_have_aligned_access_required=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ char* string = malloc(40);
+ int i;
+ for (i=0; i < 40; i++) string[[i]] = i;
+ {
+ void* s = string;
+ int* p = s+1;
+ int* q = s+2;
+
+ if (*p == *q) { return 1; }
+ }
+ return 0;
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ax_cv_have_aligned_access_required=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ax_cv_have_aligned_access_required=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+echo "$as_me:$LINENO: result: $ax_cv_have_aligned_access_required" >&5
+echo "${ECHO_T}$ax_cv_have_aligned_access_required" >&6
+if test "$ax_cv_have_aligned_access_required" = yes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALIGNED_ACCESS_REQUIRED 1
+_ACEOF
+
+fi
+
# the default is _disabled_!! anyway, result is prefixed in zzip/_config.h!!
# Check whether --enable-largefile or --disable-largefile was given.
if test "${enable_largefile+set}" = set; then
AC_INIT(zziplib.spec)
AC_PREREQ(2.49)
AC_COPYRIGHT([Guido Draheim <guido@gmx.de> for ZZipLib.SF.net])
-AC_REVISION($Revision: 1.6 $)
+AC_REVISION($Revision: 1.7 $)
AC_CONFIG_AUX_DIR(uses)
# =======================================================================
AC_CANONICAL_SYSTEM
AC_COMPILE_CHECK_SIZEOF(int)
AC_COMPILE_CHECK_SIZEOF(long)
AC_C_BIGENDIAN
+AX_CHECK_ALIGNED_ACCESS_REQUIRED
dnl -------------------------------------------------------------
# the default is _disabled_!! anyway, result is prefixed in zzip/_config.h!!
AC_SYS_LARGEFILE_SENSITIVE
$(top_srcdir)/m4/ax_cflags_no_writable_strings.m4 \
$(top_srcdir)/m4/ax_cflags_strict_prototypes.m4 \
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_aligned_access_required.m4 \
$(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \
$(top_srcdir)/m4/ax_enable_builddir_uname.m4 \
$(top_srcdir)/m4/ax_expand_prefix.m4 \
--- /dev/null
+dnl @synopsis AC_CHECK_ALIGNED_ACCESS_REQUIRED
+dnl
+dnl While the x86 CPUs allow access to memory objects to be unaligned
+dnl it happens that most of the modern designs require objects to be
+dnl aligned - or they will fail with a buserror. That mode is quite known
+dnl by big-endian machines (sparc, etc) however the alpha cpu is little-
+dnl endian.
+dnl
+dnl The following function will test for aligned access to be required and
+dnl set a config.h define HAVE_ALIGNED_ACCESS_REQUIRED (name derived by
+dnl standard usage). Structures loaded from a file (or mmapped to memory)
+dnl should be accessed per-byte in that case to avoid segfault type errors.
+dnl
+dnl @category C
+dnl @author Guido U. Draheim <guidod@gmx.de>
+dnl @version 2006-08-17
+dnl @license GPLWithACException
+
+AC_DEFUN([AX_CHECK_ALIGNED_ACCESS_REQUIRED],
+[AC_CACHE_CHECK([if pointers to integers require aligned access],
+ [ax_cv_have_aligned_access_required],
+ [AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ char* string = malloc(40);
+ int i;
+ for (i=0; i < 40; i++) string[[i]] = i;
+ {
+ void* s = string;
+ int* p = s+1;
+ int* q = s+2;
+
+ if (*p == *q) { return 1; }
+ }
+ return 0;
+}
+ ],
+ [ax_cv_have_aligned_access_required=yes],
+ [ax_cv_have_aligned_access_required=no],
+ [ax_cv_have_aligned_access_required=no])
+ ])
+if test "$ax_cv_have_aligned_access_required" = yes ; then
+ AC_DEFINE([HAVE_ALIGNED_ACCESS_REQUIRED], [1],
+ [Define if pointers to integers require aligned access])
+fi
+])
$(top_srcdir)/m4/ax_cflags_no_writable_strings.m4 \
$(top_srcdir)/m4/ax_cflags_strict_prototypes.m4 \
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_aligned_access_required.m4 \
$(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \
$(top_srcdir)/m4/ax_enable_builddir_uname.m4 \
$(top_srcdir)/m4/ax_expand_prefix.m4 \
$(top_srcdir)/m4/ax_cflags_no_writable_strings.m4 \
$(top_srcdir)/m4/ax_cflags_strict_prototypes.m4 \
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_aligned_access_required.m4 \
$(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \
$(top_srcdir)/m4/ax_enable_builddir_uname.m4 \
$(top_srcdir)/m4/ax_expand_prefix.m4 \
extern "C" {
}
#endif
+#endif
$(top_srcdir)/m4/ax_cflags_no_writable_strings.m4 \
$(top_srcdir)/m4/ax_cflags_strict_prototypes.m4 \
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
+ $(top_srcdir)/m4/ax_check_aligned_access_required.m4 \
$(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \
$(top_srcdir)/m4/ax_enable_builddir_uname.m4 \
$(top_srcdir)/m4/ax_expand_prefix.m4 \