[unshield] 01/08: Imported Upstream version 1.3

Evgeni Golov evgeni at moszumanska.debian.org
Sat Apr 30 10:35:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

evgeni pushed a commit to branch master
in repository unshield.

commit f5c98d61404b138b00fde26871d2fe412f9b133c
Author: Evgeni Golov <evgeni at debian.org>
Date:   Sat Apr 30 11:19:11 2016 +0200

    Imported Upstream version 1.3
---
 .gitignore                     |   8 +-
 .travis.yml                    |  17 +-
 CMakeLists.txt                 |  71 ++++++
 Makefile.am                    |  18 --
 README => README.md            |  14 +-
 TODO                           |   7 -
 VERSION                        |   1 -
 bootstrap                      |  42 ----
 config.rpath                   | 513 --------------------------------------
 configure.ac.in                | 121 ---------
 lib/CMakeLists.txt             |  43 ++++
 lib/Makefile.am                |  33 ---
 lib/convert_utf/CMakeLists.txt |   9 +
 lib/convert_utf/Makefile.am    |   9 -
 lib/file.c                     |   3 +
 lib/helper.c                   |   2 +-
 lib/md5/CMakeLists.txt         |  10 +
 lib/md5/Makefile.am            |   9 -
 lib/unshield_config.h.in       |  74 ++++++
 libunshield.pc.in              |  10 +-
 m4/check_ssl.m4                |  64 -----
 m4/check_zlib.m4               |  82 ------
 m4/lib-ld.m4                   |  97 --------
 m4/lib-link.m4                 | 554 -----------------------------------------
 m4/lib-prefix.m4               | 148 -----------
 man/Makefile.am                |   3 -
 rebuild.sh                     |   4 +-
 src/CMakeLists.txt             |   7 +
 src/Makefile.am                |  10 -
 src/unshield.c                 |   4 +
 travis.md                      |   1 -
 31 files changed, 255 insertions(+), 1733 deletions(-)

diff --git a/.gitignore b/.gitignore
index 30f04a5..a099270 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,7 +14,6 @@ install-sh
 lib/stamp-h1
 libtool
 lib/unshield_config.h
-lib/unshield_config.h.in
 libunshield.pc
 *.lo
 ltmain.sh
@@ -27,3 +26,10 @@ src/unshield-deobfuscate
 *.core
 .*.swp
 .gdb_history
+compile
+
+# CMake ignore
+**/CMakeFiles/
+**/CMakeScripts/
+*cmake_install.cmake
+**/CMakeCache.txt
diff --git a/.travis.yml b/.travis.yml
index 2959001..ea293c9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,16 @@
 language: c
