From 321b57fe9fad88cf8e9419c9aca4c79396ca3c95 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Sat, 5 Jan 2013 14:55:27 +0900 Subject: [PATCH] autotools: adopted autotools. --- AUTHORS | 1 + COPYING | 25 +++++++++++++++ ChangeLog | 0 INSTALL | 11 +++++++ Makefile | 10 ------ Makefile.am | 25 +++++++++++++++ NEWS | 0 README | 2 ++ autogen.sh | 16 ++++++++++ configure.ac | 76 ++++++++++++++++++++++++++++++++++++++++++++++ data/Makefile.am | 21 +++++++++++++ m4/ac_attribute.m4 | 47 ++++++++++++++++++++++++++++ m4/efl_binary.m4 | 71 +++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 16 ++++++++++ 14 files changed, 311 insertions(+), 10 deletions(-) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL delete mode 100644 Makefile create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 data/Makefile.am create mode 100644 m4/ac_attribute.m4 create mode 100644 m4/efl_binary.m4 create mode 100644 src/Makefile.am diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..891b559 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Daniel Juyung Seo diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..a3c26c6 --- /dev/null +++ b/COPYING @@ -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. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..f67815a --- /dev/null +++ b/INSTALL @@ -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 + diff --git a/Makefile b/Makefile deleted file mode 100644 index a389597..0000000 --- a/Makefile +++ /dev/null @@ -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 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..32f08d8 --- /dev/null +++ b/Makefile.am @@ -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 + diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..3c612e9 --- /dev/null +++ b/README @@ -0,0 +1,2 @@ +elm-theme-viewer +================ \ No newline at end of file diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..31ccda0 --- /dev/null +++ b/autogen.sh @@ -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 diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c2a24aa --- /dev/null +++ b/configure.ac @@ -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 diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..9713725 --- /dev/null +++ b/data/Makefile.am @@ -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 diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4 new file mode 100644 index 0000000..23479a9 --- /dev/null +++ b/m4/ac_attribute.m4 @@ -0,0 +1,47 @@ +dnl Copyright (C) 2004-2008 Kim Woelders +dnl Copyright (C) 2008 Vincent Torri +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 + +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 diff --git a/m4/efl_binary.m4 b/m4/efl_binary.m4 new file mode 100644 index 0000000..c774688 --- /dev/null +++ b/m4/efl_binary.m4 @@ -0,0 +1,71 @@ +dnl Copyright (C) 2010 Vincent Torri +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) + +]) diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..a0c7d8d --- /dev/null +++ b/src/Makefile.am @@ -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