replace autofoo with meson...

learning how meson works. may not be the cleanest or nicest... but
it's not too bad. it does work. ninja dist works.

build times improved. for a full autogen.sh, make etc. -> 5.205s to 0.759s
v-0.4.0
Carsten Haitzler 5 years ago
parent 0756e43821
commit 8726c95e2b
  1. 32
      .gitignore
  2. 0
      ChangeLog
  3. 42
      INSTALL
  4. 34
      Makefile.am
  5. 0
      NEWS
  6. 22
      README
  7. 17
      autogen.sh
  8. 60
      configure.ac
  9. 2
      data/desktop/meson.build
  10. 2
      data/icons/meson.build
  11. 3
      data/meson.build
  12. 13
      data/themes/meson.build
  13. 3
      data/themes/perms.sh
  14. 47
      m4/ac_attribute.m4
  15. 5
      m4/efl_beta.m4
  16. 71
      m4/efl_binary.m4
  17. 6
      m4/efl_eo.m4
  18. 64
      meson.build
  19. 3
      meson_options.txt
  20. 30
      src/bin/meson.build
  21. 2
      src/bin/thumb.c
  22. 1
      src/meson.build

32
.gitignore vendored

@ -2,33 +2,11 @@
*.o
*.swo
*.swp
Makefile
Makefile.in
/aclocal.m4
/compile
/config.log
/config.status
/configure
/depcomp
/install-sh
/ltmain.sh
/missing
/stamp-h1
/rage_config.h
/rage_config.h.in
/rage.spec
/autom4te.cache/
/data/themes/default.edj
/m4/libtool.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/lt~obsolete.m4
/src/bin/.deps/
/src/bin/rage
/src/bin/rage_thumb
pkgbuild/PKGBUILD
pkgbuild/pkg
pkgbuild/src
pkgbuild/*.tar.xz
.dirstamp
/pkgbuild/PKGBUILD
/pkgbuild/pkg
/pkgbuild/src
/pkgbuild/*.tar.xz
/build

@ -1,11 +1,37 @@
COMPILING and INSTALLING:
COMPILING and INSTALLING
------------------------
If you got a official release tar archive do:
./configure
Then to compile:
make
Meson is the build system used for this project. For more information please
see:
To install (run this as root, or the user who handles installs):
make install
http://mesonbuild.com
----
Normal compilation in /usr/local:
meson . build
cd build
ninja
sudo ninja install
For meson build generic options:
meson --help
For a list of project specific options supported:
cat meson_options.txt
To set 1 or more project specific options:
meson -Doption=value [-Dother=value2] ...
To display current configuration:
mesonconf build
The above will only work after at least the following is done:
meson . build

@ -1,34 +0,0 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src data
MAINTAINERCLEANFILES = \
Makefile.in \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
aclocal.m4 \
config.guess \
rage_config.h.in \
config.sub \
configure \
compile \
depcomp \
install-sh \
ltconfig \
ltmain.sh \
missing \
mkinstalldirs \
stamp-h.in \
stamp-h \
m4/libtool.m4 \
m4/lt~obsolete.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4
EXTRA_DIST = README AUTHORS COPYING autogen.sh rage.spec pkgbuild/PKGBUILD
.PHONY: doc
doc:
@echo "Empty doc target until we have real documentation."

@ -121,15 +121,15 @@ F7 - DVD nav menu 7
Requirements:
-------------
* elementary (>= 1.18.0)
* eina (>= 1.18.0)
* eet (>= 1.18.0)
* evas (>= 1.18.0)
* ecore (>= 1.18.0)
* edje (>= 1.18.0)
* emotion (>= 1.18.0)
* ecore-imf (>= 1.18.0)
* ecore-imf-evas (>= 1.18.0)
* ecore-input (>= 1.18.0)
* ethumb (>= 1.18.0)
* elementary (>= 1.19.0)
* eina (>= 1.19.0)
* eet (>= 1.19.0)
* evas (>= 1.19.0)
* ecore (>= 1.19.0)
* edje (>= 1.19.0)
* emotion (>= 1.19.0)
* ecore-imf (>= 1.19.0)
* ecore-imf-evas (>= 1.19.0)
* ecore-input (>= 1.19.0)
* ethumb (>= 1.19.0)

@ -1,16 +1,5 @@
#!/bin/sh
rm -rf autom4te.cache
rm -f aclocal.m4 ltmain.sh
touch README
echo "Running aclocal..." ; aclocal -I m4 $ACLOCAL_FLAGS || exit 1
echo "Running autoheader..." ; autoheader || exit 1
echo "Running autoconf..." ; autoconf || exit 1
echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi
rm -rf build
meson $@ . build
mesonconf build

@ -1,60 +0,0 @@
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT([rage], [0.2.1], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([rage_config.h])
AM_INIT_AUTOMAKE([1.6 dist-bzip2 dist-xz])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AM_PROG_CC_C_O
AC_C___ATTRIBUTE__
efl_version="1.18.0"
requirements="\
elementary >= ${efl_version} \
edje >= ${efl_version} \
emotion >= ${efl_version} \
eio >= ${efl_version} \
eina >= ${efl_version} \
ecore >= ${efl_version} \
evas >= ${efl_version} \
"
PKG_CHECK_MODULES([RAGE], [${requirements}])
EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
AC_CONFIG_FILES([
Makefile
rage.spec
src/Makefile
src/bin/Makefile
data/Makefile
data/desktop/Makefile
data/icons/Makefile
data/themes/Makefile
data/themes/images/Makefile
pkgbuild/PKGBUILD
])
AC_OUTPUT
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Compilation................: make (or gmake)"
echo " CPPFLAGS.................: $CPPFLAGS"
echo " CFLAGS...................: $CFLAGS"
echo " LDFLAGS..................: $LDFLAGS"
echo
echo "Installation...............: make install (as root if needed, with 'su' or 'sudo')"
echo " prefix...................: $prefix"

@ -0,0 +1,2 @@
install_data('rage.desktop',
install_dir: join_paths(dir_data, 'applications'))

@ -0,0 +1,2 @@
install_data('rage.png',
install_dir: join_paths(dir_data, 'icons'))

@ -0,0 +1,3 @@
subdir('themes')
subdir('desktop')
subdir('icons')

@ -0,0 +1,13 @@
cmd = [ edje_cmd,
'-id', join_paths(meson.source_root(), 'data' , 'themes', 'images'),
'@INPUT@', '@OUTPUT@'
]
src = 'default'
custom_target(src + '.edj',
input : src + '.edc',
output : src + '.edj',
command : cmd,
install_dir: join_paths(dir_data, proj, 'themes'),
install : true
)
meson.add_install_script('perms.sh')

@ -0,0 +1,3 @@
#!/bin/sh
chmod a+r "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/rage/themes/default.edj"

@ -1,47 +0,0 @@
dnl Copyright (C) 2004-2008 Kim Woelders
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Originally snatched from somewhere...
dnl Macro for checking if the compiler supports __attribute__
dnl Usage: AC_C___ATTRIBUTE__
dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
dnl defined to nothing.
AC_DEFUN([AC_C___ATTRIBUTE__],
[
AC_MSG_CHECKING([for __attribute__])
AC_CACHE_VAL([ac_cv___attribute__],
[AC_TRY_COMPILE(
[
#include <stdlib.h>
int func(int x);
int foo(int x __attribute__ ((unused)))
{
exit(1);
}
],
[],
[ac_cv___attribute__="yes"],
[ac_cv___attribute__="no"]
)])
AC_MSG_RESULT($ac_cv___attribute__)
if test "x${ac_cv___attribute__}" = "xyes" ; then
AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
else
AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
fi
])
dnl End of ac_attribute.m4

@ -1,5 +0,0 @@
dnl use: EFL_ENABLE_BETA_API_SUPPORT
AC_DEFUN([EFL_ENABLE_BETA_API_SUPPORT],
[
AC_DEFINE([EFL_BETA_API_SUPPORT], [1], [Enable access to unstable EFL API that are still in beta])
])

@ -1,71 +0,0 @@
dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if a binary is built or not
dnl Usage: EFL_ENABLE_BIN(binary)
dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
dnl Define have_binary (- is transformed into _)
dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
AC_DEFUN([EFL_ENABLE_BIN],
[
m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
have_[]m4_defn([DOWN])="yes"
dnl configure option
AC_ARG_ENABLE([$1],
[AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)],
[
if test "x${enableval}" = "xyes" ; then
have_[]m4_defn([DOWN])="yes"
else
have_[]m4_defn([DOWN])="no"
fi
])
AC_MSG_CHECKING([whether to build ]DOWN[ binary])
AC_MSG_RESULT([$have_[]m4_defn([DOWN])])
if test "x$have_[]m4_defn([DOWN])" = "xyes"; then
UP[]_PRG=DOWN[${EXEEXT}]
fi
AC_SUBST(UP[]_PRG)
AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes")
AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3])
])
dnl Macro that check if a binary is built or not
dnl Usage: EFL_WITH_BIN(package, binary, default_value)
dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user)
AC_DEFUN([EFL_WITH_BIN],
[
m4_pushdef([DOWN], m4_translit([[$2]], [-A-Z], [_a-z]))dnl
dnl configure option
AC_ARG_WITH([$2],
[AC_HELP_STRING([--with-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=$3@:>@])],
[_efl_with_binary=${withval}],
[_efl_with_binary=$(pkg-config --variable=prefix $1)/bin/$3])
DOWN=${_efl_with_binary}
AC_MSG_NOTICE(DOWN[ set to ${_efl_with_binary}])
with_binary_[]m4_defn([DOWN])=${_efl_with_binary}
AC_SUBST(DOWN)
])

@ -1,6 +0,0 @@
dnl use: EFL_ENABLE_EO_API_SUPPORT
AC_DEFUN([EFL_ENABLE_EO_API_SUPPORT],
[
AC_DEFINE([EFL_EO_API_SUPPORT], [1], [Enable access to unstable EFL Eo API])
])

@ -0,0 +1,64 @@
##### project
project('rage', 'c',
version : '0.2.1',
license : 'BSD 2 clause',
default_options: [ 'c_std=gnu99' ],
meson_version : '>= 0.40.0')
base_url = 'https://www.enlightenment.org/about-'
##### convenience variables for later
proj = meson.project_name()
ver = meson.project_version()
##### dependencies
efl_version = '>= 1.19.0'
deps = dependency('elementary', version: efl_version)
edje = dependency('edje', version: efl_version)
##### edje_cc binary compiler tool
edje_cmd = get_option('edje-cc')
if edje_cmd == ''
edje_cmd = join_paths(edje.get_pkgconfig_variable('prefix'),
'bin', 'edje_cc')
endif
##### dir locations
dir_prefix = get_option('prefix')
dir_bin = join_paths(dir_prefix, get_option('bindir'))
dir_lib = join_paths(dir_prefix, get_option('libdir'))
dir_data = join_paths(dir_prefix, get_option('datadir'))
dir_locale = join_paths(dir_prefix, get_option('localedir'))
##### config.h
cfg = configuration_data()
cfg.set_quoted('PACKAGE' , proj)
cfg.set_quoted('PACKAGE_NAME' , proj)
cfg.set_quoted('PACKAGE_VERSION' , ver)
cfg.set_quoted('PACKAGE_STRING' , proj + ' ' + ver)
cfg.set_quoted('PACKAGE_URL' , base_url + proj)
cfg.set_quoted('PACKAGE_BIN_DIR' , dir_bin)
cfg.set_quoted('PACKAGE_LIB_DIR' , dir_lib)
cfg.set_quoted('PACKAGE_DATA_DIR' , join_paths(dir_data, proj))
cfg.set_quoted('LOCALEDIR' , dir_locale)
cfg.set ('_GNU_SOURCE' , 1)
cfg.set ('__EXTENSIONS__' , 1)
cfg.set ('_POSIX_PTHREAD_SEMANTICS', 1)
cfg.set ('_ALL_SOURCE' , 1)
cfg.set ('_POSIX_SOURCE' , 1)
cfg.set ('_POSIX_1_SOURCE' , 1)
configure_file(output: 'rage_config.h', configuration: cfg)
##### packaging files for distro packages
pkg = configuration_data()
pkg.set('PACKAGE', proj)
pkg.set('VERSION', ver)
configure_file(input : proj + '.spec.in',
output : proj + '.spec',
configuration: pkg)
configure_file(input : join_paths('pkgbuild', 'PKGBUILD.in'),
output : 'PKGBUILD',
configuration: pkg)
##### subdirs
subdir('src')
subdir('data')

@ -0,0 +1,3 @@
option('edje-cc',
type : 'string',
description: 'A path to a edje_cc. Defaults to system edje_cc')

@ -0,0 +1,30 @@
inc = include_directories('.', '../..')
executable('rage', [
'controls.c', 'controls.h',
'dnd.c', 'dnd.h',
'gesture.c', 'gesture.h',
'key.c', 'key.h',
'main.c', 'main.h',
'video.c', 'video.h',
'winvid.c', 'winvid.h',
'win.c', 'win.h',
'winlist.c', 'winlist.h',
'config.c', 'config.h',
'sha1.c', 'sha1.h',
'videothumb.c', 'videothumb.h',
'albumart.c', 'albumart.h',
'browser.c', 'browser.h'
],
include_directories: inc,
dependencies : deps,
gui_app : true,
install : true)
executable('rage_thumb', [
'thumb.c',
'sha1.c', 'sha1.h',
'albumart.c', 'albumart.h'
],
include_directories: inc,
dependencies : deps,
install_dir : join_paths(dir_lib, proj, 'utils'),
install : true)

@ -2,7 +2,7 @@
#include <Emotion.h>
#include "sha1.h"
#include "albumart.h"
#include "rage_config.h"
static Evas_Object *win = NULL, *subwin = NULL, *image = NULL, *vid = NULL;
static Evas_Object *vidimage = NULL;

@ -0,0 +1 @@
subdir('bin')
Loading…
Cancel
Save