Add first support for Windows and fix many other config stuff

Thanks to vtorri for this patch
This commit is contained in:
Daniel Zaoui 2018-05-20 21:22:38 +03:00
parent 7337672562
commit 92457031ee
15 changed files with 94 additions and 48 deletions

2
.gitignore vendored
View File

@ -11,11 +11,13 @@ Makefile.in
.*.sw[po] .*.sw[po]
*.gcov *.gcov
*.gcno *.gcno
*.exe
/README /README
/aclocal.m4 /aclocal.m4
/autom4te.cache/ /autom4te.cache/
/config.cache /config.cache
/config.guess /config.guess
config.h.in~
/config.h /config.h
/config.h.in /config.h.in
/config.log /config.log

View File

@ -3,6 +3,7 @@ MAINTAINERCLEANFILES = \
Makefile.in \ Makefile.in \
aclocal.m4 \ aclocal.m4 \
config.guess \ config.guess \
config.h.in~ \
config.h.in \ config.h.in \
config.sub \ config.sub \
configure \ configure \

View File

@ -4,25 +4,27 @@ AC_INIT([exactness], [0.1.0], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52]) AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD AC_CONFIG_HEADERS([config.h])
AC_USE_SYSTEM_EXTENSIONS
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_CANONICAL_TARGET case "$host_os" in
mingw*)
have_win32="yes"
;;
esac
AM_INIT_AUTOMAKE([1.6 dist-bzip2]) AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([config.h])
AC_ISC_POSIX
AC_PROG_CC AC_PROG_CC
AC_HEADER_STDC
AC_C_CONST
AM_PROG_CC_C_O AM_PROG_CC_C_O
AC_C_BIGENDIAN
EFL_ENABLE_BETA_API_SUPPORT EFL_ENABLE_BETA_API_SUPPORT
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
AC_PROG_LIBTOOL LT_INIT([win32-dll])
dnl Checking for __attribute__ support dnl Checking for __attribute__ support
AC_MSG_CHECKING([for __attribute__]) AC_MSG_CHECKING([for __attribute__])
@ -39,18 +41,24 @@ if test "x${_cv_have___attribute__}" = "xyes" ; then
fi fi
AC_MSG_RESULT([${_cv_have___attribute__}]) AC_MSG_RESULT([${_cv_have___attribute__}])
requirements_pc="elementary >= 1.14.0 emile >= 1.14.0 ecore-evas >= 1.14.0 evas >= 1.14.0 ecore-con >= 1.14.0 ecore-file >= 1.14.0 ecore >= 1.14.0 eet >= 1.14.0 eo >= 1.14.0 eina >= 1.14.0"
if test "x${have_win32}" = "xyes" ; then
requirements_pc="${requirements_pc} evil"
fi
PKG_CHECK_MODULES([EFL], PKG_CHECK_MODULES([EFL],
[ [${requirements_pc}],
elementary >= 0.7.0 [ac_elm_themes_dir=`$PKG_CONFIG --variable=themes elementary`]
emile >= 1.14.0
],
[ac_elm_themes_dir=`pkg-config --variable=themes elementary`]
) )
if test "x$ac_elm_themes_dir" = x ; then if test "x$ac_elm_themes_dir" = x ; then
AC_MSG_ERROR([couldn't find Elementary themes path]) AC_MSG_ERROR([couldn't find Elementary themes path])
fi fi
AC_CHECK_HEADERS([sys/sysinfo.h])
AC_SUBST([requirements_pc])
AC_SUBST(ELM_THEMES_DIR, $ac_elm_themes_dir) AC_SUBST(ELM_THEMES_DIR, $ac_elm_themes_dir)
AC_OUTPUT([ AC_OUTPUT([

View File

@ -6,5 +6,6 @@ includedir=@includedir@
Name: Exactness Name: Exactness
Description: A Library to read and write Exactness units Description: A Library to read and write Exactness units
Version: @VERSION@ Version: @VERSION@
Requires.private: @requirements_pc@
Libs: -L${libdir} -lexactness Libs: -L${libdir} -lexactness
Cflags: -I${includedir}/exactness Cflags: -I${includedir}/exactness

View File

@ -19,15 +19,15 @@ exactness_record_SOURCES = recorder.c
exactness_inject_SOURCES = injector.c exactness_inject_SOURCES = injector.c
exactness_LDADD = @EFL_LIBS@ $(top_srcdir)/src/lib/.libs/libexactness.la exactness_LDADD = @EFL_LIBS@ $(top_builddir)/src/lib/libexactness.la
exactness_inspect_LDADD = @EFL_LIBS@ $(top_srcdir)/src/lib/.libs/libexactness.a exactness_inspect_LDADD = @EFL_LIBS@ $(top_builddir)/src/lib/libexactness.la
exactness_play_LDADD = @EFL_LIBS@ $(top_srcdir)/src/lib/.libs/libexactness.a exactness_play_LDADD = @EFL_LIBS@ $(top_builddir)/src/lib/libexactness.la
exactness_record_LDADD = @EFL_LIBS@ $(top_srcdir)/src/lib/.libs/libexactness.a exactness_record_LDADD = @EFL_LIBS@ $(top_builddir)/src/lib/libexactness.la
exactness_inject_LDADD = @EFL_LIBS@ $(top_srcdir)/src/lib/.libs/libexactness.a exactness_inject_LDADD = @EFL_LIBS@ $(top_builddir)/src/lib/libexactness.la
exactness_CFLAGS = @EFL_CFLAGS@ -I$(top_srcdir)/src/lib exactness_CFLAGS = @EFL_CFLAGS@ -I$(top_srcdir)/src/lib
@ -39,3 +39,4 @@ exactness_record_CFLAGS = @EFL_CFLAGS@ -I$(top_srcdir)/src/lib
exactness_inject_CFLAGS = @EFL_CFLAGS@ -I$(top_srcdir)/src/lib exactness_inject_CFLAGS = @EFL_CFLAGS@ -I$(top_srcdir)/src/lib
CLEANFILES = $(share_DATA)

View File

@ -1,4 +1,7 @@
#include "config.h" #ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Ecore.h> #include <Ecore.h>
#include <Ecore_Evas.h> #include <Ecore_Evas.h>
#include <Ecore_File.h> #include <Ecore_File.h>

View File

@ -1,10 +1,12 @@
#define _GNU_SOURCE 1 #ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <unistd.h> #include <unistd.h>
#include "config.h"
#ifndef EFL_EO_API_SUPPORT #ifndef EFL_EO_API_SUPPORT
#define EFL_EO_API_SUPPORT #define EFL_EO_API_SUPPORT
#endif #endif
@ -13,6 +15,7 @@
#include <Ecore.h> #include <Ecore.h>
#include <Ecore_Getopt.h> #include <Ecore_Getopt.h>
#include <Elementary.h> #include <Elementary.h>
#include <Exactness.h> #include <Exactness.h>
#include "exactness_private.h" #include "exactness_private.h"
@ -50,7 +53,7 @@ foo(Eina_Debug_Session *session, int srcid, void *buffer, int size) \
return EINA_TRUE; \ return EINA_TRUE; \
} }
#if __BYTE_ORDER == __LITTLE_ENDIAN #ifndef WORDS_BIGENDIAN
#define SWAP_64(x) x #define SWAP_64(x) x
#define SWAP_32(x) x #define SWAP_32(x) x
#define SWAP_16(x) x #define SWAP_16(x) x

View File

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifndef EFL_BETA_API_SUPPORT #ifndef EFL_BETA_API_SUPPORT
#define EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT
#endif #endif
@ -11,6 +15,7 @@
#include <Exactness.h> #include <Exactness.h>
#include "exactness_private.h" #include "exactness_private.h"
#define LDIFF(x) "<b><color=#F0F>"#x"</color></b>" #define LDIFF(x) "<b><color=#F0F>"#x"</color></b>"
#define RDIFF(x) "<b><color=#0FF>"#x"</color></b>" #define RDIFF(x) "<b><color=#0FF>"#x"</color></b>"

View File

@ -1,14 +1,19 @@
#define _GNU_SOURCE 1 #ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#define _POSIX_
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/sysinfo.h> #ifdef HAVE_SYS_SYSINFO_H
#include <dlfcn.h> # include <sys/sysinfo.h>
#endif
#include "config.h"
#ifndef EFL_EO_API_SUPPORT #ifndef EFL_EO_API_SUPPORT
#define EFL_EO_API_SUPPORT #define EFL_EO_API_SUPPORT
#endif #endif
@ -24,7 +29,7 @@
#include "exactness_private.h" #include "exactness_private.h"
#define MAX_PATH 1024 #define PATH_ 1024
#define IMAGE_FILENAME_EXT ".png" #define IMAGE_FILENAME_EXT ".png"
typedef struct typedef struct
@ -60,7 +65,7 @@ foo(Eina_Debug_Session *session, int srcid, void *buffer, int size) \
return EINA_TRUE; \ return EINA_TRUE; \
} }
#if __BYTE_ORDER == __LITTLE_ENDIAN #ifndef WORDS_BIGENDIAN
#define SWAP_64(x) x #define SWAP_64(x) x
#define SWAP_32(x) x #define SWAP_32(x) x
#define SWAP_16(x) x #define SWAP_16(x) x
@ -851,7 +856,7 @@ _prg_invoke(const char *full_path, int argc, char **argv)
static Eina_Stringshare * static Eina_Stringshare *
_prg_full_path_guess(const char *prg) _prg_full_path_guess(const char *prg)
{ {
char full_path[MAX_PATH]; char full_path[PATH_];
if (strchr(prg, '/')) return eina_stringshare_add(prg); if (strchr(prg, '/')) return eina_stringshare_add(prg);
char *paths = strdup(getenv("PATH")); char *paths = strdup(getenv("PATH"));
Eina_Stringshare *ret = NULL; Eina_Stringshare *ret = NULL;
@ -1079,7 +1084,8 @@ int main(int argc, char **argv)
memcpy(argv[0], argv[opt_args], len); memcpy(argv[0], argv[opt_args], len);
memset(argv[0] + len, 0, _POSIX_PATH_MAX - len); memset(argv[0] + len, 0, _POSIX_PATH_MAX - len);
for (int i = opt_args; i < argc; i++) int i;
for (i = opt_args; i < argc; i++)
{ {
if (i != opt_args) if (i != opt_args)
{ {

View File

@ -1,14 +1,19 @@
#define _GNU_SOURCE 1 #ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#define _POSIX_
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/sysinfo.h> #ifdef HAVE_SYS_SYSINFO_H
#include <dlfcn.h> # include <sys/sysinfo.h>
#endif
#include "config.h"
#ifndef EFL_EO_API_SUPPORT #ifndef EFL_EO_API_SUPPORT
#define EFL_EO_API_SUPPORT #define EFL_EO_API_SUPPORT
#endif #endif
@ -22,7 +27,7 @@
#include <Elementary.h> #include <Elementary.h>
#include <Exactness.h> #include <Exactness.h>
#include "exactness_private.h" #include <exactness_private.h>
#define MAX_PATH 1024 #define MAX_PATH 1024
#define STABILIZE_KEY_STR "F1" #define STABILIZE_KEY_STR "F1"
@ -464,7 +469,8 @@ int main(int argc, char **argv)
memcpy(argv[0], argv[opt_args], len); memcpy(argv[0], argv[opt_args], len);
memset(argv[0] + len, 0, _POSIX_PATH_MAX - len); memset(argv[0] + len, 0, _POSIX_PATH_MAX - len);
for (int i = opt_args; i < argc; i++) int i;
for (i = opt_args; i < argc; i++)
{ {
if (i != opt_args) if (i != opt_args)
{ {

View File

@ -245,4 +245,5 @@ EAPI Exactness_Unit *legacy_rec_file_read(const char *filename);
/** /**
* @} * @}
*/ */
#endif /* _EXACTNESS_H */ #endif /* _EXACTNESS_H */

View File

@ -8,16 +8,13 @@ AM_CPPFLAGS = \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EFL_CFLAGS@ @EFL_CFLAGS@ \
-DEXACTNESS_BUILD
EXTRA_DIST = \
exactness_private.h
pkgdir = $(libdir) pkgdir = $(libdir)
pkg_LTLIBRARIES = libexactness.la pkg_LTLIBRARIES = libexactness.la
libexactness_la_SOURCES = unit.c legacy_file.c libexactness_la_SOURCES = unit.c legacy_file.c exactness_private.h
libexactness_la_LDFLAGS = -fPIC -rdynamic libexactness_la_LDFLAGS = -fPIC -rdynamic -no-undefined
libexactness_la_DEPENDENCIES = $(top_builddir)/config.h
libexactness_la_LIBADD = @EFL_LIBS@ libexactness_la_LIBADD = @EFL_LIBS@
libexactness_la_CFLAGS = @EFL_CFLAGS@ libexactness_la_CFLAGS = @EFL_CFLAGS@

View File

@ -4,7 +4,7 @@
#include <Exactness.h> #include <Exactness.h>
/* private header */ /* private header */
const char *_exactness_action_type_to_string_get(Exactness_Action_Type type); EAPI const char *_exactness_action_type_to_string_get(Exactness_Action_Type type);
#define SHOT_DELIMITER '+' #define SHOT_DELIMITER '+'
#endif #endif

View File

@ -1,12 +1,18 @@
#include <Eina.h> #ifdef HAVE_CONFIG_H
#include <Eet.h> # include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <limits.h> #include <limits.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <Eina.h>
#include <Eet.h>
#include <Evas.h> #include <Evas.h>
#include <Exactness.h>
#include "Exactness.h"
#define CACHE_FILE_ENTRY "cache" #define CACHE_FILE_ENTRY "cache"

View File

@ -1,5 +1,11 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Eet.h> #include <Eet.h>
#include <Exactness.h>
#include "Exactness.h"
#include "exactness_private.h"
typedef struct _Dummy typedef struct _Dummy
{ {