Skip to content

Commit

Permalink
Applied updates and code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Oct 19, 2020
1 parent 7682991 commit 93f7335
Show file tree
Hide file tree
Showing 21 changed files with 314 additions and 149 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Files to ignore by git
#
# Version: 20191220
# Version: 20200912

# Generic auto-generated build files
*~
Expand Down Expand Up @@ -61,6 +61,7 @@ stamp-h[1-9]
/m4/gettext.m4
/m4/glibc21.m4
/m4/glibc2.m4
/m4/host-cpu-c-abi.m4
/m4/iconv.m4
/m4/intdiv0.m4
/m4/intldir.m4
Expand Down
21 changes: 14 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
version: ~> 1.0
language: c
arch: amd64
os: linux
dist: bionic
dist: focal
env:
global:
# Encrypted COVERITY_SCAN_TOKEN
Expand Down Expand Up @@ -39,18 +40,24 @@ jobs:
- TARGET="linux-gcc"
compiler: gcc
group: edge
- name: "Linux with gcc on s390x (Docker)"
- name: "Linux with gcc on ppc64le"
env:
- DOCKERHUB_REPO="s390x/ubuntu"
- DOCKERHUB_TAG="bionic"
- CONFIGURE_OPTIONS=""
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="docker"
- TARGET="linux-gcc"
arch: ppc64le
compiler: gcc
group: edge
- name: "Linux with gcc on s390x"
env:
- CONFIGURE_OPTIONS=""
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc"
arch: s390x
compiler: gcc
group: edge
services:
- docker
- name: "Linux with gcc and wide character type (wchar_t) support"
env:
- CONFIGURE_OPTIONS="--enable-wide-character-type"
Expand Down
18 changes: 4 additions & 14 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
#!/bin/sh
# Script to run before_install step on Travis-CI
#
# Version: 20200414
# Version: 20201009

# Exit on error.
set -e;

if test ${TARGET} = "docker";
if test ${TRAVIS_OS_NAME} = "linux";
then
sudo apt-get update;
sudo apt-mark hold mysql-server-5.7 postgresql-9.4 postgresql-client-9.4 postgresql-9.5 postgresql-client-9.5 postgresql-9.6 postgresql-client-9.6 postgresql-10 postgresql-client-10;
sudo apt-mark hold openssh-server;
sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y --allow-unauthenticated;

sudo apt-get install -y qemu-user-static;

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes;

elif test ${TRAVIS_OS_NAME} = "linux";
then
sudo apt-get update;
sudo apt-mark hold mysql-server-5.7 postgresql-9.4 postgresql-client-9.4 postgresql-9.5 postgresql-client-9.5 postgresql-9.6 postgresql-client-9.6 postgresql-10 postgresql-client-10;
sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y --allow-unauthenticated;

sudo apt-get install -y autoconf automake autopoint build-essential git libtool pkg-config;
sudo apt-get install -y autoconf automake autopoint build-essential git libtool pkg-config python-dev-is-python3 python2-dev;

elif test ${TRAVIS_OS_NAME} = "osx";
then
Expand Down
35 changes: 16 additions & 19 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
#!/bin/sh
# Script to run install step on Travis-CI
#
# Version: 20200414
# Version: 20200926

# Exit on error.
set -e;

if test ${TARGET} != "docker";
if test ${TRAVIS_OS_NAME} = "osx";
then
if test ${TRAVIS_OS_NAME} = "osx";
then
export PATH="/usr/local/opt/gettext/bin:$PATH";
export SED="/usr/local/bin/gsed";
fi
export PATH="/usr/local/opt/gettext/bin:$PATH";
export SED="/usr/local/bin/gsed";
fi

./synclibs.sh --use-head;
./autogen.sh;
./synclibs.sh --use-head;
./autogen.sh;

if test ${TARGET} = "linux-gcc-shared" || test ${TARGET} = "linux-gcc-shared-wide-character-type";
then
./configure > /dev/null;
make > /dev/null;
if test ${TARGET} = "linux-gcc-shared" || test ${TARGET} = "linux-gcc-shared-wide-character-type";
then
./configure > /dev/null;
make > /dev/null;

./syncsharedlibs.sh --use-head;
fi
./syncsharedlibs.sh --use-head;
fi

if test -x "synctestdata.sh";
then
./synctestdata.sh;
fi
if test -x "synctestdata.sh";
then
./synctestdata.sh;
fi

8 changes: 2 additions & 6 deletions .travis/script.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# Script to run script step on Travis-CI
#
# Version: 20191209
# Version: 20200926

