]> granicus.if.org Git - zziplib/commitdiff
fixing macros and changing over to PAX_TAR_CREATE in docs.
authorGuido Draheim <guidod@gmx.de>
Fri, 22 May 2009 00:06:36 +0000 (00:06 +0000)
committerGuido Draheim <guidod@gmx.de>
Fri, 22 May 2009 00:06:36 +0000 (00:06 +0000)
configure.ac
docs/Makefile.am
m4/ax_check_aligned_access_required.m4
m4/ax_pax_tar.m4 [new file with mode: 0644]

index 4149bead25fe7cf026dd16131d761735c951308e..58e38fce93e0d98ca56bc43671aa7f6be9b1d8bd 100644 (file)
@@ -1,8 +1,9 @@
-AC_INIT(zziplib.spec)
+AC_INIT([zziplib.spec])
 AC_PREREQ(2.49)
 AC_COPYRIGHT([Guido Draheim <guido@gmx.de> for ZZipLib.SF.net])
-AC_REVISION($Revision: 1.10 $)
-AC_CONFIG_AUX_DIR(uses)
+AC_REVISION($Revision: 1.11 $)
+AC_CONFIG_AUX_DIR([uses])
+AC_CONFIG_MACRO_DIR([m4])
 # =======================================================================
 AC_CANONICAL_SYSTEM
 dnl AM_ENABLE_MULTILIB([Makefile],[$host])
@@ -36,7 +37,7 @@ fi
 
 case ".$with_zlib" in
    .no|.no,*)
-      AC_MSG_RESULT(none) 
+      AC_MSG_RESULT(none)
       with_zlib="no, not configured" ;;
   ./usr)
       AC_MSG_RESULT([oops, ignored (may try --with-zlib=/usr/.)])
@@ -63,7 +64,7 @@ AC_SUBST(ZLIB_LDIR)
 # -----------------------------------------------------------------------
 AX_SPEC_DEFAULTS
 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
-dnl test ".$CFLAGS" = "." && CFLAGS="" 
+dnl test ".$CFLAGS" = "." && CFLAGS=""
 AC_PROG_CC
 dnl test ".$CFLAGS" = "." && test "$GCC" = "yes" && CFLAGS="-O3"
 AC_PROG_INSTALL
@@ -83,6 +84,9 @@ AM_MAINTAINER_MODE
 AX_CREATE_PKGCONFIG_INFO(dnl
 [zzip/zziplib.pc], [zzip-zlib-config],[-lzzip])
 # -----------------------------------------------------------------------
+echo extrac.t..
+AX_PAX_TAR_CREATE
+AX_PAX_TAR_EXTRACT
 AC_PATH_PROGS(PERL, perl5 perl, echo no perl found for)
 AC_PATH_PROGS(PYTHON, python2.2 python2.3 python, echo no python found for)
 AC_PATH_PROGS(MKZIP, zip pkzip, :)
@@ -122,7 +126,7 @@ if test ".$ac_cv_sys_largefile_sensitive" = ".no" ; then
 elif test ".$with_largefile" != ".no" ; then
   AC_MSG_RESULT(compiles library as 64bit off_t variant dnl
 - and renaming some function names)
-  LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGEFILE_SOURCE"  
+  LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGEFILE_SOURCE"
   AC_MSG_RESULT(..adding CFLAGS $LARGEFILE_CFLAGS)
   CFLAGS="$CFLAGS $LARGEFILE_CFLAGS"
   AC_MSG_RESULT(..adding 64 into RELEASE_INFO for the libraries)
@@ -140,7 +144,7 @@ if test "_$ac_cv_header_zlib_h" != "_yes" ; then
          AC_MSG_RESULT(dnl
 ...note: and when linkage fails you might also need to set some LDFLAGS)
   case "$prefix" in
