autotools: adopted autotools.

This commit is contained in:
Daniel Juyung Seo 2013-01-05 14:55:27 +09:00
parent e7c3f2e2a3
commit 321b57fe9f
14 changed files with 311 additions and 10 deletions

1
AUTHORS Normal file
View File

@ -0,0 +1 @@
Daniel Juyung Seo <seojuyung2@gmail.com>

25
COPYING Normal file
View File

@ -0,0 +1,25 @@
Copyright notice for Elm Theme Viewer:
Copyright (C) 2012-2012 Daniel Juyung Seo.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0
ChangeLog Normal file
View File

11
INSTALL Normal file
View File

@ -0,0 +1,11 @@
COMPILING and INSTALLING:
If you got a official release tar archive do:
./configure
Then to compile:
make
To install (run this as root, or the user who handles installs):
make install

View File

@ -1,10 +0,0 @@
all:
edje_cc data/layout.edc
gcc src/main.c src/log.c src/gui.c src/theme.c src/widget.c -o elm_theme_viewer `pkg-config --cflags --libs elementary` -g -Wall
install:
cp ./elm_theme_viewer /usr/local/bin
mkdir -p /usr/local/share/elm-theme-viewer/images
cp images/* /usr/local/share/elm-theme-viewer/images
mkdir -p /usr/local/share/elm-theme-viewer/data
cp data/layout.edj /usr/local/share/elm-theme-viewer/data

25
Makefile.am Normal file
View File

@ -0,0 +1,25 @@
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 \
elm_theme_viewer_config.h.in \
config.sub \
configure \
compile \
depcomp \
install-sh \
ltconfig \
ltmain.sh \
missing \
mkinstalldirs \
stamp-h.in \
stamp-h
EXTRA_DIST = README AUTHORS COPYING autogen.sh

0
NEWS Normal file
View File

2
README Normal file
View File

@ -0,0 +1,2 @@
elm-theme-viewer
================

16
autogen.sh Executable file
View File

@ -0,0 +1,16 @@
#!/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

76
configure.ac Normal file
View File

@ -0,0 +1,76 @@
dnl Process this file with autoconf to produce a configure script.
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT([elm_theme_viewer], [0.1.0], [seojuyung2@gmail.com])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([elm_theme_viewer_config.h])
AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AM_PROG_CC_C_O
AC_C___ATTRIBUTE__
requirements="\
elementary >= 1.7.0 \
eina >= 1.7.0 \
evas >= 1.7.0 \
ecore >= 1.7.0 \
edje >= 1.7.0 \
"
PKG_CHECK_MODULES([ELM_THEME_VIEWER], [${requirements}])
AC_CHECK_FUNCS(mkstemps)
EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
with_max_log_level="EINA_LOG_LEVEL_ERR"
AC_ARG_WITH(maximum-log-level,
[AC_HELP_STRING([--with-maximum-log-level=NUMBER],
[limit elm-theme-viewer log level to the given number, any call to EINA_LOG() with values greater than this will be compiled out, ignoring runtime settings, but saving function calls.])],
[
if test "x${withval}" != "xno"; then
if echo "${withval}" | grep -E '^[[0-9]]+$' >/dev/null 2>/dev/null; then
AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
with_max_log_level="${withval}"
else
AC_MSG_ERROR([--with-maximum-log-level takes a decimal number, got "${withval}" instead.])
fi
fi
], [:])
AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${with_max_log_level}, [if set, logging is limited to this amount.])
AC_CONFIG_FILES([
Makefile
src/Makefile
data/Makefile
])
AC_OUTPUT
#####################################################################
## Info
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
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

21
data/Makefile.am Normal file
View File

@ -0,0 +1,21 @@
MAINTAINERCLEANFILES = Makefile.in
EDJE_CC = @edje_cc@
EDJE_FLAGS_VERBOSE_ =
EDJE_FLAGS_VERBOSE_0 =
EDJE_FLAGS_VERBOSE_1 = -v
EDJE_FLAGS = $(EDJE_FLAGS_$(V))
filesdir = $(pkgdatadir)/
files_DATA = \
layout.edj
EXTRA_DIST = layout.edc
layout.edj: Makefile layout.edc
$(EDJE_CC) $(EDJE_FLAGS) \
$(top_srcdir)/data/layout.edc \
$(top_builddir)/data/layout.edj
clean-local:
rm -f *.edj

47
m4/ac_attribute.m4 Normal file
View File

@ -0,0 +1,47 @@
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

71
m4/efl_binary.m4 Normal file
View File

@ -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 Normal file
View File

@ -0,0 +1,16 @@
MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = elm_theme_viewer
elm_theme_viewer_CPPFLAGS = -I. \
-DPACKAGE_BIN_DIR=\"$(bindir)\" -DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" @ELM_THEME_VIEWER_CFLAGS@
elm_theme_viewer_LDADD = @ELM_THEME_VIEWER_LIBS@
elm_theme_viewer_SOURCES = \
gui.c gui.h \
log.c log.h \
theme.c theme.h \
widget.c widget.h \
main.c common.h