Browse Source

[equate] autotools stuff, and allow themes dir to be set with an env var

SVN revision: 63823
devs/captainigloo/elm
Vincent Torri 11 years ago
parent
commit
aa95ad9f38
  1. 2
      AUTHORS
  2. 51
      Makefile.am
  3. 3
      README
  4. 5
      acconfig.h
  5. 6
      config.cache-env
  6. 145
      configure.ac
  7. 19
      data/Makefile.am
  8. 15
      data/images/Makefile.am
  9. 71
      m4/efl_binary.m4
  10. 16
      src/Makefile.am
  11. 10
      src/gui.c

2
AUTHORS

@ -5,4 +5,4 @@ digitalfallout and atmos
Many thanks to the e developers for all their help!
Captainigloo (Nicolas Aguirre) <aguirre.nicolas@gmail.com>
Captainigloo (Nicolas Aguirre) <aguirre.nicolas@gmail.com>

51
Makefile.am

@ -2,28 +2,31 @@
SUBDIRS = src data
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
ltconfig ltmain.sh missing mkinstalldirs \
stamp-h.in
MAINTAINERCLEANFILES = \
Makefile.in \
aclocal.m4 \
config.guess \
config.h.in \
config.h.in~ \
config.sub \
configure \
depcomp \
install-sh \
ltconfig \
ltmain.sh \
missing \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
m4/libtool.m4 \
m4/lt~obsolete.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4
install-data-local:
@$(NORMAL_INSTALL)
if test -d $(srcdir)/data; then \
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/data; \
for d in $(srcdir)/data/*; do \
cp -pR $$d $(DESTDIR)$(pkgdatadir)/data; \
done \
fi
dist-hook:
./gendoc; \
if test -d data; then \
mkdir $(distdir)/data; \
for file in data/*; do \
cp -pR $$file $(distdir)/data; \
done \
fi
EXTRA_DIST = README AUTHORS COPYING COPYING-PLAIN
EXTRA_DIST = \
AUTHORS \
COPYING \
COPYING-PLAIN \
README \
README.edje \
m4/efl_binary.m4

3
README

@ -2,3 +2,6 @@ Equate a calc based on EFL based on Equate 0.0.4 developped sometime ago by Andr
Requirements: Elementary
Environment Variables:
EQUATE_PKGDATA_DIR: if set, it must be a directory containing "themes/equate.edj"

5
acconfig.h

@ -1,5 +0,0 @@
#undef PACKAGE_SOURCE_DIR
#undef PACKAGE_BIN_DIR
#undef PACKAGE_LIB_DIR
#undef PACKAGE_DATA_DIR

6
config.cache-env

@ -1,5 +1,5 @@
OLD_PARM="--prefix=/usr"
OLD_PARM=""
OLD_CFLAGS=""
OLD_PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
OLD_PKG_CONFIG_PATH=""
OLD_PATH="/home/torri/local/e17/bin:/home/torri/local/bin:/home/torri/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
OLD_PKG_CONFIG_PATH="/home/torri/local/lib/pkgconfig:/home/torri/local/e17/lib/pkgconfig"
OLD_LDFLAGS=""

145
configure.ac

@ -1,94 +1,73 @@
dnl Process this file with autoconf to produce a configure script.
# get rid of that stupid cache mechanism
rm -f config.cache
### Version
AC_INIT(configure.ac)
AM_INIT_AUTOMAKE(equate, 0.0.4)
AM_CONFIG_HEADER(config.h)
m4_define([v_maj], [0])
m4_define([v_min], [99])
m4_define([v_mic], [0])
m4_define([evil_version], [v_maj.v_min.v_mic])
AC_INIT([equate], [evil_version], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
### Checks for programs
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
# pkg-config
PKG_PROG_PKG_CONFIG
### Checks for libraries
PKG_CHECK_MODULES([EQUATE], [elementary edje ecore-evas ecore evas >= 1.0.0])
### Checks for compiler characteristics
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
AC_CHECK_FUNCS(fmemopen)
AC_CHECK_FUNCS(open_memstream)
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
else
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
fi
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
else
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
fi
dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
fi
dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin")
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}")
fi
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib")
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}")
fi
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
PKG_CHECK_MODULES(EQUATE, [elementary])
AC_OUTPUT([
EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
AC_CONFIG_FILES([
Makefile
src/Makefile
data/Makefile
data/images/Makefile
],[
])
AC_OUTPUT
#####################################################################
## Info
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE_NAME $PACKAGE_VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
echo " OS...................: ${host_os}"
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"
echo

19
data/Makefile.am

@ -1,19 +1,24 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = . images
EDJE_CC = @edje_cc@
EDJE_FLAGS = -v -id $(top_srcdir)/data/images
EDCS = equate.edc text.edc
EDJS = $(EDCS:%.edc=%.edj)
SUFFIXES = .edc .edj
CLEANFILES = $(EDJS)
EXTRA_DIST = $(EDCS) README
themedir = $(pkgdatadir)/themes
theme_DATA = $(EDJS)
all: $(EDCS)
.edc.edj:
edje_cc -v -id images $< $@
$(EDJE_CC) $(EDJE_FLAGS) $< $@
EXTRA_DIST = $(EDCS)
preview: equate.edj
edje equate.edj equate
clean-local:
rm -f $(EDJS)

15
data/images/Makefile.am

@ -1,3 +1,14 @@
EXTRA_DIST = bg.png entry_disabled.png metalsphere.png brushed_texture.png \
entry_light_overlay.png shading.png
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = \
bg.png \
brushed_texture.png \
btn_normal.png \
btn_pressed.png \
entry_disabled.png \
entry_light_overlay.png \
metalsphere.png \
shading.png \
text_button.png \
text_display.png

71
m4/efl_binary.m4

@ -0,0 +1,71 @@
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)
])

16
src/Makefile.am

@ -1,9 +1,11 @@
## Process this file with automake to produce Makefile.in
INCLUDES = \
-I../lib \
-I/usr/local/include \
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/lib \
-I$(top_builddir)/lib \
-DPACKAGE_PKGDATA_DIR=\"$(pkgdatadir)\" \
@EQUATE_CFLAGS@
bin_PROGRAMS = equate
@ -12,7 +14,11 @@ equate_SOURCES = \
gui.c \
calc_parse.c \
edje.c \
main.c
main.c \
Equate.h \
calc.h \
gui.h
equate_LDADD = @EQUATE_LIBS@
EXTRA_DIST = calc_lex.c calc.y regen.sh

10
src/gui.c

@ -8,6 +8,9 @@ Evas_Object *ly;
void
equate_init_gui(Equate * equate, int argc, char **argv)
{
char buf[1024];
char *pkgdatadir;
if (inited == 1)
return;
if (equate)
@ -19,8 +22,11 @@ equate_init_gui(Equate * equate, int argc, char **argv)
ly = elm_layout_add(win);
elm_layout_file_set(ly, "/usr/share/equate/themes/equate.edj",
"Main");
pkgdatadir = getenv("EQUATE_PKGDATA_DIR");
if (!pkgdatadir)
pkgdatadir = PACKAGE_PKGDATA_DIR;
snprintf(buf, sizeof(buf), "%s/themes/equate.edj", pkgdatadir);
elm_layout_file_set(ly, buf, "Main");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_resize_object_add(win, ly);

Loading…
Cancel
Save