## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS= foreign subdir-objects
+ACLOCAL_AMFLAGS = -I build/m4
#
# What to build and install
libarchive/filter_fork.c \
libarchive/filter_fork.h
+if INC_WINDOWS_FILES
+libarchive_la_SOURCES+= \
+ libarchive/archive_windows.h \
+ libarchive/archive_windows.c \
+ libarchive/filter_fork_windows.c
+endif
+
+
libarchive_la_CPPFLAGS=-I $(top_builddir)/libarchive
# -no-undefined marks that libarchive doesn't rely on symbols
# defined in the application. This is mandatory for cygwin.
libarchive/test/list.h \
libarchive/archive_windows.c \
libarchive/archive_windows.h \
+ libarchive/filter_fork_windows.c \
+ libarchive/CMakeLists.txt \
+ libarchive/COPYING \
+ libarchive/README \
$(libarchive_man_MANS)
#
libarchive/test/test_write_format_tar_ustar.c \
libarchive/test/test_write_open_memory.c
-libarchive_test_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test
+libarchive_test_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC
+
+libarchive_test_LDADD=@PROG_LDADD_EXTRA@
# The "list.h" file just lists all of the tests defined in all of the sources.
# Building it automatically provides a sanity-check on libarchive_test_SOURCES
libarchive/test/test_read_format_isojolietrr_bz2.iso.bz2.uu \
libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu \
libarchive/test/test_read_format_tar_empty_filename.tar.uu \
- libarchive/test/test_read_format_zip.zip.uu
+ libarchive/test/test_read_format_zip.zip.uu \
+ libarchive/test/CMakeLists.txt \
+ libarchive/test/README
#
tar/util.c \
tar/write.c
+if INC_WINDOWS_FILES
+bsdtar_SOURCES+= \
+ tar/bsdtar_windows.h \
+ tar/bsdtar_windows.c
+endif
+if INC_CYGWIN_FILES
+bsdtar_SOURCES+= \
+ tar/bsdtar_cygwin.h \
+ tar/bsdtar_cygwin.c
+endif
+
bsdtar_DEPENDENCIES= libarchive.la
if STATIC_BSDTAR
bsdtar_static=
endif
-bsdtar_LDADD= libarchive.la
+bsdtar_LDADD= libarchive.la @PROG_LDADD_EXTRA@
bsdtar_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive
bsdtar_LDFLAGS= $(bsdtar_static)
bsdtar_EXTRA_DIST= \
- tar/bsdtar.1
+ tar/bsdtar.1 \
+ tar/bsdtar_windows.h \
+ tar/bsdtar_windows.c \
+ tar/bsdtar_cygwin.h \
+ tar/bsdtar_cygwin.c \
+ tar/CMakeLists.txt \
+ tar/config_freebsd.h \
+ tar/COPYING
+
if BUILD_BSDTAR
bsdtar_man_MANS= tar/bsdtar.1
tar/test/test_version.c \
tar/test/test_windows.c
+
bsdtar_test_CPPFLAGS= -I$(top_builddir)/tar/test
+bsdtar_test_LDADD=@PROG_LDADD_EXTRA@
tar/test/list.h: Makefile
cat $(top_srcdir)/tar/test/test_*.c | grep DEFINE_TEST > tar/test/list.h
bsdtar_test_EXTRA_DIST= \
tar/test/test_patterns_2.tar.uu \
tar/test/test_patterns_3.tar.uu \
- tar/test/test_patterns_4.tar.uu
+ tar/test/test_patterns_4.tar.uu \
+ tar/test/CMakeLists.txt
#
cpio/pathmatch.c \
cpio/pathmatch.h
+if INC_WINDOWS_FILES
+bsdcpio_SOURCES+= \
+ cpio/cpio_windows.h \
+ cpio/cpio_windows.c
+endif
+if INC_CYGWIN_FILES
+bsdcpio_SOURCES+= \
+ cpio/cpio_cygwin.h \
+ cpio/cpio_cygwin.c
+endif
+
bsdcpio_DEPENDENCIES = libarchive.la
bsdcpio_static=
endif
-bsdcpio_LDADD= libarchive.la
+bsdcpio_LDADD= libarchive.la @PROG_LDADD_EXTRA@
bsdcpio_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive
bsdcpio_LDFLAGS= $(bsdcpio_static)
bsdcpio_EXTRA_DIST= \
cpio/test/list.h \
- cpio/bsdcpio.1
+ cpio/bsdcpio.1 \
+ cpio/cpio_cygwin.h \
+ cpio/cpio_cygwin.c \
+ cpio/cpio_windows.h \
+ cpio/cpio_windows.c \
+ cpio/CMakeLists.txt \
+ cpio/config_freebsd.h
+
if BUILD_BSDCPIO
# Manpages to install
cpio/test/test_pathmatch.c
bsdcpio_test_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/cpio/test
+bsdcpio_test_LDADD=@PROG_LDADD_EXTRA@
cpio/test/list.h: Makefile
cat $(top_srcdir)/cpio/test/test_*.c | grep DEFINE_TEST > cpio/test/list.h
cpio/test/test_option_m.cpio.uu \
cpio/test/test_option_t.cpio.uu \
cpio/test/test_option_t.stdout.uu \
- cpio/test/test_option_tv.stdout.uu
+ cpio/test/test_option_tv.stdout.uu \
+ cpio/test/CMakeLists.txt
--- /dev/null
+# la_syslibsearchpath.m4 - attempt to determine the compiler's
+# library search directories.
+# sets $la_sys_lib_search_path_spec to space-separated list of
+# directories, specifing the compiler's built-in search path
+# for libraries. This is used by configure.ac when $host_os is
+# cygwin, to locate a special *object* we need to link against:
+# binmode.o. We know this object is located in that search path.
+# However, because gcc does not search for objects in its
+# libsearchpath (there is no -l for .o's), we must extract the
+# path(s) and search manually.
+#
+# Adapted from libtool.m4 (_LT_SYS_DYNAMIC_LINKER):
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+AC_DEFUN([LA_SYS_LIB_SEARCH_PATH],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_MSG_CHECKING([compiler library search path])
+# don't bother with EBCDIC systems here:
+la_NL2SP="tr \\015\\012 \\040\\040"
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) la_awk_arg="/^libraries:/,/LR/" ;;
+ *) la_awk_arg="/^libraries:/" ;;
+ esac
+ la_search_path_spec=`$CC -print-search-dirs | $AWK $la_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ case $la_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ la_search_path_spec=`echo "$la_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ la_search_path_spec=`echo "$la_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ la_tmp_la_search_path_spec=
+ la_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for la_sys_path in $la_search_path_spec; do
+ if test -d "$la_sys_path/$la_multi_os_dir"; then
+ la_tmp_la_search_path_spec="$la_tmp_la_search_path_spec $la_sys_path/$la_multi_os_dir"
+ else
+ test -d "$la_sys_path" && \
+ la_tmp_la_search_path_spec="$la_tmp_la_search_path_spec $la_sys_path"
+ fi
+ done
+ la_search_path_spec=`echo "$la_tmp_la_search_path_spec" | $AWK '
+BEGIN {RS=" "; FS="/|\n";} {
+ la_foo="";
+ la_count=0;
+ for (la_i = NF; la_i > 0; la_i--) {
+ if ($la_i != "" && $la_i != ".") {
+ if ($la_i == "..") {
+ la_count++;
+ } else {
+ if (la_count == 0) {
+ la_foo="/" $la_i la_foo;
+ } else {
+ la_count--;
+ }
+ }
+ }
+ }
+ if (la_foo != "") { la_freq[[la_foo]]++; }
+ if (la_freq[[la_foo]] == 1) { print la_foo; }
+}'`
+ la_sys_lib_search_path_spec=`echo "$la_search_path_spec" | $la_NL2SP`
+else
+ la_sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+AC_MSG_RESULT($la_sys_lib_search_path_spec)])
+
AC_CONFIG_SRCDIR([libarchive])
# Use auxiliary subscripts from this subdirectory (cleans up root)
AC_CONFIG_AUX_DIR([build/autoconf])
+# M4 scripts
+AC_CONFIG_MACRO_DIR([build/m4])
# Must follow AC_CONFIG macros above...
AM_INIT_AUTOMAKE()
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
+# Check for host type
+AC_CANONICAL_HOST
+
+dnl Compilation on mingw and Cygwin needs special Makefile rules
+inc_windows_files=no
+inc_cygwin_files=no
+case "$host_os" in
+ *mingw* ) inc_windows_files=yes ;;
+ *cygwin*) inc_cygwin_files=yes ;;
+esac
+AM_CONDITIONAL([INC_WINDOWS_FILES], [test $inc_windows_files = yes])
+AM_CONDITIONAL([INC_CYGWIN_FILES], [test $inc_cygwin_files = yes])
+
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_YACC
+AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_CHECK_TOOL([STRIP],[strip])
+#
+# Locate some specific link objects for cygwin
+#
+LA_SYS_LIB_SEARCH_PATH
+prog_ldadd_extra=
+case "$host_os" in
+*cygwin*)
+ for la_sys_path in $la_sys_lib_search_path_spec; do
+ if test -f $la_sys_path/binmode.o ; then
+ prog_ldadd_extra=$la_sys_path/binmode.o
+ break
+ fi
+ done
+ ;;
+esac
+PROG_LDADD_EXTRA=$prog_ldadd_extra
+AC_SUBST(PROG_LDADD_EXTRA)
+
#
# Options for building bsdtar.
#