-compiler: gcc
-script: ./rebuild.sh
+
+compiler:
+  - gcc
+
+env:
+  global:
+    - CFLAGS="-Wall -Werror -ggdb3"
+  matrix:
+    - USE_OUR_OWN_MD5=0 BUILD_STATIC=0
+    - USE_OUR_OWN_MD5=1 BUILD_STATIC=0
+    - USE_OUR_OWN_MD5=0 BUILD_STATIC=1
+    - USE_OUR_OWN_MD5=1 BUILD_STATIC=1
+
+# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/var/tmp/unshield . && make && make install
+script: cmake -DCMAKE_INSTALL_PREFIX:PATH=/var/tmp/unshield -DUSE_OUR_OWN_MD5=$USE_OUR_OWN_MD5 -DBUILD_STATIC=$BUILD_STATIC . && make && make install
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..c7a748b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,71 @@
+cmake_minimum_required(VERSION 2.8.7)
+project(unshield)
+
+# Mimic CMP0048 which is avaliable only for cmake 3.0 and later
+set(PROJECT_VERSION_MAJOR 1)
+set(PROJECT_VERSION_MINOR 3)
+set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
+
+option(BUILD_STATIC "Build static version of libunshield" OFF)
+
+include(CheckIncludeFiles)
+include(CheckFunctionExists)
+include(CheckCSourceCompiles)
+include(GNUInstallDirs)
+
+check_include_files(byteswap.h HAVE_BYTESWAP_H)
+check_include_files(dlfcn.h HAVE_DLFCN_H)
+check_include_files(inttypes.h HAVE_INTTYPES_H)
+check_include_files(memory.h HAVE_MEMORY_H)
+check_include_files(stdbool.h HAVE_STDBOOL_H)
+check_include_files(stdint.h HAVE_STDINT_H)
+check_include_files(stdlib.h HAVE_STDLIB_H)
+check_include_files(strings.h HAVE_STRINGS_H)
+check_include_files(string.h HAVE_STRING_H)
+check_include_files(sys/byteswap.h HAVE_SYS_BYTESWAP_H)
+check_include_files(sys/stat.h HAVE_SYS_STAT_H)
+check_include_files(sys/types.h HAVE_SYS_TYPES_H)
+check_include_files(unistd.h HAVE_UNISTD_H)
+check_function_exists(fnmatch HAVE_FNMATCH)
+
+set(SIZE_FORMAT "zi")
+check_c_source_compiles("#include <stdio.h>\nint main(int argc, char **argv) { size_t value = 0; printf(\"%${SIZE_FORMAT}\", value); return 0; }" SIZE_FORMAT_ZI)
+if(NOT SIZE_FORMAT_ZI)
+	set(SIZE_FORMAT "i")
+	check_c_source_compiles("#include <stdio.h>\nint main(int argc, char **argv) { size_t value = 0; printf(\"%${SIZE_FORMAT}\", value); return 0; }" SIZE_FORMAT_I)
+	if(NOT SIZE_FORMAT_I)
+		set(SIZE_FORMAT "li")
+		check_c_source_compiles("#include <stdio.h>\nint main(int argc, char **argv) { size_t value = 0; printf(\"%${SIZE_FORMAT}\", value); return 0; }" SIZE_FORMAT_LI)
+		if(NOT SIZE_FORMAT_LI)
+			message(FATAL_ERROR "You must be using a really weird platform!")
+		endif()
+	endif()
+endif()
+
+find_package(ZLIB REQUIRED)
+find_package(OpenSSL)
+
+if (${OPENSSL_FOUND})
+	option(USE_OUR_OWN_MD5 "Build using own md5 implementation" OFF)
+else()
+	option(USE_OUR_OWN_MD5 "Build using own md5 implementation" ON)
+endif()
+
+message(STATUS "OPENSSL_FOUND: ${OPENSSL_FOUND}")
+message(STATUS "USE_OUR_OWN_MD5: ${USE_OUR_OWN_MD5}")
+message(STATUS "BUILD_STATIC: ${BUILD_STATIC}")
+
+add_definitions(-DHAVE_CONFIG_H)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/unshield_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/lib/unshield_config.h)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libunshield.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libunshield.pc @ONLY)
+
+# To force position independent code for static libs on Linux x64
+if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
+    add_definitions(-fPIC)
+endif()
+
+add_subdirectory(lib)
+add_subdirectory(src)
+
+install(FILES man/unshield.1 DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1)
+install(FILES libunshield.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 39601c1..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-## Makefile.am -- Process this file with automake to produce Makefile.in
- at SET_MAKE@
-
-## don't complain about missing AUTHORS, NEWS, ChangeLog, etc
-AUTOMAKE_OPTIONS = foreign 1.4
-
-pcfiles = libunshield.pc
-
-all_local: $(pcfiles)
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(pcfiles)
-
-EXTRA_DIST = libunshield.pc.in LICENSE
-
-CLEANFILES = $(pcfiles)
-
-SUBDIRS = lib src man
diff --git a/README b/README.md
similarity index 93%
rename from README
rename to README.md
index 0475400..4cfc190 100644
--- a/README
+++ b/README.md
@@ -1,15 +1,11 @@
-vim: tw=65 wrap
-
-CONTENTS
+UNSHIELD
 ========
 
-Dictionary
-About Unshield
-License
+[![Build Status](https://travis-ci.org/twogood/unshield.png?branch=master)](https://travis-ci.org/twogood/unshield)
 
 
 DICTIONARY
-==========
+----------
 
 InstallShield (IS): see www.installshield.com
 
@@ -19,7 +15,7 @@ Microsoft Cabinet File (MSCF): A .cab file used by Microsoft.
 
 
 ABOUT UNSHIELD
-==============
+--------------
 
 To install a Pocket PC application remotely, an installable
 Microsoft Cabinet File is copied to the /Windows/AppMgr/Install
@@ -71,7 +67,7 @@ implementation are:
 
 
 LICENSE
-=======
+-------
 
 Unshield uses the MIT license. The short version is "do as you
 like, but don't blame me if anything goes wrong".
diff --git a/TODO b/TODO
deleted file mode 100644
index a754758..0000000
--- a/TODO
+++ /dev/null
@@ -1,7 +0,0 @@
-$Id$
-
-TODO for Unshield
-=================
-
-- Support "encrypted" files
-
diff --git a/VERSION b/VERSION
deleted file mode 100644
index d3827e7..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-1.0
diff --git a/bootstrap b/bootstrap
deleted file mode 100755
index aad3493..0000000
--- a/bootstrap
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-set -e
-VERSION=`cat VERSION`
-
-if [ -z "$VERSION" ]; then
-	echo "Empty version"
-	exit 1
-fi
-
-# create configure.ac with correct version number
-ACFILE="configure.ac"
-ACFILE_IN="$ACFILE.in"
-if [ -f $ACFILE ]; then
-	rm $ACFILE
-fi
-echo -n "Creating $ACFILE..."
-cat $ACFILE_IN | sed "s/\\(AC_INIT(.*,\\).*)/\\1 $VERSION)/" > $ACFILE
-if [ -s $ACFILE ]; then
-	echo "done."
-else
-	exit 1
-fi
-
-rm -f config.cache
-if [ -d "m4" ]; then
-	INCLUDES="-I m4"
-fi
-set -x
-aclocal $INCLUDES
-autoheader
-
-# Check For OSX
-# rhcp011235 at gmail.com
-
-KERNEL_NAME=`uname -s`
-if [ "$KERNEL_NAME" = "Darwin" ]; then
-	glibtoolize --copy --automake
-else
-	libtoolize --copy --automake
-fi
-automake --copy --foreign --add-missing
-autoconf
diff --git a/config.rpath b/config.rpath
deleted file mode 100755
index 5ead758..0000000
--- a/config.rpath
+++ /dev/null
@@ -1,513 +0,0 @@
-#! /bin/sh
-# Output a system dependent set of variables, describing how to set the
-# run time search path of shared libraries in an executable.
-#
-#   Copyright 1996-2002 Free Software Foundation, Inc.
-#   Taken from GNU libtool, 2001
-#   Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#   General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#   As a special exception to the GNU General Public License, if you
-#   distribute this file as part of a program that contains a
-#   configuration script generated by Autoconf, you may include it under
-#   the same distribution terms that you use for the rest of that program.
-#
-# The first argument passed to this file is the canonical host specification,
-#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or
-#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
-# should be set by the caller.
-#
-# The set of defined variables is at the end of this script.
-
-# All known linkers require a `.a' archive for static linking (except M$VC,
-# which needs '.lib').
-libext=a
-shlibext=
-
-host="$1"
-host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-wl=
-if test "$GCC" = yes; then
-  wl='-Wl,'
-else
-  case "$host_os" in
-    aix3* | aix4* | aix5*)
-      wl='-Wl,'
-      ;;
-    hpux9* | hpux10* | hpux11*)
-      wl='-Wl,'
-      ;;
-    irix5* | irix6*)
-      wl='-Wl,'
-      ;;
-    linux*)
-      echo '__INTEL_COMPILER' > conftest.$ac_ext
-      if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
-      then
-        :
-      else
-        # Intel icc
-        wl='-Qoption,ld,'
-      fi
-      ;;
-    osf3* | osf4* | osf5*)
-      wl='-Wl,'
-      ;;
-    solaris*)
-      wl='-Wl,'
-      ;;
-    sunos4*)
-      wl='-Qoption ld '
-      ;;
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      if test "x$host_vendor" = xsni; then
-        wl='-LD'
-      else
-        wl='-Wl,'
-      fi
-      ;;
-  esac
-fi
-
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-
-case "$host_os" in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-esac
-
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
-  case "$host_os" in
-    aix3* | aix4* | aix5*)
-      # On AIX, the GNU linker is very broken
-      ld_shlibs=no
-      ;;
-    amigaos*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can use
-      # them.
-      ld_shlibs=no
-      ;;
-    beos*)
-      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-        :
-      else
-        ld_shlibs=no
-      fi
-      ;;
-    cygwin* | mingw* | pw32*)
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      ;;
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
-        ld_shlibs=no
-      elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-        :
-      else
-        ld_shlibs=no
-      fi
-      ;;
-    sunos4*)
-      hardcode_direct=yes
-      ;;
-    *)
-      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-        :
-      else
-        ld_shlibs=no
-      fi
-      ;;
-  esac
-  if test "$ld_shlibs" = yes; then
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-  fi
-else
-  case "$host_os" in
-    aix3*)
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L=yes
-      if test "$GCC" = yes; then
-        # Neither direct hardcoding nor static linking is supported with a
-        # broken collect2.
-        hardcode_direct=unsupported
-      fi
-      ;;
-    aix4* | aix5*)
-      if test "$host_cpu" = ia64; then
-        # On IA64, the linker does run time linking by default, so we don't
-        # have to do anything special.
-        aix_use_runtimelinking=no
-      else
-        aix_use_runtimelinking=no
-        # Test if we are trying to use run time linking or normal
-        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-        # need to do runtime linking.
-        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
-          for ld_flag in $LDFLAGS; do
-            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-              aix_use_runtimelinking=yes
-              break
-            fi
-          done
-        esac
-      fi
-      hardcode_direct=yes
-      hardcode_libdir_separator=':'
-      if test "$GCC" = yes; then
-        case $host_os in aix4.[012]|aix4.[012].*)
-          collect2name=`${CC} -print-prog-name=collect2`
-          if test -f "$collect2name" && \
-            strings "$collect2name" | grep resolve_lib_name >/dev/null
-          then
-            # We have reworked collect2
-            hardcode_direct=yes
-          else
-            # We have old collect2
-            hardcode_direct=unsupported
-            hardcode_minus_L=yes
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_libdir_separator=
-          fi
-        esac
-      fi
-      if test "$aix_use_runtimelinking" = yes; then
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
-      else
-        if test "$host_cpu" = ia64; then
-          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-        else
-          hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
-        fi
-      fi
-      ;;
-    amigaos*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs=no
-      ;;
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec=' '
-      libext=lib
-      ;;
-    darwin* | rhapsody*)
-      hardcode_direct=yes
-      ;;
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-    freebsd2.2*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      ;;
-    freebsd2*)
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      ;;
-    freebsd*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      ;;
-    hpux9* | hpux10* | hpux11*)
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_direct=yes
-      hardcode_minus_L=yes # Not in the search PATH, but as the default
-                           # location of the library.
-      ;;
-    irix5* | irix6*)
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-    netbsd*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      ;;
-    newsos6)
-      hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-    openbsd*)
-      hardcode_direct=yes
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      else
-        case "$host_os" in
-          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-            hardcode_libdir_flag_spec='-R$libdir'
-            ;;
-          *)
-            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-            ;;
-        esac
-      fi
-      ;;
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      ;;
-    osf3*)
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-    osf4* | osf5*)
-      if test "$GCC" = yes; then
-        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      else
-        # Both cc and cxx compiler support -rpath directly
-        hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      hardcode_libdir_separator=:
-      ;;
-    sco3.2v5*)
-      ;;
-    solaris*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      ;;
-    sunos4*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      ;;
-    sysv4)
-      if test "x$host_vendor" = xsno; then
-        hardcode_direct=yes # is this really true???
-      else
-        hardcode_direct=no # Motorola manual says yes, but my tests say they lie
-      fi
-      ;;
-    sysv4.3*)
-      ;;
-    sysv5*)
-      hardcode_libdir_flag_spec=
-      ;;
-    uts4*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      ;;
-    dgux*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-        ld_shlibs=yes
-      fi
-      ;;
-    sysv4.2uw2*)
-      hardcode_direct=yes
-      hardcode_minus_L=no
-      ;;
-    sysv5uw7* | unixware7*)
-      ;;
-    *)
-      ld_shlibs=no
-      ;;
-  esac
-fi
-
-# Check dynamic linker characteristics
-libname_spec='lib$name'
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-case "$host_os" in
-  aix3*)
-    shlibext=so
-    ;;
-  aix4* | aix5*)
-    shlibext=so
-    ;;
-  amigaos*)
-    shlibext=ixlibrary
-    ;;
-  beos*)
-    shlibext=so
-    ;;
-  bsdi4*)
-    shlibext=so
-    sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-    sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-    ;;
-  cygwin* | mingw* | pw32*)
-    case $GCC,$host_os in
-      yes,cygwin*)
-        shlibext=dll.a
-        ;;
-      yes,mingw*)
-        shlibext=dll
-        sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
-        ;;
-      yes,pw32*)
-        shlibext=dll
-        ;;
-      *)
-        shlibext=dll
-        ;;
-    esac
-    ;;
-  darwin* | rhapsody*)
-    shlibext=dylib
-    ;;
-  freebsd1*)
-    ;;
-  freebsd*)
-    shlibext=so
-    ;;
-  gnu*)
-    shlibext=so
-    ;;
-  hpux9* | hpux10* | hpux11*)
-    shlibext=sl
-    ;;
-  irix5* | irix6*)
-    shlibext=so
-    case "$host_os" in
-      irix5*)
-        libsuff= shlibsuff=
-        ;;
-      *)
-        case $LD in
-          *-32|*"-32 ") libsuff= shlibsuff= ;;
-          *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
-          *-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
-          *) libsuff= shlibsuff= ;;
-        esac
-        ;;
-    esac
-    sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-    sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-    ;;
-  linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
-    ;;
-  linux-gnu*)
-    shlibext=so
-    ;;
-  netbsd*)
-    shlibext=so
-    ;;
-  newsos6)
-    shlibext=so
-    ;;
-  openbsd*)
-    shlibext=so
-    ;;
-  os2*)
-    libname_spec='$name'
-    shlibext=dll
-    ;;
-  osf3* | osf4* | osf5*)
-    shlibext=so
-    sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-    sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-    ;;
-  sco3.2v5*)
-    shlibext=so
-    ;;
-  solaris*)
-    shlibext=so
-    ;;
-  sunos4*)
-    shlibext=so
-    ;;
-  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-    shlibext=so
-    case "$host_vendor" in
-      motorola)
-        sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-        ;;
-    esac
-    ;;
-  uts4*)
-    shlibext=so
-    ;;
-  dgux*)
-    shlibext=so
-    ;;
-  sysv4*MP*)
-    if test -d /usr/nec; then
-      shlibext=so
-    fi
-    ;;
-esac
-
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
-escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-
-sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
-
-# How to pass a linker flag through the compiler.
-wl="$escaped_wl"
-
-# Static library suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally "so").
-shlibext="$shlibext"
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator="$hardcode_libdir_separator"
-
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct="$hardcode_direct"
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L="$hardcode_minus_L"
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
-
-EOF
diff --git a/configure.ac.in b/configure.ac.in
deleted file mode 100644
index 8392a3e..0000000
--- a/configure.ac.in
+++ /dev/null
@@ -1,121 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT([unshield], [YOU_DID_NOT_RUN_THE_BOOTSTRAP_SCRIPT])
-AC_CONFIG_SRCDIR([lib/libunshield.h])
-
-AC_CANONICAL_HOST
-AC_CANONICAL_TARGET
-
-AM_INIT_AUTOMAKE
-AC_CONFIG_HEADERS(lib/unshield_config.h)
-
-CFLAGS="-Wall -Wsign-compare -Wno-long-long $CFLAGS"
-
-case $target in
-
-	powerpc-apple-*)
-		dnl Prevent "Undefined Macro argument list" error.
-		CFLAGS="-no-cpp-precomp $CFLAGS"
-		;;
-
-esac
-
-dnl Checks for programs.
-AC_PROG_AWK
-AC_PROG_CC
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_LIBTOOL
-AC_PROG_MAKE_SET
-dnl AM_PATH_CHECK()
-
-dnl Checks for libraries.
-AC_LIB_RPATH
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-SAVED_CFLAGS="$CFLAGS"
-CFLAGS=""
-AC_C_CONST
-CFLAGS="$SAVED_CFLAGS"
-
-dnl Big-endian stuff
-AC_SUBST(WORDS_BIGENDIAN)
-AC_SUBST(BYTESWAP_HEADER,dummy)
-AC_SUBST(HAVE_BYTESWAP_HEADER,0)
-
-AC_C_BIGENDIAN()
-
-if test "$ac_cv_c_bigendian" = yes; then
-  WORDS_BIGENDIAN=1
-  AC_CHECK_HEADERS(sys/byteswap.h,[BYTESWAP_HEADER=sys/byteswap.h; HAVE_BYTESWAP_HEADER=1])
-  AC_CHECK_HEADERS(byteswap.h,    [BYTESWAP_HEADER=byteswap.h;     HAVE_BYTESWAP_HEADER=1])
-else
-  WORDS_BIGENDIAN=0
-fi
-
-dnl Check where uint16_t and uint32_t may be found
-AC_SUBST(INT_HEADER)
-
-dnl Old compilers
-AC_CHECK_HEADERS(inttypes.h,[INT_HEADER=inttypes.h])
-
-dnl C99 compliant compilers
-AC_CHECK_HEADERS(stdint.h,[INT_HEADER=stdint.h])
-
-if test -z "$INT_HEADER"; then
-	AC_MSG_ERROR([Don't know how to get uint16_t and uint32_t on your system])
-fi
-
-AC_CHECK_HEADERS(stdbool.h,,[
-  AC_MSG_ERROR([Don't know how to get bool values on your system])
-])
-
-AC_MSG_CHECKING([for printf format string that works with size_t values])
-SAVED_CFLAGS="$CFLAGS"
-CFLAGS="-ansi -Wall -Werror"
-AC_TRY_COMPILE([#include <stdio.h>],
-               [size_t value = 0; printf("%zi", value);],
-               [SIZE_FORMAT="zi"],
-               [AC_TRY_COMPILE([#include <stdio.h>],
-                               [size_t value = 0; printf("%i", value);],
-                               [SIZE_FORMAT="i"],
-                               [AC_TRY_COMPILE([#include <stdio.h>],
-                                               [size_t value = 0; printf("%li", value);],
-                                               [SIZE_FORMAT="li"],
-                                               [AC_MSG_RESULT([Failed!])
-                                                AC_MSG_ERROR([You must be using a really weird platform!])])
-                                ])
-               ])
-AC_MSG_RESULT([${SIZE_FORMAT}])
-AC_DEFINE_UNQUOTED(SIZE_FORMAT, 
-                   ["${SIZE_FORMAT}"],
-                   [printf format that works with size_t values])
-CFLAGS="$SAVED_CFLAGS"
-
-
-# http://www.gnu.org/manual/autoconf-2.53/html_node/AC_LIBOBJ-vs.-LIBOBJS.html
-# This is necessary so that .o files in LIBOBJS are also built via
-# the ANSI2KNR-filtering rules.
-LIB@&t at OBJS=`echo "$LIB@&t at OBJS" | sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
-LTLIBOBJS=`echo "$LIB@&t at OBJS" | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
-AC_SUBST(LTLIBOBJS)
-
-CHECK_ZLIB()
-
-CHECK_SSL()
-if test x$HAVE_SSL = xyes; then
-  USE_OUR_OWN_MD5=0
-else
-  USE_OUR_OWN_MD5=1
-fi
-AC_DEFINE_UNQUOTED([USE_OUR_OWN_MD5], [$USE_OUR_OWN_MD5], [Defined if we should use our own MD5 routines.])
-AM_CONDITIONAL(USE_OUR_OWN_MD5, [test x$HAVE_SSL != xyes])
-
-AC_FUNC_FNMATCH
-
-AC_OUTPUT([libunshield.pc
-           Makefile
-           man/Makefile
-           lib/convert_utf/Makefile
-           lib/md5/Makefile
-           lib/Makefile
-           src/Makefile])
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100644
index 0000000..917c8b7
--- /dev/null
+++ b/lib/CMakeLists.txt
@@ -0,0 +1,43 @@
+add_subdirectory(convert_utf)
+
+if(USE_OUR_OWN_MD5)
+    add_subdirectory(md5)
+endif()
+
+set(LIBUNSHIELD_HEADES
+    "internal.h"
+    "libunshield.h"
+    "log.h"
+    "cabfile.h"
+)
+
+set(LIBUNSHIELD_SOURCES
+    "bswap.c"
+    "component.c"
+    "directory.c"
+    "file.c"
+    "file_group.c"
+    "helper.c"
+    "libunshield.c"
+    "log.c"
+)
+
+if(BUILD_STATIC)
+    set(LIBUNSHIELD_LIBRARY_TYPE STATIC)
+else()
+    set(LIBUNSHIELD_LIBRARY_TYPE SHARED)
+endif()
+
+add_library(libunshield ${LIBUNSHIELD_LIBRARY_TYPE} ${LIBUNSHIELD_HEADES} ${LIBUNSHIELD_SOURCES})
+
+if(USE_OUR_OWN_MD5)
+    target_link_libraries(libunshield ${ZLIB_LIBRARY} md5 convert_utf)
+else()
+    target_link_libraries(libunshield ${ZLIB_LIBRARY} ${OPENSSL_LIBRARIES} convert_utf)
+endif()
+
+set_target_properties(libunshield PROPERTIES OUTPUT_NAME unshield)
+set_target_properties(libunshield PROPERTIES SOVERSION ${PROJECT_VERSION})
+
+install(TARGETS libunshield RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(FILES libunshield.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
\ No newline at end of file
diff --git a/lib/Makefile.am b/lib/Makefile.am
deleted file mode 100644
index d5cb492..0000000
--- a/lib/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-if USE_OUR_OWN_MD5
-MD5_SUBDIR = md5
-MD5_LIBS = md5/libmd5.la
-else
-MD5_SUBDIR =
-MD5_LIBS =
-endif
-
-## useful flags
-AM_CPPFLAGS = -I..
-
-## create this library
-lib_LTLIBRARIES = libunshield.la
-
-## use these sources
-libunshield_la_SOURCES = \
-	bswap.c \
-	component.c \
-	directory.c \
-	file.c \
-	file_group.c \
-	helper.c \
-	internal.h \
-	libunshield.h libunshield.c \
-	log.h log.c \
-	cabfile.h
-
-libunshield_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libunshield_la_LIBADD  = convert_utf/libconvert_utf.la $(MD5_LIBS) 
-
-include_HEADERS = libunshield.h
-
-SUBDIRS = convert_utf $(MD5_SUBDIR) .
diff --git a/lib/convert_utf/CMakeLists.txt b/lib/convert_utf/CMakeLists.txt
new file mode 100644
index 0000000..eb60fe3
--- /dev/null
+++ b/lib/convert_utf/CMakeLists.txt
@@ -0,0 +1,9 @@
+set(LIBCONVERT_UTF_HEADES
+    "ConvertUTF.h"
+)
+
+set(LIBCONVERT_UTF_SOURCES
+    "ConvertUTF.c"
+)
+
+add_library(convert_utf ${LIBCONVERT_UTF_HEADES} ${LIBCONVERT_UTF_SOURCES})
\ No newline at end of file
diff --git a/lib/convert_utf/Makefile.am b/lib/convert_utf/Makefile.am
deleted file mode 100644
index 92fd94b..0000000
--- a/lib/convert_utf/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-AM_CPPFLAGS = -I..
-
-## create this library
-noinst_LTLIBRARIES = libconvert_utf.la
-
-## use these sources
-libconvert_utf_la_SOURCES = \
-	ConvertUTF.h ConvertUTF.c	
-
diff --git a/lib/file.c b/lib/file.c
index a18e35b..f08dd7d 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -15,6 +15,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/param.h>    /* for MIN(a,b) */
+#ifndef MIN /* missing in some platforms */
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
 #include <zlib.h>
 
 #define VERBOSE 3
diff --git a/lib/helper.c b/lib/helper.c
index ee485c8..77ce512 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -174,7 +174,7 @@ static const char* unshield_utf16_to_utf8(Header* header, const uint16_t* utf16)
 
 const char* unshield_get_utf8_string(Header* header, const void* buffer)
 {
-  if (header->major_version == 18 && buffer != NULL)
+  if (header->major_version >= 17 && buffer != NULL)
   {
     return unshield_utf16_to_utf8(header, (const uint16_t*)buffer);
   }
diff --git a/lib/md5/CMakeLists.txt b/lib/md5/CMakeLists.txt
new file mode 100644
index 0000000..65a9e3a
--- /dev/null
+++ b/lib/md5/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(LIBMD5_UTF_HEADES
+	"global.h"
+    "md5.h"
+)
+
+set(LIBMD5_UTF_SOURCES
+    "md5c.c"
+)
+
+add_library(md5 ${LIBMD5_UTF_HEADES} ${LIBMD5_UTF_SOURCES})
\ No newline at end of file
diff --git a/lib/md5/Makefile.am b/lib/md5/Makefile.am
deleted file mode 100644
index d6ed381..0000000
--- a/lib/md5/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-AM_CPPFLAGS = -I..
-
-## create this library
-noinst_LTLIBRARIES = libmd5.la
-
-## use these sources
-libmd5_la_SOURCES = \
-	md5.h md5c.c global.h
-
diff --git a/lib/unshield_config.h.in b/lib/unshield_config.h.in
new file mode 100644
index 0000000..846ab9d
--- /dev/null
+++ b/lib/unshield_config.h.in
@@ -0,0 +1,74 @@
+/* Define to 1 if you have the <byteswap.h> header file. */
+#cmakedefine HAVE_BYTESWAP_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#cmakedefine HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/byteswap.h> header file. */
+#cmakedefine HAVE_SYS_BYTESWAP_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H 1
+
+/* Name of package */
+#define PACKAGE "@PROJECT_NAME@"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "@PROJECT_NAME@"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "@PROJECT_NAME@ @PROJECT_VERSION@"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "@PROJECT_NAME@"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "@PROJECT_VERSION@"
+
+/* printf format that works with size_t values */
+#cmakedefine SIZE_FORMAT "@SIZE_FORMAT@"
+
+/* Define to 1 if your system has a working POSIX `fnmatch' function. */
+#cmakedefine HAVE_FNMATCH 1
+
+/* Defined if we should use our own MD5 routines. */
+#cmakedefine01 USE_OUR_OWN_MD5
+
+/* Version number of package */
+#define VERSION "@PROJECT_VERSION@"
+
+/* Enable GNU style printf formatters */
+#define __USE_MINGW_ANSI_STDIO 1
diff --git a/libunshield.pc.in b/libunshield.pc.in
index eefcdf9..fb7aaaa 100644
--- a/libunshield.pc.in
+++ b/libunshield.pc.in
@@ -1,10 +1,10 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_FULL_BINDIR@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
 
 Name: libunshield
 Description: Library to extract CAB files from InstallShield installers
-Version: @VERSION@
+Version: @PROJECT_VERSION@
 Libs: -L${libdir} -lunshield
 Cflags: -I${includedir}
diff --git a/m4/check_ssl.m4 b/m4/check_ssl.m4
deleted file mode 100644
index 0cff947..0000000
--- a/m4/check_ssl.m4
+++ /dev/null
@@ -1,64 +0,0 @@
-dnl @synopsis CHECK_SSL
-dnl
-dnl This macro will check various standard spots for OpenSSL including
-dnl a user-supplied directory. The user uses '--with-ssl' or
-dnl '--with-ssl=/path/to/ssl' as arguments to configure.
-dnl
-dnl If OpenSSL is found the include directory gets added to CFLAGS and
-dnl CXXFLAGS as well as '-DHAVE_SSL', '-lssl' & '-lcrypto' get added to
-dnl LIBS, and the libraries location gets added to LDFLAGS. Finally
-dnl 'HAVE_SSL' gets set to 'yes' for use in your Makefile.in I use it
-dnl like so (valid for gmake):
-dnl
-dnl     HAVE_SSL = @HAVE_SSL@
-dnl     ifeq ($(HAVE_SSL),yes)
-dnl         SRCS+= @srcdir@/my_file_that_needs_ssl.c
-dnl     endif
-dnl
-dnl For bsd 'bmake' use:
-dnl
-dnl     .if ${HAVE_SSL} == "yes"
-dnl         SRCS+= @srcdir@/my_file_that_needs_ssl.c
-dnl     .endif
-dnl
-dnl @category InstalledPackages
-dnl @author Mark Ethan Trostler <trostler at juniper.net>
-dnl @version 2003-01-28
-dnl @license AllPermissive
-
-AC_DEFUN([CHECK_SSL],
-[AC_MSG_CHECKING(if ssl is wanted)
-AC_ARG_WITH(ssl,
-[  --with-ssl enable ssl [will check /usr/local/ssl
-                            /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr ]
-],
-[   AC_MSG_RESULT(yes)
-    for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
-        ssldir="$dir"
-        if test -f "$dir/include/openssl/ssl.h"; then
-            found_ssl="yes";
-            CFLAGS="$CFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
-            CXXFLAGS="$CXXFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
-            break;
-        fi
-        if test -f "$dir/include/ssl.h"; then
-            found_ssl="yes";
-            CFLAGS="$CFLAGS -I$ssldir/include/ -DHAVE_SSL";
-            CXXFLAGS="$CXXFLAGS -I$ssldir/include/ -DHAVE_SSL";
-            break
-        fi
-    done
-    if test x_$found_ssl != x_yes; then
-        AC_MSG_ERROR(Cannot find ssl libraries)
-    else
-        printf "OpenSSL found in $ssldir\n";
-        LIBS="$LIBS -lssl -lcrypto";
-        LDFLAGS="$LDFLAGS -L$ssldir/lib";
-        HAVE_SSL=yes
-    fi
-    AC_SUBST(HAVE_SSL)
-],
-[
-    AC_MSG_RESULT(no)
-])
-])dnl
diff --git a/m4/check_zlib.m4 b/m4/check_zlib.m4
deleted file mode 100644
index 3c7182b..0000000
--- a/m4/check_zlib.m4
+++ /dev/null
@@ -1,82 +0,0 @@
-dnl @synopsis CHECK_ZLIB()
-dnl
-dnl This macro searches for an installed zlib library. If nothing
-dnl was specified when calling configure, it searches first in /usr/local
-dnl and then in /usr. If the --with-zlib=DIR is specified, it will try
-dnl to find it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib
-dnl is specified, the library is not searched at all.
-dnl
-dnl If either the header file (zlib.h) or the library (libz) is not
-dnl found, the configuration exits on error, asking for a valid
-dnl zlib installation directory or --without-zlib.
-dnl
-dnl The macro defines the symbol HAVE_LIBZ if the library is found. You should
-dnl use autoheader to include a definition for this symbol in a config.h
-dnl file. Sample usage in a C/C++ source is as follows:
-dnl
-dnl   #ifdef HAVE_LIBZ
-dnl   #include <zlib.h>
-dnl   #endif /* HAVE_LIBZ */
-dnl
-dnl @version $Id$
-dnl @author Loic Dachary <loic at senga.org>
-dnl
-
-AC_DEFUN([CHECK_ZLIB],
-#
-# Handle user hints
-#
-[AC_MSG_CHECKING(if zlib is wanted)
-AC_ARG_WITH(zlib,
-[  --with-zlib=DIR root directory path of zlib installation [defaults to
-                    /usr/local or /usr if not found in /usr/local]
-  --without-zlib to disable zlib usage completely],
-[if test "$withval" != no ; then
-  AC_MSG_RESULT(yes)
-  ZLIB_HOME="$withval"
-else
-  AC_MSG_RESULT(no)
-fi], [
-AC_MSG_RESULT(yes)
-ZLIB_HOME=/usr/local
-if test ! -f "${ZLIB_HOME}/include/zlib.h"
-then
-        ZLIB_HOME=/usr
-fi
-])
-
-#
-# Locate zlib, if wanted
-#
-if test -n "${ZLIB_HOME}"
-then
-        ZLIB_OLD_LDFLAGS=$LDFLAGS
-        ZLIB_OLD_CPPFLAGS=$LDFLAGS
-        LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
-        CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
-        AC_LANG_SAVE
-        AC_LANG_C
-        AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
-        AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
-        AC_LANG_RESTORE
-        if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
-        then
-                #
-                # If both library and header were found, use them
-                #
-                AC_CHECK_LIB(z, inflateEnd)
-                AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
-                AC_MSG_RESULT(ok)
-        else
-                #
-                # If either header or library was not found, revert and bomb
-                #
-                AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
-                LDFLAGS="$ZLIB_OLD_LDFLAGS"
-                CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
-                AC_MSG_RESULT(failed)
-                AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)
-        fi
-fi
-
-])
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
deleted file mode 100644
index ddb5732..0000000
--- a/m4/lib-ld.m4
+++ /dev/null
@@ -1,97 +0,0 @@
-# lib-ld.m4 serial 1 (gettext-0.11)
-dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl Subroutines of libtool.m4,
-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-dnl with libtool.m4.
-
-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
-AC_DEFUN([AC_LIB_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-  acl_cv_prog_gnu_ld=yes
-else
-  acl_cv_prog_gnu_ld=no
-fi])
-with_gnu_ld=$acl_cv_prog_gnu_ld
-])
-
-dnl From libtool-1.4. Sets the variable LD.
-AC_DEFUN([AC_LIB_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by GCC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]* | [A-Za-z]:[\\/]*)]
-      [re_direlt='/[^/][^/]*/\.\./']
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(acl_cv_path_LD,
-[if test -z "$LD"; then
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
-	test "$with_gnu_ld" != no && break
-      else
-	test "$with_gnu_ld" != yes && break
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_LIB_PROG_LD_GNU
-])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
deleted file mode 100644
index 6b94251..0000000
--- a/m4/lib-link.m4
+++ /dev/null
@@ -1,554 +0,0 @@
-# lib-link.m4 serial 3 (gettext-0.11.3)
-dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
-dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
-dnl augments the CPPFLAGS variable.
-AC_DEFUN([AC_LIB_LINKFLAGS],
-[
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-  define([Name],[translit([$1],[./-], [___])])
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
-    AC_LIB_LINKFLAGS_BODY([$1], [$2])
-    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
-    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
-    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
-  ])
-  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
-  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
-  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-  AC_SUBST([LIB]NAME)
-  AC_SUBST([LTLIB]NAME)
-  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
-  dnl results of this search when this library appears as a dependency.
-  HAVE_LIB[]NAME=yes
-  undefine([Name])
-  undefine([NAME])
-])
-
-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
-dnl searches for libname and the libraries corresponding to explicit and
-dnl implicit dependencies, together with the specified include files and
-dnl the ability to compile and link the specified testcode. If found, it
-dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
-dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
-dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
-dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
-AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
-[
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-  define([Name],[translit([$1],[./-], [___])])
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-
-  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
-  dnl accordingly.
-  AC_LIB_LINKFLAGS_BODY([$1], [$2])
-
-  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
-  dnl because if the user has installed lib[]Name and not disabled its use
-  dnl via --without-lib[]Name-prefix, he wants to use it.
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-
-  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
-    ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $LIB[]NAME"
-    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
-    LIBS="$ac_save_LIBS"
-  ])
-  if test "$ac_cv_lib[]Name" = yes; then
-    HAVE_LIB[]NAME=yes
-    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
-    AC_MSG_CHECKING([how to link with lib[]$1])
-    AC_MSG_RESULT([$LIB[]NAME])
-  else
-    HAVE_LIB[]NAME=no
-    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
-    dnl $INC[]NAME either.
-    CPPFLAGS="$ac_save_CPPFLAGS"
-    LIB[]NAME=
-    LTLIB[]NAME=
-  fi
-  AC_SUBST([HAVE_LIB]NAME)
-  AC_SUBST([LIB]NAME)
-  AC_SUBST([LTLIB]NAME)
-  undefine([Name])
-  undefine([NAME])
-])
-
-dnl Determine the platform dependent parameters needed to use rpath:
-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
-dnl hardcode_direct, hardcode_minus_L,
-dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
-AC_DEFUN([AC_LIB_RPATH],
-[
-  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
-  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
-  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
-  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
-  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
-    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
-    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-    . ./conftest.sh
-    rm -f ./conftest.sh
-    acl_cv_rpath=done
-  ])
-  wl="$acl_cv_wl"
-  libext="$acl_cv_libext"
-  shlibext="$acl_cv_shlibext"
-  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  hardcode_direct="$acl_cv_hardcode_direct"
-  hardcode_minus_L="$acl_cv_hardcode_minus_L"
-  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
-  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
-  dnl Determine whether the user wants rpath handling at all.
-  AC_ARG_ENABLE(rpath,
-    [  --disable-rpath         do not hardcode runtime library paths],
-    :, enable_rpath=yes)
-])
-
-dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
-dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
-AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
-[
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  dnl By default, look in $includedir and $libdir.
-  use_additional=yes
-  AC_LIB_WITH_FINAL_PREFIX([
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
-  ])
-  AC_ARG_WITH([lib$1-prefix],
-[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
-  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
-[
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
-        AC_LIB_WITH_FINAL_PREFIX([
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
-        ])
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
-      fi
-    fi
-])
-  dnl Search the library and its dependencies in $additional_libdir and
-  dnl $LDFLAGS. Using breadth-first-seach.
-  LIB[]NAME=
-  LTLIB[]NAME=
-  INC[]NAME=
-  rpathdirs=
-  ltrpathdirs=
-  names_already_handled=
-  names_next_round='$1 $2'
-  while test -n "$names_next_round"; do
-    names_this_round="$names_next_round"
-    names_next_round=
-    for name in $names_this_round; do
-      already_handled=
-      for n in $names_already_handled; do
-        if test "$n" = "$name"; then
-          already_handled=yes
-          break
-        fi
-      done
-      if test -z "$already_handled"; then
-        names_already_handled="$names_already_handled $name"
-        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
-        dnl or AC_LIB_HAVE_LINKFLAGS call.
-        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
-        eval value=\"\$HAVE_LIB$uppername\"
-        if test -n "$value"; then
-          if test "$value" = yes; then
-            eval value=\"\$LIB$uppername\"
-            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
-            eval value=\"\$LTLIB$uppername\"
-            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
-          else
-            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
-            dnl that this library doesn't exist. So just drop it.
-            :
-          fi
-        else
-          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
-          dnl and the already constructed $LIBNAME/$LTLIBNAME.
-          found_dir=
-          found_la=
-          found_so=
-          found_a=
-          if test $use_additional = yes; then
-            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
-              found_dir="$additional_libdir"
-              found_so="$additional_libdir/lib$name.$shlibext"
-              if test -f "$additional_libdir/lib$name.la"; then
-                found_la="$additional_libdir/lib$name.la"
-              fi
-            else
-              if test -f "$additional_libdir/lib$name.$libext"; then
-                found_dir="$additional_libdir"
-                found_a="$additional_libdir/lib$name.$libext"
-                if test -f "$additional_libdir/lib$name.la"; then
-                  found_la="$additional_libdir/lib$name.la"
-                fi
-              fi
-            fi
-          fi
-          if test "X$found_dir" = "X"; then
-            for x in $LDFLAGS $LTLIB[]NAME; do
-              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-              case "$x" in
-                -L*)
-                  dir=`echo "X$x" | sed -e 's/^X-L//'`
-                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
-                    found_dir="$dir"
-                    found_so="$dir/lib$name.$shlibext"
-                    if test -f "$dir/lib$name.la"; then
-                      found_la="$dir/lib$name.la"
-                    fi
-                  else
-                    if test -f "$dir/lib$name.$libext"; then
-                      found_dir="$dir"
-                      found_a="$dir/lib$name.$libext"
-                      if test -f "$dir/lib$name.la"; then
-                        found_la="$dir/lib$name.la"
-                      fi
-                    fi
-                  fi
-                  ;;
-              esac
-              if test "X$found_dir" != "X"; then
-                break
-              fi
-            done
-          fi
-          if test "X$found_dir" != "X"; then
-            dnl Found the library.
-            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
-            if test "X$found_so" != "X"; then
-              dnl Linking with a shared library. We attempt to hardcode its
-              dnl directory into the executable's runpath, unless it's the
-              dnl standard /usr/lib.
-              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
-                dnl No hardcoding is needed.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-              else
-                dnl Use an explicit option to hardcode DIR into the resulting
-                dnl binary.
-                dnl Potentially add DIR to ltrpathdirs.
-                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
-                haveit=
-                for x in $ltrpathdirs; do
-                  if test "X$x" = "X$found_dir"; then
-                    haveit=yes
-                    break
-                  fi
-                done
-                if test -z "$haveit"; then
-                  ltrpathdirs="$ltrpathdirs $found_dir"
-                fi
-                dnl The hardcoding into $LIBNAME is system dependent.
-                if test "$hardcode_direct" = yes; then
-                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
-                  dnl resulting binary.
-                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                else
-                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
-                    dnl Use an explicit option to hardcode DIR into the resulting
-                    dnl binary.
-                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                    dnl Potentially add DIR to rpathdirs.
-                    dnl The rpathdirs will be appended to $LIBNAME at the end.
-                    haveit=
-                    for x in $rpathdirs; do
-                      if test "X$x" = "X$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      rpathdirs="$rpathdirs $found_dir"
-                    fi
-                  else
-                    dnl Rely on "-L$found_dir".
-                    dnl But don't add it if it's already contained in the LDFLAGS
-                    dnl or the already constructed $LIBNAME
-                    haveit=
-                    for x in $LDFLAGS $LIB[]NAME; do
-                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                      if test "X$x" = "X-L$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
-                    fi
-                    if test "$hardcode_minus_L" != no; then
-                      dnl FIXME: Not sure whether we should use
-                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                      dnl here.
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                    else
-                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
-                      dnl here, because this doesn't fit in flags passed to the
-                      dnl compiler. So give up. No hardcoding. This affects only
-                      dnl very old systems.
-                      dnl FIXME: Not sure whether we should use
-                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                      dnl here.
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-                    fi
-                  fi
-                fi
-              fi
-            else
-              if test "X$found_a" != "X"; then
-                dnl Linking with a static library.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
-              else
-                dnl We shouldn't come here, but anyway it's good to have a
-                dnl fallback.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
-              fi
-            fi
-            dnl Assume the include files are nearby.
-            additional_includedir=
-            case "$found_dir" in
-              */lib | */lib/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
-                additional_includedir="$basedir/include"
-                ;;
-            esac
-            if test "X$additional_includedir" != "X"; then
-              dnl Potentially add $additional_includedir to $INCNAME.
-              dnl But don't add it
-              dnl   1. if it's the standard /usr/include,
-              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
-              dnl   3. if it's already present in $CPPFLAGS or the already
-              dnl      constructed $INCNAME,
-              dnl   4. if it doesn't exist as a directory.
-              if test "X$additional_includedir" != "X/usr/include"; then
-                haveit=
-                if test "X$additional_includedir" = "X/usr/local/include"; then
-                  if test -n "$GCC"; then
-                    case $host_os in
-                      linux*) haveit=yes;;
-                    esac
-                  fi
-                fi
-                if test -z "$haveit"; then
-                  for x in $CPPFLAGS $INC[]NAME; do
-                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                    if test "X$x" = "X-I$additional_includedir"; then
-                      haveit=yes
-                      break
-                    fi
-                  done
-                  if test -z "$haveit"; then
-                    if test -d "$additional_includedir"; then
-                      dnl Really add $additional_includedir to $INCNAME.
-                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
-                    fi
-                  fi
-                fi
-              fi
-            fi
-            dnl Look for dependencies.
-            if test -n "$found_la"; then
-              dnl Read the .la file. It defines the variables
-              dnl dlname, library_names, old_library, dependency_libs, current,
-              dnl age, revision, installed, dlopen, dlpreopen, libdir.
-              save_libdir="$libdir"
-              case "$found_la" in
-                */* | *\\*) . "$found_la" ;;
-                *) . "./$found_la" ;;
-              esac
-              libdir="$save_libdir"
-              dnl We use only dependency_libs.
-              for dep in $dependency_libs; do
-                case "$dep" in
-                  -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
-                    dnl But don't add it
-                    dnl   1. if it's the standard /usr/lib,
-                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
-                    dnl   3. if it's already present in $LDFLAGS or the already
-                    dnl      constructed $LIBNAME,
-                    dnl   4. if it doesn't exist as a directory.
-                    if test "X$additional_libdir" != "X/usr/lib"; then
-                      haveit=
-                      if test "X$additional_libdir" = "X/usr/local/lib"; then
-                        if test -n "$GCC"; then
-                          case $host_os in
-                            linux*) haveit=yes;;
-                          esac
-                        fi
-                      fi
-                      if test -z "$haveit"; then
-                        haveit=
-                        for x in $LDFLAGS $LIB[]NAME; do
-                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LIBNAME.
-                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
-                          fi
-                        fi
-                        haveit=
-                        for x in $LDFLAGS $LTLIB[]NAME; do
-                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LTLIBNAME.
-                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
-                          fi
-                        fi
-                      fi
-                    fi
-                    ;;
-                  -R*)
-                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
-                    if test "$enable_rpath" != no; then
-                      dnl Potentially add DIR to rpathdirs.
-                      dnl The rpathdirs will be appended to $LIBNAME at the end.
-                      haveit=
-                      for x in $rpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        rpathdirs="$rpathdirs $dir"
-                      fi
-                      dnl Potentially add DIR to ltrpathdirs.
-                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
-                      haveit=
-                      for x in $ltrpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        ltrpathdirs="$ltrpathdirs $dir"
-                      fi
-                    fi
-                    ;;
-                  -l*)
-                    dnl Handle this in the next round.
-                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
-                    ;;
-                  *.la)
-                    dnl Handle this in the next round. Throw away the .la's
-                    dnl directory; it is already contained in a preceding -L
-                    dnl option.
-                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
-                    ;;
-                  *)
-                    dnl Most likely an immediate library name.
-                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
-                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
-                    ;;
-                esac
-              done
-            fi
-          else
-            dnl Didn't find the library; assume it is in the system directories
-            dnl known to the linker and runtime loader. (All the system
-            dnl directories known to the linker should also be known to the
-            dnl runtime loader, otherwise the system is severely misconfigured.)
-            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
-          fi
-        fi
-      fi
-    done
-  done
-  if test "X$rpathdirs" != "X"; then
-    if test -n "$hardcode_libdir_separator"; then
-      dnl Weird platform: only the last -rpath option counts, the user must
-      dnl pass all path elements in one option. We can arrange that for a
-      dnl single library, but not when more than one $LIBNAMEs are used.
-      alldirs=
-      for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
-      done
-      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
-      acl_save_libdir="$libdir"
-      libdir="$alldirs"
-      eval flag=\"$hardcode_libdir_flag_spec\"
-      libdir="$acl_save_libdir"
-      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-    else
-      dnl The -rpath options are cumulative.
-      for found_dir in $rpathdirs; do
-        acl_save_libdir="$libdir"
-        libdir="$found_dir"
-        eval flag=\"$hardcode_libdir_flag_spec\"
-        libdir="$acl_save_libdir"
-        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-      done
-    fi
-  fi
-  if test "X$ltrpathdirs" != "X"; then
-    dnl When using libtool, the option that works for both libraries and
-    dnl executables is -R. The -R options are cumulative.
-    for found_dir in $ltrpathdirs; do
-      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
-    done
-  fi
-])
-
-dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
-dnl unless already present in VAR.
-dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
-dnl contains two or three consecutive elements that belong together.
-AC_DEFUN([AC_LIB_APPENDTOVAR],
-[
-  for element in [$2]; do
-    haveit=
-    for x in $[$1]; do
-      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-      if test "X$x" = "X$element"; then
-        haveit=yes
-        break
-      fi
-    done
-    if test -z "$haveit"; then
-      [$1]="${[$1]}${[$1]:+ }$element"
-    fi
-  done
-])
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
deleted file mode 100644
index b8b79ab..0000000
--- a/m4/lib-prefix.m4
+++ /dev/null
@@ -1,148 +0,0 @@
-# lib-prefix.m4 serial 1 (gettext-0.11)
-dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
-dnl to access previously installed libraries. The basic assumption is that
-dnl a user will want packages to use other packages he previously installed
-dnl with the same --prefix option.
-dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
-dnl libraries, but is otherwise very convenient.
-AC_DEFUN([AC_LIB_PREFIX],
-[
-  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  dnl By default, look in $includedir and $libdir.
-  use_additional=yes
-  AC_LIB_WITH_FINAL_PREFIX([
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
-  ])
-  AC_ARG_WITH([lib-prefix],
-[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
-  --without-lib-prefix    don't search for libraries in includedir and libdir],
-[
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
-        AC_LIB_WITH_FINAL_PREFIX([
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
-        ])
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
-      fi
-    fi
-])
-  if test $use_additional = yes; then
-    dnl Potentially add $additional_includedir to $CPPFLAGS.
-    dnl But don't add it
-    dnl   1. if it's the standard /usr/include,
-    dnl   2. if it's already present in $CPPFLAGS,
-    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
-    dnl   4. if it doesn't exist as a directory.
-    if test "X$additional_includedir" != "X/usr/include"; then
-      haveit=
-      for x in $CPPFLAGS; do
-        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-        if test "X$x" = "X-I$additional_includedir"; then
-          haveit=yes
-          break
-        fi
-      done
-      if test -z "$haveit"; then
-        if test "X$additional_includedir" = "X/usr/local/include"; then
-          if test -n "$GCC"; then
-            case $host_os in
-              linux*) haveit=yes;;
-            esac
-          fi
-        fi
-        if test -z "$haveit"; then
-          if test -d "$additional_includedir"; then
-            dnl Really add $additional_includedir to $CPPFLAGS.
-            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
-          fi
-        fi
-      fi
-    fi
-    dnl Potentially add $additional_libdir to $LDFLAGS.
-    dnl But don't add it
-    dnl   1. if it's the standard /usr/lib,
-    dnl   2. if it's already present in $LDFLAGS,
-    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
-    dnl   4. if it doesn't exist as a directory.
-    if test "X$additional_libdir" != "X/usr/lib"; then
-      haveit=
-      for x in $LDFLAGS; do
-        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-        if test "X$x" = "X-L$additional_libdir"; then
-          haveit=yes
-          break
-        fi
-      done
-      if test -z "$haveit"; then
-        if test "X$additional_libdir" = "X/usr/local/lib"; then
-          if test -n "$GCC"; then
-            case $host_os in
-              linux*) haveit=yes;;
-            esac
-          fi
-        fi
-        if test -z "$haveit"; then
-          if test -d "$additional_libdir"; then
-            dnl Really add $additional_libdir to $LDFLAGS.
-            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
-          fi
-        fi
-      fi
-    fi
-  fi
-])
-
-dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
-dnl acl_final_exec_prefix, containing the values to which $prefix and
-dnl $exec_prefix will expand at the end of the configure script.
-AC_DEFUN([AC_LIB_PREPARE_PREFIX],
-[
-  dnl Unfortunately, prefix and exec_prefix get only finally determined
-  dnl at the end of configure.
-  if test "X$prefix" = "XNONE"; then
-    acl_final_prefix="$ac_default_prefix"
-  else
-    acl_final_prefix="$prefix"
-  fi
-  if test "X$exec_prefix" = "XNONE"; then
-    acl_final_exec_prefix='${prefix}'
-  else
-    acl_final_exec_prefix="$exec_prefix"
-  fi
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
-  prefix="$acl_save_prefix"
-])
-
-dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
-dnl variables prefix and exec_prefix bound to the values they will have
-dnl at the end of the configure script.
-AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
-[
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  $1
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
-])
diff --git a/man/Makefile.am b/man/Makefile.am
deleted file mode 100644
index 166a222..0000000
--- a/man/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-man_MANS = unshield.1
-
-EXTRA_DIST = $(man_MANS)
diff --git a/rebuild.sh b/rebuild.sh
index 644e9a2..b26e856 100755
--- a/rebuild.sh
+++ b/rebuild.sh
@@ -1,6 +1,4 @@
 #!/bin/sh
 set -x
 export CFLAGS="-Wall -Werror -ggdb3"
-./bootstrap &&
-./configure --prefix=/var/tmp/unshield --with-ssl &&
-make install
+cmake -DCMAKE_INSTALL_PREFIX:PATH=/var/tmp/unshield . && make && make install
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..211d4eb
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_executable(unshield "unshield.c")
+target_link_libraries(unshield libunshield)
+
+add_executable(unshield-deobfuscate "unshield-deobfuscate.c")
+target_link_libraries(unshield-deobfuscate libunshield)
+
+install(TARGETS unshield RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
\ No newline at end of file
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index a0c6b46..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-AM_CPPFLAGS = -I../lib
-LDADD = ../lib/libunshield.la
-
-bin_PROGRAMS = unshield
-noinst_PROGRAMS = unshield-deobfuscate
-
-unshield_SOURCES = unshield.c
-
-unshield_deobfuscate_SOURCES = unshield-deobfuscate.c
-
diff --git a/src/unshield.c b/src/unshield.c
index d84715c..296abf6 100644
--- a/src/unshield.c
+++ b/src/unshield.c
@@ -91,7 +91,11 @@ static bool make_sure_directory_exists(const char* directory)/*{{{*/
 
       if (stat(current, &dir_stat) < 0)
       {
+        #ifdef __MINGW32__
+        if (_mkdir(current) < 0)
+        #else
         if (mkdir(current, 0700) < 0)
+        #endif
         {
           fprintf(stderr, "Failed to create directory %s\n", directory);
           goto exit;
diff --git a/travis.md b/travis.md
deleted file mode 100644
index ef67f29..0000000
--- a/travis.md
+++ /dev/null
@@ -1 +0,0 @@
-[![Build Status](https://travis-ci.org/twogood/unshield.png?branch=master)](https://travis-ci.org/twogood/unshield)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/unshield.git



More information about the Pkg-games-commits mailing list