# Exit on error.
set -e;
Expand All @@ -11,11 +11,7 @@ then
export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g");
fi

if test ${TARGET} = "docker";
then
docker run -t -v "${PWD}:/libevtx" ${DOCKERHUB_REPO}:${DOCKERHUB_TAG} sh -c "cd libevtx && .travis/script_docker.sh";

elif test ${TARGET} = "linux-gcc-python-setup-py" || test ${TARGET} = "macos-gcc-python-setup-py";
if test ${TARGET} = "linux-gcc-python-setup-py" || test ${TARGET} = "macos-gcc-python-setup-py";
then
./configure ${CONFIGURE_OPTIONS};
make > /dev/null;
Expand Down
7 changes: 4 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ environment:
BUILD_ENVIRONMENT: python
APPVEYOR_BUILD_WORKER_IMAGE: macos
PYTHON: "/usr/local/bin/python3.8"
HOMEBREW_NO_INSTALL_CLEANUP: 1
- TARGET: cygwin-gcc
BUILD_ENVIRONMENT: cygwin
CONFIGURE_OPTIONS: ""
Expand Down Expand Up @@ -133,8 +134,8 @@ install:
- cmd: git clone https://github.com/codecov/codecov-bash.git ..\codecov-bash
- cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] (
git clone https://github.com/libyal/vstools.git ..\vstools )
- sh: if test ${BUILD_ENVIRONMENT} = "python"; then brew update && brew install gettext gnu-sed && brew link --force gettext; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python"; then brew install python3 || true; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python"; then brew update; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python"; then brew install gnu-sed python3 || true; fi
- ps: If ($env:BUILD_ENVIRONMENT -eq "python") {
Invoke-Expression "${env:PYTHON} -m pip install -U pip setuptools twine wheel" }
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin] (
Expand Down Expand Up @@ -200,6 +201,6 @@ artifacts:
- path: dist\*.whl

deploy_script:
- ps: If ($env:APPVEYOR_REPO_TAG -eq "true" -and $isWindows) {
- ps: If ($env:APPVEYOR_REPO_TAG -eq "true" -and $isWindows -and $env:BUILD_ENVIRONMENT -eq "python") {
Invoke-Expression "${env:PYTHON} -m twine upload dist/*.whl --username __token__ --password ${env:PYPI_TOKEN} --skip-existing" }

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ( 2.59 )

AC_INIT(
[libevtx],
[20200714],
[20201019],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down
4 changes: 4 additions & 0 deletions libevtx/libevtx_extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@

#include <libevtx/extern.h>

#if defined( __CYGWIN__ )
#define LIBEVTX_EXTERN_VARIABLE extern
#else
#define LIBEVTX_EXTERN_VARIABLE LIBEVTX_EXTERN
#endif

#else
#define LIBEVTX_EXTERN /* extern */
Expand Down
107 changes: 56 additions & 51 deletions m4/libexe.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Checks for libexe required headers and functions
dnl
dnl Version: 20190308
dnl Version: 20201114

dnl Function to detect if libexe is available
dnl ac_libexe_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
Expand Down Expand Up @@ -105,65 +105,70 @@ AC_DEFUN([AX_LIBEXE_CHECK_LIB],
])
])

