/* 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
Requires:
Version: @VERSION@
Libs: @LIBS@
-Cflags: -I${includedir} -I${libdir}/ETL/include
+Cflags: -I${includedir}
MAINTAINERCLEANFILES = \
Makefile.in
+CLEANFILES = \
+ $(top_builddir)/ETL/etl_profile.h
-etlconfigdir = $(libdir)/ETL/include
-
-etlconfig_DATA = etl_profile.h
etldir = $(includedir)/ETL
_trivial.h \
_fixed.h \
etl_config.h \
+ $(top_builddir)/ETL/etl_profile.h \
_fastangle_tables.h \
bezier \
_bezier.h \
_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
#include <pthread.h>
-#ifdef __ETL_HAS_SCHED_H
+#ifdef HAVE_SCHED_H
# include <sched.h>
#endif
#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
// 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
#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
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);
}
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];
}
#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
#define __USE_GNU
-#ifdef __ETL_HAS_PTHREAD_H
+#ifdef HAVE_PTHREAD_H
# include <pthread.h>
#endif
-#ifdef __ETL_HAS_SCHED_H
+#ifdef HAVE_SCHED_H
# include <sched.h>
#endif
-#ifdef __ETL_HAS_CREATETHREAD
+#ifdef HAVE_CREATETHREAD
# include <windows.h>
#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
/* === 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();
#ifdef CALLISTO_THREADS
-#ifdef __ETL_HAS_PTHREAD_CREATE
+#ifdef HAVE_PTHREAD_CREATE
class Thread
{
}
};
-#ifdef __ETL_HAS_PTHREAD_RW_LOCK_INIT
+#ifdef HAVE_PTHREAD_RW_LOCK_INIT
class ReadWriteLock
{
pthread_rwlock_t rwlock;
};
*/
-#else // if defined __ETL_HAS_PTHREAD_CREATE
-#ifdef __ETL_HAS_CREATETHREAD
+#else // if defined HAVE_PTHREAD
+#ifdef HAVE_CREATETHREAD
#ifdef THREAD_ENTRYPOINT
};
-#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
#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
#ifndef __ETL_CONFIG_H
#define __ETL_CONFIG_H
-#include <etl_profile.h>
+#include "etl_profile.h"
#include <utility>
#ifndef ETL_NAMESPACE
+++ /dev/null
-/*
- *
- * 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__
// 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
#include "etl_config.h"
-#ifdef __ETL_HAS_LIBPTHREAD
+#ifdef HAVE_LIBPTHREAD
# include "_mutex_pthreads_simple.h"
#else
#ifdef _WIN32
config.status \
.doc_stamp \
.DS_Store \
+ include/etl_profile.h.in \
doxygen.cfg
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 \
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
# -- 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 ----------------------------------------------
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
# By Robert B. Quattlebaum Jr. <darco@users.sf.net>
#
+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,