-    NONE|/usr) 
+    NONE|/usr)
             AC_MSG_RESULT(dnl
 ...note: both can be set by specifying the install prefix of the zlib library)
             AC_MSG_RESULT(dnl
@@ -180,7 +184,7 @@ case "${with_docdir}" in
  no)  docdir='${datadir}/doc' ;;
  /*|\\*|[a-zA-Z]:*) docdir="$with_docdir"  ;;
  *) AC_MSG_RESULT(oops)
-    AC_MSG_ERROR(bad value ${withval} for --with-docdir) 
+    AC_MSG_ERROR(bad value ${withval} for --with-docdir)
  ;;
 esac
 AC_SUBST(docdir)
@@ -195,7 +199,7 @@ AC_ARG_WITH(debug, AC_HELP_STRING(
                    AC_MSG_ERROR(bad value ${withval} for --with-debug) ;;
        esac], [with_debug="no"])
 test "$with_debug" != "yes" && with_debug="no" # yes or no
-test "$with_debug" = "yes" && export CFLAGS="$CFLAGS -DDEBUG" 
+test "$with_debug" = "yes" && export CFLAGS="$CFLAGS -DDEBUG"
 result="$with_debug" ; test "$result" = "yes" && result="yes, added -DDEBUG"
 AC_MSG_RESULT($result)
 if test "$with_debug" = "yes" ; then if test -n "$RELEASE_INFO" ; then
@@ -219,7 +223,7 @@ if test "$with_lowstk" = "auto"; then
   esac
 fi
 test "$with_lowstk" != "yes" && with_lowstk="no" # yes or no
-test "$with_lowstk" = "yes" && CFLAGS="$CFLAGS -D_LOWSTK" 
+test "$with_lowstk" = "yes" && CFLAGS="$CFLAGS -D_LOWSTK"
 result="$with_lowstk" ; test "$result" = "yes" && result="yes, added -D_LOWSTK"
 AC_MSG_RESULT($with_lowstk)
 # ---------------------------------------------------------------
@@ -276,7 +280,7 @@ AC_SUBST(ZIPTESTS)
 # ---------------------------------------------------------------
 AC_MSG_CHECKING(link options)
 case "$host_os" in
-  mingw*) 
+  mingw*)
     ZZIPLIB_LDFLAGS="-no-undefined -export-all-symbols -mconsole"
     RESOLVES=' '
   ;;
@@ -303,7 +307,7 @@ AX_CFLAGS_GCC_OPTION(-Werror-implicit-function-declaration)
 AX_ENABLE_DEFAULT_PKGCONFIGDIR
 AX_ENABLE_DEFAULT_ACLOCALDIR
 AC_SUBST([CONFIG_FILES])
-AC_OUTPUT([Makefile 
+AC_OUTPUT([Makefile
            zzip/Makefile zzipwrap/Makefile SDL/Makefile
            docs/Makefile test/Makefile bins/Makefile])
 dnl -------------------------------------------------------------
index 41b3ea5a73b19407496d5118e97f03dd5f84f8ff..f857391c7c559aa89fcc7d6b667d0d2c3f734ebd 100644 (file)
@@ -24,9 +24,9 @@ EXTRA_DIST = make-doc.py $(doc_FILES) $(htm_FILES) $(SDL_RWOPS) \
              make-doc.pl make-dbk.pl   mksite.sh mksite.pl body.htm \
              $(zzipdoc_FILES) sdocbook.css \
              zziplib-manpages.dbk zziplib-master.dbk \
-             zziplib-manpages.ar 
+             zziplib-manpages.tar
 CLEANFILES = *.pc *.omf
-DISTCLEANFILES = zziplib.spec manpages.ar htmpages.ar *.html *.xml
+DISTCLEANFILES = zziplib.spec manpages.tar htmpages.tar *.html *.xml
 
 zzipdoc_FILES = makedocs.py               zzipdoc/__init__.py \
        zzipdoc/commentmarkup.py          zzipdoc/match.py    \
@@ -52,11 +52,11 @@ install-data-local : @MAINTAINER_MODE_FALSE@ install-mans
 zziplib.spec : @top_srcdir@/$(PACKAGE).spec
        @ $(LN_S) $? $@ # the two zzip-doc.* will grep thru zziplib.spec
 doc  : $(doc_FILES) site.html
-docs : doc manpages.ar htmpages.ar
+docs : doc manpages.tar htmpages.tar
 # docu : docs
 docu : 
        - rm zziplib2.html zzipmmapped.html zzipfseeko.html
-       $(MAKE) manpages.ar htmpages.ar DELETE=exit
+       $(MAKE) manpages.tar htmpages.tar DELETE=exit
 
 zziplib.html: zziplib.xml
 zziplib.xml: zziplib.spec $(srcdir)/Makefile.am \
@@ -93,7 +93,7 @@ DOCEXAMPLES = $(bins)/zzdir.c $(bins)/zzcat.c \
               $(bins)/zzxordir.c $(bins)/zzxorcat.c \
              $(bins)/zzxorcopy.c        $(SDL_RWOPS)
 
-install-docs: $(doc_FILES) $(man_FILES) site.html htmpages.ar
+install-docs: $(doc_FILES) $(man_FILES) site.html htmpages.tar
        $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
        $(INSTALL_DATA) $(html_FILES) $(DESTDIR)$(pkgdocdir)
        for i in $(doc_FILES) $(DOCEXAMPLES) $(changelog) $(srcdir)/README.* \
@@ -101,9 +101,9 @@ install-docs: $(doc_FILES) $(man_FILES) site.html htmpages.ar
            $(DESTDIR)$(pkgdocdir) ; done
        cd $(DESTDIR)$(pkgdocdir) && ln -sf zzip-index.html index.html
        $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/man
-       @ echo ar x htmpages.ar '>>>' $(DESTDIR)$(pkgdocdir)/man/ \
-       ; test -f htmpages.ar || cd "$srcdir" ; P=`pwd` \
-       ; cd $(DESTDIR)$(pkgdocdir)/man && ar x $$P/htmpages.ar \
+       @ echo extract htmpages.tar '>>>' $(DESTDIR)$(pkgdocdir)/man/ \
+       ; test -f htmpages.tar || cd "$srcdir" ; P=`pwd` \
+       ; cd $(DESTDIR)$(pkgdocdir)/man && $(PAX_TAR_EXTRACT) $$P/htmpages.tar \
        ; true
 
 install-doc : install-docs $(PACKAGE)-doc.omf
@@ -122,12 +122,12 @@ install-sf:
 mans : manpages
 install-mans : install-man3
 
-man3 man manpages : manpages.ar
-html htm htmpages : htmpages.ar
+man3 man manpages : manpages.tar
+html htm htmpages : htmpages.tar
 
-zziplib-manpages.ar : manpages.ar
+zziplib-manpages.tar : manpages.tar
        test -s "$@" || test -s "$(srcdir)/$@"
-manpages.ar : zziplib.xml zzipmmapped.xml zzipfseeko.xml
+manpages.tar : zziplib.xml zzipmmapped.xml zzipfseeko.xml
        : "unix man format of the manpages - goes to ../share/man/man3"
        @ if test "$(XMLTO)" != ":" \
        ; then echo going to regenerate "$@" in subdir "'"man"'" \
@@ -141,8 +141,8 @@ manpages.ar : zziplib.xml zzipmmapped.xml zzipfseeko.xml
        ;       $(XMLTO) -o man3 man zzipfseeko.xml  \
        ; echo 'chmod 664 man3/*.3' \
        ;       chmod 664 man3/*.3  \
-       ; echo 'ar qc "$@" man3/*.3' \
-       ;       ar qc "$@" man3/*.3  \
+       ; echo '$(PAX_TAR_CREATE) "$@" man3/*.3' \
+       ;       $(PAX_TAR_CREATE) "$@" man3/*.3  \
        ; echo '$(DELETE); rm man3/*.3 ; rmdir man3' \
        ;       $(DELETE); rm man3/*.3 ; rmdir man3  \
        ; fi ; true
@@ -151,9 +151,9 @@ manpages.ar : zziplib.xml zzipmmapped.xml zzipfseeko.xml
        ; else echo cp $(srcdir)/zziplib-$@ $@; cp $(srcdir)/zziplib-$@ $@ \
        ; fi
 
-zziplib-htmpages.ar : htmpages.ar
+zziplib-htmpages.tar : htmpages.tar
        test -s "$@" || test -s "$(srcdir)/$@"
-htmpages.ar : zziplib.xml zzipmmapped.xml zzipfseeko.xml zziplib-manpages.dbk
+htmpages.tar : zziplib.xml zzipmmapped.xml zzipfseeko.xml zziplib-manpages.dbk
        : "html format of the manpages - put into zziplib/htdocs/man/*"
        @ if test "$(XMLTO)" != ":" \
        ; then echo going to regenerate "$@" in subdir "'"html"'" \
@@ -173,15 +173,15 @@ htmpages.ar : zziplib.xml zzipmmapped.xml zzipfseeko.xml zziplib-manpages.dbk
        ; else echo cp $(srcdir)/zziplib-$@ $@; cp $(srcdir)/zziplib-$@ $@ \
        ; fi
 
-install-man3 : manpages.ar
+install-man3 : manpages.tar
        $(mkinstalldirs) $(DESTDIR)$(mandir)/man3
        P=`pwd` ; cd $(DESTDIR)$(mandir)/man3 \
-        && ar x $$P/manpages.ar \
+        && $(PAX_TAR_EXTRACT) $$P/manpages.tar \
         ; true
 
-unpack : manpages.ar htmpages.ar
-       (rm -rf _htm && mkdir _htm && cd _htm && ar x ../htmpages.ar)
-       (rm -rf _man && mkdir _man && cd _man && ar x ../manpages.ar)
+unpack : manpages.tar htmpages.tar
+       (rm -rf _htm && mkdir _htm && cd _htm && $(PAX_TAR_EXTRACT) ../htmpages.tar)
+       (rm -rf _man && mkdir _man && cd _man && $(PAX_TAR_EXTRACT) ../manpages.tar)
 clean-unpack : 
        rm -rf _htm
        rm -rf _man
index a7d43ca66641cf8424acd82410a397eb520c5a3e..513e6bfffad00bef720619d69a8ae44fb86995a8 100644 (file)
@@ -20,11 +20,12 @@ 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],
-if test "$cross_compiling" = "yes"; then
+[if test "$cross_compiling" = "yes"; then
   case "$host_cpu" in alpha*|arm*|bfin*|hp*|mips*|sh*|sparc*|ia64|nv1)
     ax_cv_have_aligned_access_required="yes"
-  ;; *)
-  [AC_TRY_RUN([
+  ;; esac
+else
+  AC_TRY_RUN([
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -47,7 +48,7 @@ int main()
      [ax_cv_have_aligned_access_required=no],
      [ax_cv_have_aligned_access_required=no])
   ])
-;; esac
+fi
 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])
diff --git a/m4/ax_pax_tar.m4 b/m4/ax_pax_tar.m4
new file mode 100644 (file)
index 0000000..6498cf4
--- /dev/null
@@ -0,0 +1,116 @@
+dnl @synopsis AC_CHECK_ALIGNED_ACCESS_REQUIRED
+dnl
+dnl Most people will not know about the "tar"-wars a long while back.
+dnl In the end the proponents of cpio lost just as all the oldish
+dnl tar formats were dumped in favor of a new format that based on
+dnl the successful "ustar" format. The extensions did mostly cover
+dnl a portable definition of filenames and such stuff.
+
+dnl The most interesting thing however is that the opengroup (the.
+dnl UNIX standardization body) did not document the tool for the
+dnl portable tar format under the name of "tar" but instead it did
+dnl use the name "pax" which stands for "portable archiver". Even
+dnl more so, the "pax" utitility is required to understand the old
+dnl tar and cpio formats but it will default to a "tar"-like variant.
+dnl The "pax" tool has been in the Unix standard ever since UNIX92.
+dnl
+dnl Interestingly gnu-tar will use the pax features as soon as they
+dnl are required - but you can not be sure if gnu-tar is available,
+dnl and it is quite likely that the system tar will default to the
+dnl old format of the system in whatever it was. On any currrent
+dnl Unix system however one should be able to find "pax", so one
+dnl should prefer that one as the most portable tool.
+
+dnl The downside is however that the commandline options of "pax"
+dnl are different from "tar"/"gtar". That's why we define two
+dnl subst'ed names here - PAX_TAR_CREATE and PAX_TAR_EXTRACT, For
+dnl extra portability the first argument should be "*.tar" file
+dnl name but you should be aware that in most cases the "pax" tool
+dnl is invoked. Nota bene: do not use "*.pax" as the file name
+dnl extension because some file managers interpret it as a TeX file.
+dnl
+dnl @category C
+dnl @author Guido U. Draheim <guidod@gmx.de>
+dnl @version 2009-05-22
+dnl @license GPLWithACException
+
+AC_DEFUN([_AX_PAX_TAR_TOOL],[
+if test -z "$ac_cv_pax_tar_tool"; then
+  AC_PATH_PROG([PAX],[pax], :)
+  if test "$ac_cv_path_PAX" != ":"; then
+    ac_cv_pax_tar_tool="pax"
+  else #1
+  AC_PATH_PROG([GNUTAR],[gnutar], :)
+  if test "$ac_cv_path_GNUTAR" != ":"; then
+    ac_cv_pax_tar_tool="gnutar"
+  else #2
+  AC_PATH_PROG([GTAR],[gtar], :)
+  if test "$ac_cv_path_GTAR" != ":"; then
+    ac_cv_pax_tar_tool="gtar"
+  else #3
+  AC_PATH_PROG([TAR],[tar], :)
+  if test "$ac_cv_path_GTAR" != ":"; then
+    ac_cv_pax_tar_tool="tar"
+  fi
+  fi fi fi #3 #2 #1
+  AC_MSG_CHECKING([for portable tar tool])
+  AC_MSG_RESULT([$ac_cv_pax_tar_tool])
+fi
+])
+
+AC_DEFUN([_AX_PAX_TAR_CREATE],[
+  _AX_PAX_TAR_TOOL
+  AC_MSG_CHECKING([for invokation create portable tar archives])
+  if test "$ac_cv_pax_tar_tool" = "pax"; then
+    ax_pax_tar_create="'$ac_cv_path_PAX' -wf"
+  elif test "$ac_cv_pax_tar_tool" = "gnutar"; then
+    ax_pax_tar_create="'$ac_cv_path_GNUTAR' cf"
+  elif test "$ac_cv_pax_tar_tool" = "gtar"; then
+    ax_pax_tar_create="'$ac_cv_path_GTAR' cf"
+  elif test "$ac_cv_pax_tar_tool" = "tar"; then
+    ax_pax_tar_create="'$ac_cv_path_TAR' cf"
+  else
+    ax_pax_tar_create=": 'unknown pax tar tool $ac_cv_pax_tar_tool'"
+  fi
+  AC_MSG_RESULT([$ax_pax_tar_create])
+])
+
+AC_DEFUN([_AX_PAX_TAR_EXTRACT],[
+  _AX_PAX_TAR_TOOL
+  AC_MSG_CHECKING([for invokation extract portable tar archives])
+  if test "$ac_cv_pax_tar_tool" = "pax"; then
+    ax_pax_tar_extract="'$ac_cv_path_PAX' -rf"
+  elif test "$ac_cv_pax_tar_tool" = "gnutar"; then
+    ax_pax_tar_extract="'$ac_cv_path_GNUTAR' xf"
+  elif test "$ac_cv_pax_tar_tool" = "gtar"; then
+    ax_pax_tar_extract="'$ac_cv_path_GTAR' xf"
+  elif test "$ac_cv_pax_tar_tool" = "tar"; then
+    ax_pax_tar_extract="'$ac_cv_path_TAR' xf"
+  else
+    ax_pax_tar_extract=": 'unknown pax tar tool $ac_cv_pax_tar_tool'"
+  fi
+  AC_MSG_RESULT([$ax_pax_tar_extract])
+])
+
+AC_DEFUN([AX_PAX_TAR_CREATE],[dnl
+_AX_PAX_TAR_CREATE
+m4_ifval([$1],[dnl
+$1="$ax_pax_tar_create"
+AC_SUBST([$1])
+],[dnl
+PAX_TAR_CREATE="$ax_pax_tar_create"
+AC_SUBST([PAX_TAR_CREATE])
+])
+])
+
+AC_DEFUN([AX_PAX_TAR_EXTRACT],[dnl
+_AX_PAX_TAR_EXTRACT
+m4_ifval([$1],[dnl
+$1="$ax_pax_tar_extract"
+AC_SUBST([$1])
+],[dnl
+PAX_TAR_EXTRACT="$ax_pax_tar_extract"
+AC_SUBST([PAX_TAR_EXTRACT])
+])
+])
+