Index: configure.ac =================================================================== --- configure.ac (revision 38) +++ configure.ac (working copy) @@ -4,11 +4,21 @@ AC_PREREQ(2.59) AC_INIT([libdispatch], [1.0], [libdispatch@macosforge.org], [libdispatch]) -AC_REVISION([$$]) +AC_REVISION([$Id$]) AC_CONFIG_AUX_DIR(config) -AC_CONFIG_HEADER([config/config.h]) -AM_MAINTAINER_MODE +AM_CONFIG_HEADER([config.h]) +AM_MAINTAINER_MODE() +AC_CANONICAL_TARGET +AC_LANG(C) +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LIBTOOL +AC_PROG_MAKE_SET + +AM_INIT_AUTOMAKE([foreign nostdinc]) + # # On Mac OS X, some required header files come from other source packages; # allow specifying where those are. @@ -16,22 +26,18 @@ AC_ARG_WITH([apple-libc-source], [AS_HELP_STRING([--with-apple-libc-source], [Specify path to Apple Libc source])], - [apple_libc_source_path=${withval}/pthreads - APPLE_LIBC_SOURCE_PATH=-I$apple_libc_source_path - CPPFLAGS="$CPPFLAGS -I$apple_libc_source_path"], - [APPLE_LIBC_SOURCE_PATH=] + [APPLE_LIBC_SOURCE_INC=-I${withval}/pthreads], + [APPLE_LIBC_SOURCE_INC=] ) -AC_SUBST([APPLE_LIBC_SOURCE_PATH]) +AC_SUBST([APPLE_LIBC_SOURCE_INC]) AC_ARG_WITH([apple-xnu-source], [AS_HELP_STRING([--with-apple-xnu-source], [Specify path to Apple XNU source])], - [apple_xnu_source_path=${withval}/libkern - APPLE_XNU_SOURCE_PATH=-I$apple_xnu_source_path - CPPFLAGS="$CPPFLAGS -I$apple_xnu_source_path"], - [APPLE_XNU_SOURCE_PATH=] + [APPLE_XNU_SOURCE_INC=-I${withval}/libkern], + [APPLE_XNU_SOURCE_INC=] ) -AC_SUBST([APPLE_XNU_SOURCE_PATH]) +AC_SUBST([APPLE_XNU_SOURCE_INC]) # # Try to build the legacy API only if specifically requested. @@ -42,10 +48,10 @@ AS_IF([test "x$enable_legacy_api" != "xyes"], [use_legacy_api=false - AC_DEFINE(DISPATCH_NO_LEGACY,,[Define to compile out legacy API])], + AC_DEFINE([DISPATCH_NO_LEGACY], [], [Define to compile out legacy API])], [use_legacy_api=true] ) -AM_CONDITIONAL(USE_LEGACY_API, $use_legacy_api) +AM_CONDITIONAL([USE_LEGACY_API], [test x"$use_legacy_api" = x"true"]) # # On Mac OS X Snow Leopard, libpispatch_init is automatically invoked during @@ -58,7 +64,7 @@ ) AS_IF([test "x$enable_libdispatch_init_constructor" != "xno"], - [AC_DEFINE(USE_LIBDISPATCH_INIT_CONSTRUCTOR,, + [AC_DEFINE([USE_LIBDISPATCH_INIT_CONSTRUCTOR], [], [Define to tag libdispatch_init as a constructor])] ) @@ -71,7 +77,7 @@ ) AS_IF([test "x$enable_apple_crashreporter_info" = "xyes"], - [AC_DEFINE(USE_APPLE_CRASHREPORTER_INFO,, + [AC_DEFINE([USE_APPLE_CRASHREPORTER_INFO], [], [Define to use Mac OS X crashreporter info])] ) @@ -87,7 +93,7 @@ ) AS_IF([test "x$enable_apple_tsd_optimizations" = "xyes"], - [AC_DEFINE(USE_APPLE_TSD_OPTIMIZATIONS,, + [AC_DEFINE([USE_APPLE_TSD_OPTIMIZATIONS], [], [Define to use non-portable pthread TSD optimizations for Mac OS X)])] ) @@ -97,26 +103,19 @@ ) AS_IF([test "x$enable_apple_semaphore_optimizations" = "xyes"], - [AC_DEFINE(USE_APPLE_SEMAPHORE_OPTIMIZATIONS,, + [AC_DEFINE([USE_APPLE_SEMAPHORE_OPTIMIZATIONS], [], [Define to use non-portablesemaphore optimizations for Mac OS X])] ) -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_LIBTOOL -AC_PATH_PROGS(MIG, mig) - -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) - # # Find libraries we will need # -AC_SEARCH_LIBS(clock_gettime, rt) -AC_SEARCH_LIBS(pthread_create, pthread, +AC_SEARCH_LIBS([clock_gettime], [rt]) +AC_SEARCH_LIBS([pthread_create], [pthread], [use_libpthread=true], [use_libpthread=false] ) -AM_CONDITIONAL(USE_LIBPTHREAD, $use_libpthread) +AM_CONDITIONAL([USE_LIBPTHREAD], [test x"$use_libpthread" = x"true"]) # # Checks for header files. @@ -128,19 +127,21 @@ # We use the availability of mach.h to decide whether to compile in all sorts # of Machisms, including using Mach ports as event sources, etc. # -AC_CHECK_HEADER([mach/mach.h], - [AC_DEFINE(HAVE_MACH,,Define if mach is present) - use_mig=true], - [use_mig=false] -) -AM_CONDITIONAL(USE_MIG, $use_mig) +AC_CHECK_HEADER([mach/mach.h], [ + use_mig=true + AC_DEFINE([HAVE_MACH], [], [Define if mach is present]) +], [ + use_mig=false +]) +AC_PATH_PROGS([MIG], [mig]) +AM_CONDITIONAL([USE_MIG], [test x"$use_mig" = x"true" -a x"$MIG" != x""]) # # We use the availability of pthread_workqueue.h to decide whether to compile # in support for pthread work queues. # AC_CHECK_HEADER([pthread_workqueue.h], - [AC_DEFINE(HAVE_PTHREAD_WORKQUEUES,,Define if pthread work queues are present)] + [AC_DEFINE([HAVE_PTHREAD_WORKQUEUES], [], [Define if pthread work queues are present])] ) # @@ -156,12 +157,28 @@ # to check this. # AC_TRY_LINK([], [ - __private_extern__ int foo; + __private_extern__ int foo; ], [ - AC_DEFINE(HAVE_PRIVATE_EXTERN,, Define if __private_extern__ present) + AC_DEFINE([HAVE_PRIVATE_EXTERN], [], [Define if __private_extern__ present]) ]) # +# CPU architecture (for atomic operations) +# NOTE: conditional on gcc? +# NOTE: will fail on pre-ppro; do we care? +# +AS_CASE([$target_cpu], + [amd64|x86_64], [ + # OK + ], + [i?86], [ + CFLAGS="${CFLAGS} -mi686" + ], [ + AC_MSG_NOTICE([not i386 or amd64; no clue if this will work]) + ] +) + +# # Generate Makefiles. # AC_CONFIG_FILES([Makefile dispatch/Makefile src/Makefile]) Index: config/config.h =================================================================== --- config/config.h (revision 38) +++ config/config.h (working copy) @@ -1,131 +0,0 @@ -/* config/config.h. Generated from config.h.in by configure. */ -/* config/config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to compile out legacy API */ -/* #undef DISPATCH_NO_LEGACY */ - -/* Define to 1 if you have the header file. */ -#define HAVE_AVAILABILITY_H 1 - -/* Define to 1 if you have the declaration of `EVFILT_SESSION', and to 0 if - you don't. */ -#define HAVE_DECL_EVFILT_SESSION 1 - -/* Define to 1 if you have the declaration of `NOTE_NONE', and to 0 if you - don't. */ -#define HAVE_DECL_NOTE_NONE 1 - -/* Define to 1 if you have the declaration of `NOTE_REAP', and to 0 if you - don't. */ -#define HAVE_DECL_NOTE_REAP 1 - -/* Define to 1 if you have the declaration of `NOTE_SIGNAL', and to 0 if you - don't. */ -#define HAVE_DECL_NOTE_SIGNAL 1 - -/* Define to 1 if you have the declaration of `VQ_UPDATE', and to 0 if you - don't. */ -#define HAVE_DECL_VQ_UPDATE 1 - -/* Define to 1 if you have the declaration of `VQ_VERYLOWDISK', and to 0 if - you don't. */ -#define HAVE_DECL_VQ_VERYLOWDISK 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIBKERN_OSATOMIC_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIBKERN_OSCROSSENDIAN_H 1 - -/* Define if mach is present */ -#define HAVE_MACH /**/ - -/* Define to 1 if you have the `mach_absolute_time' function. */ -#define HAVE_MACH_ABSOLUTE_TIME 1 - -/* Define to 1 if you have the `malloc_create_zone' function. */ -#define HAVE_MALLOC_CREATE_ZONE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MALLOC_MALLOC_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `pthread_key_init_np' function. */ -#define HAVE_PTHREAD_KEY_INIT_NP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_PTHREAD_MACHDEP_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_PTHREAD_NP_H */ - -/* Define if pthread work queues are present */ -#define HAVE_PTHREAD_WORKQUEUES /**/ - -/* Define to 1 if you have the `sem_init' function. */ -#define HAVE_SEM_INIT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Name of package */ -#define PACKAGE "libdispatch" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "libdispatch@macosforge.org" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "libdispatch" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libdispatch 1.0" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libdispatch" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.0" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to use Mac OS X crashreporter info */ -#define USE_APPLE_CRASHREPORTER_INFO - -/* Define to use non-portablesemaphore optimizations for Mac OS X */ -#define USE_APPLE_SEMAPHORE_OPTIMIZATIONS /**/ - -/* Define to use non-portable pthread TSD optimizations for Mac OS X) */ -#define USE_APPLE_TSD_OPTIMIZATIONS /**/ - -/* Define to tag libdispatch_init as a constructor */ -/* #undef USE_LIBDISPATCH_INIT_CONSTRUCTOR */ - -/* Version number of package */ -#define VERSION "1.0" Index: src/internal.h =================================================================== --- src/internal.h (revision 38) +++ src/internal.h (working copy) @@ -27,7 +27,9 @@ #ifndef __DISPATCH_INTERNAL__ #define __DISPATCH_INTERNAL__ -#include +#if HAVE_CONFIG_H +#include "config.h" +#endif #define __DISPATCH_BUILDING_DISPATCH__ #define __DISPATCH_INDIRECT__ Index: src/Makefile.am =================================================================== --- src/Makefile.am (revision 38) +++ src/Makefile.am (working copy) @@ -16,17 +16,9 @@ time.c libdispatch_la_CFLAGS=-Wall -Werror -INCLUDES=-I$(top_builddir) -I$(top_srcdir) \ - @APPLE_LIBC_SOURCE_PATH@ @APPLE_XNU_SOURCE_PATH@ +INCLUDES=-I$(top_builddir) -I$(builddir) \ + @APPLE_LIBC_SOURCE_INC@ @APPLE_XNU_SOURCE_INC@ -# -# This will need some refinement: gcc requires a minimum of -march=i486 on -# x86 in order to implement built-in atomic operations. But when should we -# define this optional argument? We need appropriate configure parts to make -# this conditional. -# -libdispatch_la_CFLAGS+=-march=i686 - if USE_LEGACY_API libdispatch_la_SOURCES+= \ legacy.c Index: autogen.sh =================================================================== --- autogen.sh (revision 38) +++ autogen.sh (working copy) @@ -2,9 +2,8 @@ # # # -libtoolize --copy --force aclocal +libtoolize --copy --force autoheader -automake -a -c --foreign +automake --add-missing --copy --foreign autoconf - Property changes on: autogen.sh ___________________________________________________________________ Added: svn:executable + *