Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Meson build system #2754

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/build-meson.sh
@@ -0,0 +1,11 @@
#!/bin/bash

set -ex -o xtrace

meson setup builddir

meson configure builddir --pkg-config-path /usr/local/lib/pkgconfig; --prefix /

meson compile

DESTDIR=$PWD/build meson install
4 changes: 4 additions & 0 deletions .github/setup-linux.sh
Expand Up @@ -35,6 +35,10 @@ elif [ "$1" == "mingw" -o "$1" == "mingw32" ]; then
fi
fi

if [ "$1" == "meson" ]; then
DEPS="$DEPS meson"
fi

# The Github Ubuntu images since 20211122.1 are broken
# https://github.com/actions/virtual-environments/issues/4589
if [ "$1" == "mingw" -o "$1" == "mingw32" -o "$1" == "ix86" ]; then
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/linux.yml
Expand Up @@ -84,6 +84,19 @@ jobs:
path:
win32/Output/OpenSC*.exe

build-meson:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: .github/setup-linux.sh meson
- run: .github/build-meson.sh
- name: Cache build artifacts
uses: actions/upload-artifact@v3
with:
name: opensc-build-meson-ubuntu
path:
build

test-piv:
runs-on: ubuntu-20.04
needs: [build]
Expand Down
332 changes: 332 additions & 0 deletions configheader.in
@@ -0,0 +1,332 @@
/* config.h.in. Generated from configure.ac by autoheader. */

/* Define if building universal (internal helper macro) */
#mesondefine AC_APPLE_UNIVERSAL_BUILD

/* CVC directory */
#mesondefine CVCDIR

/* Default PC/SC provider */
#mesondefine DEFAULT_PCSC_PROVIDER

/* Define if CryptoTokenKit is to be enabled */
#mesondefine ENABLE_CRYPTOTOKENKIT

/* Enable CT-API support */
#mesondefine ENABLE_CTAPI

/* Enable the use of external user interface program to request DNIe user pin
*/
#mesondefine ENABLE_DNIE_UI

/* Use glib2 libraries and header files */
#mesondefine ENABLE_GIO2

/* Enable minidriver support */
#mesondefine ENABLE_MINIDRIVER

/* Use notification libraries and header files */
#mesondefine ENABLE_NOTIFY

/* Have OpenCT libraries and header files */
#mesondefine ENABLE_OPENCT

/* Use OpenPACE libraries and header files */
#mesondefine ENABLE_OPENPACE

/* Have OpenSSL libraries and header files */
#mesondefine ENABLE_OPENSSL

/* Define if PC/SC is to be enabled */
#mesondefine ENABLE_PCSC

/* Use readline libraries and header files */
#mesondefine ENABLE_READLINE

/* Enable shared libraries */
#mesondefine ENABLE_SHARED

/* Enable secure messaging support */
#mesondefine ENABLE_SM

/* Use zlib libraries and header files */
#mesondefine ENABLE_ZLIB

/* Enable static libraries */
#mesondefine ENABLE_static

/* Define if fuzzing is enabled */
#mesondefine FUZZING_ENABLED

/* Define to 1 if you have the declaration of `strlcat', and to 0 if you
don't. */
#mesondefine HAVE_DECL_STRLCAT

/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
don't. */
#mesondefine HAVE_DECL_STRLCPY

/* Define to 1 if you have the <dlfcn.h> header file. */
#mesondefine HAVE_DLFCN_H

/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#mesondefine HAVE_DOPRNT

/* Define to 1 if you have the <eac/eac.h> header file. */
#mesondefine HAVE_EAC_EAC_H

/* Define to 1 if you have the `EAC_OBJ_nid2obj' function. */
#mesondefine HAVE_EAC_OBJ_NID2OBJ

/* Define to 1 if you have the <endian.h> header file. */
#mesondefine HAVE_ENDIAN_H

/* Define to 1 if you have the <errno.h> header file. */
#mesondefine HAVE_ERRNO_H

/* Define to 1 if you have the `explicit_bzero' function. */
#mesondefine HAVE_EXPLICIT_BZERO

/* Define to 1 if you have the <fcntl.h> header file. */
#mesondefine HAVE_FCNTL_H

/* Define to 1 if you have the `getline' function. */
#mesondefine HAVE_GETLINE

/* Define to 1 if you have the <getopt.h> header file. */
#mesondefine HAVE_GETOPT_H

/* Define to 1 if you have the `getopt_long' function. */
#mesondefine HAVE_GETOPT_LONG

/* Define to 1 if you have the `getpass' function. */
#mesondefine HAVE_GETPASS

/* Define to 1 if you have the `gettimeofday' function. */
#mesondefine HAVE_GETTIMEOFDAY

/* Define to 1 if you have the <gio/gio.h> header file. */
#mesondefine HAVE_GIO_GIO_H

/* Define to 1 if you have the <inttypes.h> header file. */
#mesondefine HAVE_INTTYPES_H

/* Define to 1 if you have the `memset' function. */
#mesondefine HAVE_MEMSET

/* Define to 1 if you have the `memset_s' function. */
#mesondefine HAVE_MEMSET_S

/* Define to 1 if you have the `mkdir' function. */
#mesondefine HAVE_MKDIR

/* Define to 1 if you have the <openssl/crypto.h> header file. */
#mesondefine HAVE_OPENSSL_CRYPTO_H

/* Define to 1 if you have the <pcsclite.h> header file. */
#mesondefine HAVE_PCSCLITE_H

/* Define if you have POSIX threads libraries and header files. */
#mesondefine HAVE_PTHREAD

/* Have PTHREAD_PRIO_INHERIT. */
#mesondefine HAVE_PTHREAD_PRIO_INHERIT