dnl Function to detect how to enable libexe
AC_DEFUN([AX_LIBEXE_CHECK_ENABLE],
[AX_COMMON_ARG_WITH(
[libexe],
[libexe],
[search for libexe in includedir and libdir or in the specified DIR, or no if to use local version],
[auto-detect],
[DIR])
dnl Check for a shared library version
AX_LIBEXE_CHECK_LIB
dnl Check if the dependencies for the local library version
AS_IF(
[test "x$ac_cv_libexe" != xyes],
dnl Function to detect if libexe dependencies are available
AC_DEFUN([AX_LIBEXE_CHECK_LOCAL],
[ac_cv_libexe_CPPFLAGS="-I../libexe";
ac_cv_libexe_LIBADD="../libexe/libexe.la";
ac_cv_libexe=local
])

dnl Function to detect how to enable libexe
AC_DEFUN([AX_LIBEXE_CHECK_ENABLE],
[AX_COMMON_ARG_WITH(
[libexe],
[libexe],
[search for libexe in includedir and libdir or in the specified DIR, or no if to use local version],
[auto-detect],
[DIR])
dnl Check for a shared library version
AX_LIBEXE_CHECK_LIB
dnl Check if the dependencies for the local library version
AS_IF(
[test "x$ac_cv_libexe" != xyes],
[AX_LIBEXE_CHECK_LOCAL
AC_DEFINE(
[HAVE_LOCAL_LIBEXE],
[1],
[Define to 1 if the local version of libexe is used.])
[HAVE_LOCAL_LIBEXE],
[1],
[Define to 1 if the local version of libexe is used.])
AC_SUBST(
[HAVE_LOCAL_LIBEXE],
[1])
[HAVE_LOCAL_LIBEXE],
[1])
])
AM_CONDITIONAL(
[HAVE_LOCAL_LIBEXE],
[test "x$ac_cv_libexe" = xlocal])
AS_IF(
[test "x$ac_cv_libexe_CPPFLAGS" != "x"],
[AC_SUBST(
[LIBEXE_CPPFLAGS],
[$ac_cv_libexe_CPPFLAGS])
])
AS_IF(
[test "x$ac_cv_libexe_LIBADD" != "x"],
[AC_SUBST(
[LIBEXE_LIBADD],
[$ac_cv_libexe_LIBADD])
])
AM_CONDITIONAL(
[HAVE_LOCAL_LIBEXE],
[test "x$ac_cv_libexe" = xlocal])
AS_IF(
[test "x$ac_cv_libexe_CPPFLAGS" != "x"],
[AC_SUBST(
[LIBEXE_CPPFLAGS],
[$ac_cv_libexe_CPPFLAGS])
])
AS_IF(
[test "x$ac_cv_libexe_LIBADD" != "x"],
[AC_SUBST(
[LIBEXE_LIBADD],
[$ac_cv_libexe_LIBADD])
])
AS_IF(
[test "x$ac_cv_libexe" = xyes],
[AC_SUBST(
[ax_libexe_pc_libs_private],
[-lexe])
])
AS_IF(
[test "x$ac_cv_libexe" = xyes],
[AC_SUBST(
[ax_libexe_pc_libs_private],
[-lexe])
])
AS_IF(
[test "x$ac_cv_libexe" = xyes],
[AC_SUBST(
[ax_libexe_spec_requires],
[libexe])
AC_SUBST(
[ax_libexe_spec_build_requires],
[libexe-devel])
AS_IF(
[test "x$ac_cv_libexe" = xyes],
[AC_SUBST(
[ax_libexe_spec_requires],
[libexe])
AC_SUBST(
[ax_libexe_spec_build_requires],
[libexe-devel])
])
])
])
31 changes: 18 additions & 13 deletions m4/libwrc.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Checks for libwrc required headers and functions
dnl
dnl Version: 20190308
dnl Version: 20200716

dnl Function to detect if libwrc is available
dnl ac_libwrc_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
Expand Down Expand Up @@ -84,6 +84,14 @@ AC_DEFUN([AX_LIBWRC_CHECK_LIB],
])
])

dnl Function to detect if libwrc dependencies are available
AC_DEFUN([AX_LIBWRC_CHECK_LOCAL],
[ac_cv_libwrc_CPPFLAGS="-I../libwrc";
ac_cv_libwrc_LIBADD="../libwrc/libwrc.la";
ac_cv_libwrc=local
])

dnl Function to detect how to enable libwrc
AC_DEFUN([AX_LIBWRC_CHECK_ENABLE],
[AX_COMMON_ARG_WITH(
Expand All @@ -99,19 +107,16 @@ AC_DEFUN([AX_LIBWRC_CHECK_ENABLE],
dnl Check if the dependencies for the local library version
AS_IF(
[test "x$ac_cv_libwrc" != xyes],
[ac_cv_libwrc_CPPFLAGS="-I../libwrc";
ac_cv_libwrc_LIBADD="../libwrc/libwrc.la";
[AX_LIBWRC_CHECK_LOCAL
ac_cv_libwrc=local
AC_DEFINE(
[HAVE_LOCAL_LIBWRC],
[1],
[Define to 1 if the local version of libwrc is used.])
AC_SUBST(
[HAVE_LOCAL_LIBWRC],
[1])
])
AC_DEFINE(
[HAVE_LOCAL_LIBWRC],
[1],
[Define to 1 if the local version of libwrc is used.])
AC_SUBST(
[HAVE_LOCAL_LIBWRC],
[1])
])
AM_CONDITIONAL(
[HAVE_LOCAL_LIBWRC],
Expand Down
Loading

0 comments on commit 93f7335

Please sign in to comment.