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 files #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions common/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
common_files = [
'../common/socket.c',
'../common/thread.c',
'../common/collection.c',
]
53 changes: 53 additions & 0 deletions config.h.meson
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* Define if compiled with -fvisibility=hidden */
#mesondefine HAVE_FVISIBILITY

/* Define to 1 if you have the `getifaddrs' function. */
#mesondefine HAVE_GETIFADDRS

/* Define if you have inotify support (linux only) */
#mesondefine HAVE_INOTIFY

/* Define if you have program_invocation_short_name */
#mesondefine HAVE_PROGRAM_INVOCATION_SHORT_NAME

/* Define if program_invocation_short_name is declared in errno.h */
#mesondefine HAVE_PROGRAM_INVOCATION_SHORT_NAME_ERRNO_H

/* Define to 1 if you have the `pselect' function. */
#mesondefine HAVE_PSELECT

/* Define to 1 if you have the `pthread_cancel' function. */
#mesondefine HAVE_PTHREAD_CANCEL

/* Define to 1 if you have the `realloc' function. */
#mesondefine HAVE_REALLOC

/* Define to 1 if you have the `sleep' function. */
#mesondefine HAVE_SLEEP

/* Define to 1 if you have the `stpncpy' function. */
#mesondefine HAVE_STPNCPY

/* Define to 1 if you have the `strcasecmp' function. */
#mesondefine HAVE_STRCASECMP

/* 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 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 home page for this package. */
#mesondefine PACKAGE_URL

/* Define to the version of this package. */
#mesondefine PACKAGE_VERSION
44 changes: 44 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
project('libusbmuxd', 'c',
version : '2.0.3',
default_options : 'c_std=c99')

cc = meson.get_compiler('c')
cdata = configuration_data()

cdata.set_quoted('PACKAGE_NAME', meson.project_name())
cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
cdata.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
cdata.set_quoted('PACKAGE_URL', 'https://libimobiledevice.org')
cdata.set_quoted('PACKAGE_BUGREPORT', 'https://libimobiledevice.org')

cdata.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs', prefix: '#include <ifaddrs.h>'))
cdata.set('HAVE_INOTIFY', cc.has_function('inotify_init', prefix: '#include <sys/inotify.h>'))
cdata.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', cc.has_function('program_invocation_short_name', prefix: '#define _GNU_SOURCE\n#include <errno.h>'))
cdata.set('HAVE_PSELECT', cc.has_function('pselect', prefix: '#define _GNU_SOURCE\n#include <sys/select.h>'))
cdata.set('HAVE_REALLOC', cc.has_function('realloc', prefix: '#include <stdlib.h>'))
cdata.set('HAVE_SLEEP', cc.has_function('sleep', prefix: '#include <unistd.h>'))
cdata.set('HAVE_STPNCPY', cc.has_function('stpncpy', prefix: '#define _GNU_SOURCE\n#include <string.h>'))
cdata.set('HAVE_STRCASECMP', cc.has_function('strcasecmp', prefix: '#include <strings.h>'))
cdata.set('HAVE_STRDUP', cc.has_function('strdup', prefix: '#define _GNU_SOURCE\n#include <string.h>'))
cdata.set('HAVE_STRERROR', cc.has_function('strerror', prefix: '#include <string.h>'))

cdata.set('HAVE_HAVE_PROGRAM_INVOCATION_SHORT_NAME_ERRNO_H', cc.has_header_symbol('errno.h', 'program_invocation_short_name'))
cdata.set('HAVE_PTHREAD_CANCEL', cc.has_header_symbol('pthread.h', 'pthread_cancel'))

configure_file(input : 'config.h.meson',
output : 'config.h',
configuration : cdata)

libusbmuxd_incdir = include_directories(['include', 'common', '.'])

add_global_arguments(['-DHAVE_CONFIG_H', '-D_GNU_SOURCE'], language : 'c')

thread_dep = dependency('threads')

install_headers(['include/usbmuxd.h', 'include/usbmuxd-proto.h'])

subdir('common')
subdir('src')
if get_option('tools')
subdir('tools')
endif
4 changes: 4 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
option('tools', type : 'boolean',
value : true,
description : 'Build libusbmuxd utilities',
)
18 changes: 18 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pkg = import('pkgconfig')
libplist_dep = dependency('libplist-2.0')
thread_dep = dependency('threads')

libusbmuxd = library('usbmuxd',
common_files,
'libusbmuxd.c',
include_directories : libusbmuxd_incdir,
dependencies : [ libplist_dep, thread_dep ],
install : true,
)

pkg.generate(
libraries : libusbmuxd,
version: meson.project_version(),
name : 'libusbmuxd-2.0',
description : 'A library to communicate with the usbmux daemon',
)
12 changes: 12 additions & 0 deletions tools/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
iproxy = executable('iproxy',
'iproxy.c',
include_directories : libusbmuxd_incdir,
link_with : libusbmuxd,
dependencies : thread_dep,
)

inetcat = executable('inetcat',
'inetcat.c',
include_directories : libusbmuxd_incdir,
link_with : libusbmuxd,
)