/* Define to 1 if you have the `sigaction' function. */
#mesondefine HAVE_SIGACTION

/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#mesondefine HAVE_STAT_EMPTY_STRING_BUG

/* Define to 1 if you have the <stdint.h> header file. */
#mesondefine HAVE_STDINT_H

/* Define to 1 if you have the <stdio.h> header file. */
#mesondefine HAVE_STDIO_H

/* Define to 1 if you have the <stdlib.h> header file. */
#mesondefine HAVE_STDLIB_H

/* Define to 1 if you have the `strdup' function. */
#mesondefine HAVE_STRDUP

/* Define to 1 if you have the `strerror' function. */
#mesondefine HAVE_STRERROR

/* Define to 1 if you have the <strings.h> header file. */
#mesondefine HAVE_STRINGS_H

/* Define to 1 if you have the <string.h> header file. */
#mesondefine HAVE_STRING_H

/* Define to 1 if you have the `strnlen' function. */
#mesondefine HAVE_STRNLEN

/* Define to 1 if you have the <sys/endian.h> header file. */
#mesondefine HAVE_SYS_ENDIAN_H

/* Define to 1 if you have the <sys/mman.h> header file. */
#mesondefine HAVE_SYS_MMAN_H

/* Define to 1 if you have the <sys/stat.h> header file. */
#mesondefine HAVE_SYS_STAT_H

/* Define to 1 if you have the <sys/time.h> header file. */
#mesondefine HAVE_SYS_TIME_H

/* Define to 1 if you have the <sys/types.h> header file. */
#mesondefine HAVE_SYS_TYPES_H

/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#mesondefine HAVE_SYS_WAIT_H

/* Define to 1 if you have the <unistd.h> header file. */
#mesondefine HAVE_UNISTD_H

/* Define to 1 if you have the `vprintf' function. */
#mesondefine HAVE_VPRINTF

/* Define to 1 if you have the <wcautil.h> header file. */
#mesondefine HAVE_WCAUTIL_H

/* Define to 1 if you have the <winscard.h> header file. */
#mesondefine HAVE_WINSCARD_H

/* Define to 1 if you have the <zlib.h> header file. */
#mesondefine HAVE_ZLIB_H

/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#mesondefine LSTAT_FOLLOWS_SLASHED_SYMLINK

/* Define to the sub-directory where libtool stores uninstalled libraries. */
#mesondefine LT_OBJDIR

/* Define to 1 if assertions should be disabled. */
#mesondefine NDEBUG

/* Enabled OpenSC features */
#mesondefine OPENSC_FEATURES

/* OpenSC version Git describe revision */
#mesondefine OPENSC_SCM_REVISION

/* OpenSC version fix component */
#mesondefine OPENSC_VERSION_FIX

/* OpenSC version major component */
#mesondefine OPENSC_VERSION_MAJOR

/* OpenSC version minor component */
#mesondefine OPENSC_VERSION_MINOR

/* OpenSC file version revision */
#mesondefine OPENSC_VERSION_REVISION

/* OpenSC version-info Comments */
#mesondefine OPENSC_VS_FF_COMMENTS

/* OpenSC version-info CompanyName value */
#mesondefine OPENSC_VS_FF_COMPANY_NAME

/* OpenSC version-info UpdateURL */
#mesondefine OPENSC_VS_FF_COMPANY_URL

/* OpenSC version-info LegalCopyright value */
#mesondefine OPENSC_VS_FF_LEGAL_COPYRIGHT

/* OpenSC version-info ProductName */
#mesondefine OPENSC_VS_FF_PRODUCT_NAME

/* OpenSC version-info UpdateURL */
#mesondefine OPENSC_VS_FF_PRODUCT_UPDATES

/* OpenSC version-info ProductURL */
#mesondefine OPENSC_VS_FF_PRODUCT_URL

/* Size of OpenSSL secure memory in bytes, must be a power of 2 */
#mesondefine OPENSSL_SECURE_MALLOC_SIZE

/* Name of package */
#mesondefine PACKAGE

/* Define to the address where bug reports for this package should be sent. */
#mesondefine PACKAGE_BUGREPORT

/* Define to the full name of this package. */
#mesondefine PACKAGE_NAME

/* Define to the full name and version of this package. */
#mesondefine PACKAGE_STRING

/* Define to the one symbol short name of this package. */
#mesondefine PACKAGE_TARNAME

/* Define to the home page for this package. */
#mesondefine PACKAGE_URL

/* Define to the version of this package. */
#mesondefine PACKAGE_VERSION

/* Sufficient version of PCSC-Lite with all the required features */
#mesondefine PCSCLITE_GOOD

/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
#mesondefine PTHREAD_CREATE_JOINABLE

/* The size of `void *', as computed by sizeof. */
#mesondefine SIZEOF_VOID_P

/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#mesondefine STDC_HEADERS

/* Define if you are on Cygwin */
#mesondefine USE_CYGWIN

/* Version number of package */
#mesondefine VERSION

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif

/* CVC directory */
#mesondefine X509DIR

/* Define to empty if `const' does not conform to ANSI C. */
#mesondefine const

/* Define to `int' if <sys/types.h> doesn't define. */
#mesondefine gid_t

/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#mesondefine inline
#endif

/* Define to `unsigned int' if <sys/types.h> does not define. */
#mesondefine size_t

/* Define to `int' if <sys/types.h> doesn't define. */
#mesondefine uid_t

#mesondefine SC_PKCS15_PROFILE_DIRECTORY

#mesondefine OPENSC_CONF_PATH

#mesondefine DEFAULT_PKCS11_PROVIDER

#mesondefine DEFAULT_ONEPIN_PKCS11_PROVIDER