From: Carlos Lopez Date: Mon, 6 Jul 2009 09:42:01 +0000 (+0200) Subject: Revert modifications for Fedora compatibility due to stability problems. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4cfe2b68ebd2556f9926965dcea2ca8f3fc050ea;p=synfig.git Revert modifications for Fedora compatibility due to stability problems. --- diff --git a/ETL/trunk/ETL.pbproj/etl_profile.h b/ETL/trunk/ETL.pbproj/etl_profile.h index 8d1b845..e63e0fe 100644 --- a/ETL/trunk/ETL.pbproj/etl_profile.h +++ b/ETL/trunk/ETL.pbproj/etl_profile.h @@ -8,32 +8,32 @@ /* define if target is big endian */ #define WORDS_BIGENDIAN -#ifndef __ETL_HAS_GETTIMEOFDAY -#define __ETL_HAS_GETTIMEOFDAY +#ifndef HAVE_GETTIMEOFDAY +#define HAVE_GETTIMEOFDAY #endif -#ifndef __ETL_HAS_PTHREAD_H -#define __ETL_HAS_PTHREAD_H +#ifndef HAVE_PTHREAD_H +#define HAVE_PTHREAD_H #endif -#ifndef __ETL_HAS_SCHED_H -#define __ETL_HAS_SCHED_H +#ifndef HAVE_SCHED_H +#define HAVE_SCHED_H #endif -#ifndef __ETL_HAS_PTHREAD_CREATE -#define __ETL_HAS_PTHREAD_CREATE +#ifndef HAVE_PTHREAD_CREATE +#define HAVE_PTHREAD_CREATE #endif -#ifndef __ETL_HAS_VASPRINTF -#define __ETL_HAS_VASPRINTF +#ifndef HAVE_VASPRINTF +#define HAVE_VASPRINTF #endif -#ifndef __ETL_HAS_VSNPRINTF -#define __ETL_HAS_VSNPRINTF +#ifndef HAVE_VSNPRINTF +#define HAVE_VSNPRINTF #endif -#ifndef __ETL_HAS_VSPRINTF -#define __ETL_HAS_VSPRINTF +#ifndef HAVE_VSPRINTF +#define HAVE_VSPRINTF #endif #endif // __VETL_CONFIG_H diff --git a/ETL/trunk/ETL.pc.in b/ETL/trunk/ETL.pc.in index 4417485..93c32bf 100644 --- a/ETL/trunk/ETL.pc.in +++ b/ETL/trunk/ETL.pc.in @@ -8,4 +8,4 @@ Description: @PACKAGE_NAME@ Requires: Version: @VERSION@ Libs: @LIBS@ -Cflags: -I${includedir} -I${libdir}/ETL/include +Cflags: -I${includedir} diff --git a/ETL/trunk/ETL/Makefile.am b/ETL/trunk/ETL/Makefile.am index ffa8f64..b08fdcf 100644 --- a/ETL/trunk/ETL/Makefile.am +++ b/ETL/trunk/ETL/Makefile.am @@ -3,10 +3,9 @@ MAINTAINERCLEANFILES = \ Makefile.in +CLEANFILES = \ + $(top_builddir)/ETL/etl_profile.h -etlconfigdir = $(libdir)/ETL/include - -etlconfig_DATA = etl_profile.h etldir = $(includedir)/ETL @@ -56,6 +55,7 @@ etl_HEADERS = \ _trivial.h \ _fixed.h \ etl_config.h \ + $(top_builddir)/ETL/etl_profile.h \ _fastangle_tables.h \ bezier \ _bezier.h \ @@ -77,6 +77,10 @@ etl_HEADERS = \ _mutex_pthreads_simple.h +$(top_builddir)/ETL/etl_profile.h:$(top_builddir)/ETL/etl_profile_.h + sed "s/PACKAGE/ETL/g;" < $(top_builddir)/ETL/etl_profile_.h > $(top_builddir)/ETL/etl_profile.h + + # FIXME: figure out why this is in SVN, but isn't installed EXTRA_DIST = \ _bit_rotate.h diff --git a/ETL/trunk/ETL/_mutex_pthreads.h b/ETL/trunk/ETL/_mutex_pthreads.h index 8720617..aed6766 100644 --- a/ETL/trunk/ETL/_mutex_pthreads.h +++ b/ETL/trunk/ETL/_mutex_pthreads.h @@ -33,7 +33,7 @@ #include -#ifdef __ETL_HAS_SCHED_H +#ifdef HAVE_SCHED_H # include #endif diff --git a/ETL/trunk/ETL/_stringf.h b/ETL/trunk/ETL/_stringf.h index 22939a2..3d0c020 100644 --- a/ETL/trunk/ETL/_stringf.h +++ b/ETL/trunk/ETL/_stringf.h @@ -53,13 +53,6 @@ #define POPEN_BINARY_WRITE_TYPE "w" #endif -#ifdef __ETL_HAS__VSNPRINTF -#ifndef __ETL_HAS_VSNPRINTF -#define vnsprintf _vnsprintf -#define __ETL_HAS_VSNPRINTF -#endif -#endif - /* === T Y P E D E F S ===================================================== */ _ETL_BEGIN_CDECLS @@ -73,13 +66,13 @@ _ETL_BEGIN_CDECLS // Prefer prototypes from glibc headers, since defining them ourselves // works around glibc security mechanisms -#ifdef __ETL_HAS_VASPRINTF // This is the preferred method +#ifdef HAVE_VASPRINTF // This is the preferred method #ifndef __GLIBC__ extern int vasprintf(char **,const char *,va_list)ETL_NO_THROW; #endif #else -# ifdef __ETL_HAS_VSNPRINTF // This is the secondary method +# ifdef HAVE_VSNPRINTF // This is the secondary method #ifndef __GLIBC__ extern int vsnprintf(char *,size_t,const char*,va_list)ETL_NO_THROW; #endif @@ -87,13 +80,13 @@ _ETL_BEGIN_CDECLS #endif -#ifdef __ETL_HAS_VSSCANF +#ifdef HAVE_VSSCANF #ifndef __GLIBC__ extern int vsscanf(const char *,const char *,va_list)ETL_NO_THROW; #endif #else #define ETL_NO_VSTRSCANF -#ifdef __ETL_HAS_SSCANF +#ifdef HAVE_SSCANF #ifndef __GLIBC__ extern int sscanf(const char *buf, const char *format, ...)ETL_NO_THROW; #endif @@ -111,7 +104,7 @@ _ETL_BEGIN_NAMESPACE inline std::string vstrprintf(const char *format, va_list args) { -#ifdef __ETL_HAS_VASPRINTF // This is the preferred method (and safest) +#ifdef HAVE_VASPRINTF // This is the preferred method (and safest) char *buffer; std::string ret; int i=vasprintf(&buffer,format,args); @@ -122,7 +115,7 @@ vstrprintf(const char *format, va_list args) } return ret; #else -#ifdef __ETL_HAS_VSNPRINTF // This is the secondary method (Safe, but bulky) +#ifdef HAVE_VSNPRINTF // This is the secondary method (Safe, but bulky) #warning etl::vstrprintf() has a maximum size of ETL_STRPRINTF_MAX_LENGTH in this configuration. #ifdef ETL_THREAD_SAFE char buffer[ETL_STRPRINTF_MAX_LENGTH]; @@ -171,7 +164,7 @@ strscanf(const std::string &data, const char*format, ...) } #else -#if defined (__ETL_HAS_SSCANF) && defined (__GNUC__) +#if defined (HAVE_SSCANF) && defined (__GNUC__) #define strscanf(data,format,...) sscanf(data.c_str(),format,__VA_ARGS__) #endif #endif diff --git a/ETL/trunk/ETL/_thread.h b/ETL/trunk/ETL/_thread.h index cb64933..8f70be8 100644 --- a/ETL/trunk/ETL/_thread.h +++ b/ETL/trunk/ETL/_thread.h @@ -31,21 +31,21 @@ #define __USE_GNU -#ifdef __ETL_HAS_PTHREAD_H +#ifdef HAVE_PTHREAD_H # include #endif -#ifdef __ETL_HAS_SCHED_H +#ifdef HAVE_SCHED_H # include #endif -#ifdef __ETL_HAS_CREATETHREAD +#ifdef HAVE_CREATETHREAD # include #endif /* === M A C R O S ========================================================= */ -#if ( defined (__ETL_HAS_PTHREAD_CREATE) || defined (__ETL_HAS_CLONE) || defined (__ETL_HAS_CREATETHREAD) ) && !defined (NO_THREADS) +#if ( defined (HAVE_PTHREAD_CREATE) || defined (HAVE_CLONE) || defined (HAVE_CREATETHREAD) ) && !defined (NO_THREADS) # define CALLISTO_THREADS #endif @@ -53,7 +53,7 @@ /* === C L A S S E S & S T R U C T S ======================================= */ -#if defined(CALLISTO_THREADS) && defined(__ETL_HAS_PTHREAD_CREATE) +#if defined(CALLISTO_THREADS) && defined(HAVE_PTHREAD_CREATE) static inline void Yield(void) { sched_yield(); @@ -68,7 +68,7 @@ inline void Yield(void) { } #ifdef CALLISTO_THREADS -#ifdef __ETL_HAS_PTHREAD_CREATE +#ifdef HAVE_PTHREAD_CREATE class Thread { @@ -207,7 +207,7 @@ public: } }; -#ifdef __ETL_HAS_PTHREAD_RW_LOCK_INIT +#ifdef HAVE_PTHREAD_RW_LOCK_INIT class ReadWriteLock { pthread_rwlock_t rwlock; @@ -290,8 +290,8 @@ public: }; */ -#else // if defined __ETL_HAS_PTHREAD_CREATE -#ifdef __ETL_HAS_CREATETHREAD +#else // if defined HAVE_PTHREAD +#ifdef HAVE_CREATETHREAD #ifdef THREAD_ENTRYPOINT @@ -448,8 +448,8 @@ public: }; -#endif // if defined __ETL_HAS_CREATETHREAD -#endif // if defined __ETL_HAS_PTHREAD_CREATE +#endif // if defined HAVE_CREATETHREAD +#endif // if defined HAVE_PTHREAD_CREATE #endif // if defined CALLISTO_THREADS diff --git a/ETL/trunk/ETL/clock b/ETL/trunk/ETL/clock index 73ec6ea..2457b6c 100644 --- a/ETL/trunk/ETL/clock +++ b/ETL/trunk/ETL/clock @@ -29,7 +29,7 @@ #include "etl_config.h" -#ifdef __ETL_HAS_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY #include "_clock_gettimeofday.h" #ifndef ETL_CLOCK_DEFAULT_DESC_CLASS #define ETL_CLOCK_DEFAULT_DESC_CLASS _ETL::clock_desc_gettimeofday diff --git a/ETL/trunk/ETL/etl_config.h b/ETL/trunk/ETL/etl_config.h index 4e1be8d..94b4056 100644 --- a/ETL/trunk/ETL/etl_config.h +++ b/ETL/trunk/ETL/etl_config.h @@ -3,7 +3,7 @@ #ifndef __ETL_CONFIG_H #define __ETL_CONFIG_H -#include +#include "etl_profile.h" #include #ifndef ETL_NAMESPACE diff --git a/ETL/trunk/ETL/etl_profile.h.in b/ETL/trunk/ETL/etl_profile.h.in deleted file mode 100644 index e5b59b5..0000000 --- a/ETL/trunk/ETL/etl_profile.h.in +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * ETL platform-specific configuration header - * - * Built platform: @build@ - * Host platform: @host@ - * - */ - -#ifndef __ETL_PROFILE_H__ -#define __ETL_PROFILE_H__ - -// Public ETL definitions - -#define ETL_NAME "@PACKAGE_NAME@" -#define ETL_TARNAME "@PACKAGE_TARNAME@" -#define ETL_VERSION "@PACKAGE_VERSION@" - -// Private ETL definitions - -// Libraries -@D_LIBPTHREAD@ __ETL_HAS_LIBPTHREAD - -// Headers -@D_PTHREAD_H@ __ETL_HAS_PTHREAD_H -@D_SCHED_H@ __ETL_HAS_SCHED_H - -// Functions -@D_PTHREAD_CREATE@ __ETL_HAS_PTHREAD_CREATE -@D_PTHREAD_RWLOCK_INIT@ __ETL_HAS_PTHREAD_RWLOCK_INIT -@D_SCHED_YIELD@ __ETL_HAS_SCHED_YIELD -@D_CREATETHREAD@ __ETL_HAS_CREATETHREAD -@D_QUERYPERFORMANCECOUNTER@ __ETL_HAS_QUERYPERFORMANCECOUNTER -@D_GETTIMEOFDAY@ __ETL_HAS_GETTIMEOFDAY -@D_SSCANF@ __ETL_HAS_SSCANF -@D_VSSCANF@ __ETL_HAS_VSSCANF -@D_VSPRINTF@ __ETL_HAS_VSPRINTF -@D_VASPRINTF@ __ETL_HAS_VASPRINTF -@D_VSNPRINTF@ __ETL_HAS_VSNPRINTF -@D__VSNPRINTF@ __ETL_HAS__VSNPRINTF - -#endif // __ETL_PROFILE_H__ diff --git a/ETL/trunk/ETL/handle b/ETL/trunk/ETL/handle index d5ef74a..76508bc 100644 --- a/ETL/trunk/ETL/handle +++ b/ETL/trunk/ETL/handle @@ -33,12 +33,12 @@ // include the next line in an attempt to increase stability // it seems to make things much *less* stable on MS Windows #ifndef _WIN32 -#ifdef __ETL_HAS_LIBPTHREAD -#define __ETL_LOCK_REFCOUNTS +#ifdef HAVE_LIBPTHREAD +#define ETL_LOCK_REFCOUNTS #endif #endif -#ifdef __ETL_LOCK_REFCOUNTS +#ifdef ETL_LOCK_REFCOUNTS # include "mutex" #endif diff --git a/ETL/trunk/ETL/mutex b/ETL/trunk/ETL/mutex index 03fa734..f4d1263 100644 --- a/ETL/trunk/ETL/mutex +++ b/ETL/trunk/ETL/mutex @@ -29,7 +29,7 @@ #include "etl_config.h" -#ifdef __ETL_HAS_LIBPTHREAD +#ifdef HAVE_LIBPTHREAD # include "_mutex_pthreads_simple.h" #else #ifdef _WIN32 diff --git a/ETL/trunk/Makefile.am b/ETL/trunk/Makefile.am index 40d9abf..48447b7 100644 --- a/ETL/trunk/Makefile.am +++ b/ETL/trunk/Makefile.am @@ -21,6 +21,7 @@ MAINTAINERCLEANFILES = \ config.status \ .doc_stamp \ .DS_Store \ + include/etl_profile.h.in \ doxygen.cfg @@ -45,6 +46,7 @@ EXTRA_DIST = \ config/depcomp \ m4/cxx_macros.m4 \ ETL.pbproj/project.pbxproj \ + ETL.pbproj/etl_profile.h \ ETL.pbproj/frameworkfix.cpp \ ETL-config.in \ m4/ETL.m4 \ diff --git a/ETL/trunk/configure.ac b/ETL/trunk/configure.ac index fff4a6a..63f5e96 100644 --- a/ETL/trunk/configure.ac +++ b/ETL/trunk/configure.ac @@ -6,7 +6,7 @@ AC_INIT([Extended Template Library],[0.04.12],[http://synfig.org/Bugs],[ETL]) AC_REVISION AC_CONFIG_AUX_DIR(config) -AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_HEADERS([ETL/etl_profile_.h]) AC_CANONICAL_HOST AC_CANONICAL_TARGET @@ -41,41 +41,27 @@ AC_WIN32_QUIRKS # -- L I B R A R I E S ---------------------------------------- -AC_CHECK_LIB([user32], [main]) -AC_CHECK_LIB([kernel32], [CreateMutex]) -AC_CHECK_LIB([pthread], [pthread_mutex_init], , [HAVE_LIBPTHREAD=no]) +# -- H E A D E R S -------------------------------------------- -if test x$HAVE_LIBPTHREAD = xno ; then - D_LIBPTHREAD="#undef" -else - D_LIBPTHREAD="#define" -fi +AH_TOP([ +// We want to be autoconf/autoheader friendly, so +// if the developer has already included an +// autoheader-generated configuration script, +// we can assume that the user knew what they +// were doing and let them use their own config.h. +//#ifndef PACKAGE_TARNAME +]) -# -- H E A D E R S -------------------------------------------- +AH_BOTTOM([ +//#endif // ifndef PACKAGE_TARNAME +]) -AC_HEADER_STDC -AC_CHECK_HEADERS([pthread.h], [D_PTHREAD_H="#define"], [D_PTHREAD_H="#undef"]) -AC_CHECK_HEADERS([sched.h], [D_SCHED_H="#define"], [D_SCHED_H="#undef"]) -AC_CHECK_HEADERS([sys/time.h]) -AC_CHECK_HEADERS([unistd.h]) -AC_CHECK_HEADERS([windows.h]) # -- T Y P E S & S T R U C T S -------------------------------- # -- F U N C T I O N S ---------------------------------------- -AC_CHECK_FUNCS([pthread_create], [D_PTHREAD_CREATE="#define"], [D_PTHREAD_CREATE="#undef"]) -AC_CHECK_FUNCS([pthread_rwlock_init], [D_PTHREAD_RWLOCK_INIT="#define"], [D_PTHREAD_RWLOCK_INIT="#undef"]) -AC_CHECK_FUNCS([sched_yield], [D_SCHED_YIELD="#define"], [D_SCHED_YIELD="#undef"]) -AC_CHECK_FUNCS([CreateThread], [D_CREATETHREAD="#define"], [D_CREATETHREAD="#undef"]) -AC_CHECK_FUNCS([QueryPerformanceCounter], [D_QUERYPERFORMANCECOUNTER="#define"], [D_QUERYPERFORMANCECOUNTER="#undef"]) -AC_CHECK_FUNCS([gettimeofday], [D_GETTIMEOFDAY="#define"], [D_GETTIMEOFDAY="#undef"]) -AC_CHECK_FUNCS([sscanf], [D_SSCANF="#define"], [D_SSCANF="#undef"]) -AC_CHECK_FUNCS([vsscanf], [D_VSSCANF="#define"], [D_VSSCANF="#undef"]) -AC_CHECK_FUNCS([vsprintf], [D_VSPRINTF="#define"], [D_VSPRINTF="#undef"]) -AC_CHECK_FUNCS([vasprintf], [D_VASPRINTF="#define"], [D_VASPRINTF="#undef"]) -AC_CHECK_FUNCS([vsnprintf], [D_VSNPRINTF="#define"], [D_VSNPRINTF="#undef"]) -AC_CHECK_FUNCS([_vsnprintf], [D__VSNPRINTF="#define"], [D__VSNPRINTF="#undef"]) +ETL_DEPS # -- O U T P U T ---------------------------------------------- @@ -83,29 +69,7 @@ AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) -# Libraries -AC_SUBST(D_LIBPTHREAD) - -# Headers -AC_SUBST(D_PTHREAD_H) -AC_SUBST(D_SCHED_H) - -# Functions -AC_SUBST(D_PTHREAD_CREATE) -AC_SUBST(D_PTHREAD_RWLOCK_INIT) -AC_SUBST(D_SCHED_YIELD) -AC_SUBST(D_CREATETHREAD) -AC_SUBST(D_QUERYPERFORMANCECOUNTER) -AC_SUBST(D_GETTIMEOFDAY) -AC_SUBST(D_SSCANF) -AC_SUBST(D_VSSCANF) -AC_SUBST(D_VSPRINTF) -AC_SUBST(D_VASPRINTF) -AC_SUBST(D_VSNPRINTF) -AC_SUBST(D__VSNPRINTF) - AC_CONFIG_FILES([ETL-config -ETL/etl_profile.h Makefile ETL/Makefile test/Makefile diff --git a/ETL/trunk/m4/ETL.m4 b/ETL/trunk/m4/ETL.m4 index 08ae7ba..c2dc7a4 100644 --- a/ETL/trunk/m4/ETL.m4 +++ b/ETL/trunk/m4/ETL.m4 @@ -5,6 +5,38 @@ # By Robert B. Quattlebaum Jr. # +AC_DEFUN([ETL_DEPS], +[ + AC_CHECK_LIB(user32, main) + AC_CHECK_LIB([kernel32], [CreateMutex]) + AC_CHECK_LIB([pthread], [pthread_mutex_init]) + + AC_HEADER_STDC + + AC_CHECK_HEADERS(pthread.h) + AC_CHECK_HEADERS(sched.h) + AC_CHECK_HEADERS(sys/time.h) + AC_CHECK_HEADERS(unistd.h) + AC_CHECK_HEADERS(windows.h) + AC_CHECK_FUNCS([pthread_create]) + AC_CHECK_FUNCS([pthread_rwlock_init]) + AC_CHECK_FUNCS([sched_yield]) + AC_CHECK_FUNCS([CreateThread]) + AC_CHECK_FUNCS([QueryPerformanceCounter]) + + AC_CHECK_FUNCS([gettimeofday]) + AC_CHECK_FUNCS([sscanf]) + AC_CHECK_FUNCS([vsscanf]) + AC_CHECK_FUNCS([vsprintf]) + AC_CHECK_FUNCS([vasprintf]) + AC_CHECK_FUNCS([vsnprintf],[],[ + AC_CHECK_FUNC([_vsnprintf],[ + AC_DEFINE(vsnprintf,_vsnprintf,[define if the vsnprintf function is mangled]) + AC_DEFINE(HAVE_VSNPRINTF,1) + ]) + ]) +]) + AC_DEFUN([USING_ETL], [ AC_ARG_WITH(ETL-includes,