From 47206e061dda46cedeee74f5a2dd25241ca89156 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Thu, 13 Nov 2025 11:04:17 -0700 Subject: [PATCH 1/3] rename config.h.cmake.in to config.h.in, match tar.gz https://archive.apache.org/dist/activemq/activemq-cpp/3.9.5/activemq-cpp-library-3.9.5-src.tar.gz --- .../{config.h.cmake.in => config.h.in} | 155 +++++++++--------- 1 file changed, 77 insertions(+), 78 deletions(-) rename activemq-cpp/{config.h.cmake.in => config.h.in} (57%) diff --git a/activemq-cpp/config.h.cmake.in b/activemq-cpp/config.h.in similarity index 57% rename from activemq-cpp/config.h.cmake.in rename to activemq-cpp/config.h.in index b8ee1abee..7b82eaee8 100644 --- a/activemq-cpp/config.h.cmake.in +++ b/activemq-cpp/config.h.in @@ -1,221 +1,220 @@ -/* config.h.cmake.in. Copied, modified from source targ.gz config.h.in. */ +/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ -#@DEFINE_AC_APPLE_UNIVERSAL_BUILD@ AC_APPLE_UNIVERSAL_BUILD +#undef AC_APPLE_UNIVERSAL_BUILD /* Define if compiler provides atomic builtins */ -#@DEFINE_HAVE_ATOMIC_BUILTINS@ HAVE_ATOMIC_BUILTINS +#undef HAVE_ATOMIC_BUILTINS /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_DLFCN_H@ HAVE_DLFCN_H +#undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#@DEFINE_HAVE_DOPRNT@ HAVE_DOPRNT +#undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_ERRNO_H@ HAVE_ERRNO_H +#undef HAVE_ERRNO_H /* Define to 1 if you have the `ftime' function. */ -#@DEFINE_HAVE_FTIME@ HAVE_FTIME +#undef HAVE_FTIME /* Define to 1 if you have the `gettimeofday' function. */ -#@DEFINE_HAVE_GETTIMEOFDAY@ HAVE_GETTIMEOFDAY +#undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_INTTYPES_H@ HAVE_INTTYPES_H +#undef HAVE_INTTYPES_H /* Define to 1 if you have the `ioctl' function. */ -#@DEFINE_HAVE_IOCTL@ HAVE_IOCTL +#undef HAVE_IOCTL /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_LIMITS_H@ HAVE_LIMITS_H +#undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_MEMORY_H@ HAVE_MEMORY_H +#undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_OBJBASE_H@ HAVE_OBJBASE_H +#undef HAVE_OBJBASE_H /* Define that we have SSL capability */ -#@DEFINE_HAVE_OPENSSL@ HAVE_OPENSSL +#undef HAVE_OPENSSL /* Define to 1 if you have the `pthread_attr_setguardsize' function. */ -#@DEFINE_HAVE_PTHREAD_ATTR_SETGUARDSIZE@ HAVE_PTHREAD_ATTR_SETGUARDSIZE +#undef HAVE_PTHREAD_ATTR_SETGUARDSIZE /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_PTHREAD_H@ HAVE_PTHREAD_H +#undef HAVE_PTHREAD_H /* Define to 1 if you have the `pthread_key_delete' function. */ -#@DEFINE_HAVE_PTHREAD_KEY_DELETE@ HAVE_PTHREAD_KEY_DELETE +#undef HAVE_PTHREAD_KEY_DELETE /* Define if recursive pthread mutexes are available */ -#@DEFINE_HAVE_PTHREAD_MUTEX_RECURSIVE@ HAVE_PTHREAD_MUTEX_RECURSIVE +#undef HAVE_PTHREAD_MUTEX_RECURSIVE /* Define if pthread rwlocks are available */ -#@DEFINE_HAVE_PTHREAD_RWLOCKS@ HAVE_PTHREAD_RWLOCKS +#undef HAVE_PTHREAD_RWLOCKS /* Define to 1 if you have the `pthread_rwlock_init' function. */ -#@DEFINE_HAVE_PTHREAD_RWLOCK_INIT@ HAVE_PTHREAD_RWLOCK_INIT +#undef HAVE_PTHREAD_RWLOCK_INIT /* Define to 1 if you have the `pthread_timedjoin_np' function. */ -#@DEFINE_HAVE_PTHREAD_TIMEDJOIN_NP@ HAVE_PTHREAD_TIMEDJOIN_NP +#undef HAVE_PTHREAD_TIMEDJOIN_NP /* Define to 1 if you have the `pthread_tryjoin_np' function. */ -#@DEFINE_HAVE_PTHREAD_TRYJOIN_NP@ HAVE_PTHREAD_TRYJOIN_NP +#undef HAVE_PTHREAD_TRYJOIN_NP /* Define to 1 if you have the `pthread_yield' function. */ -#@DEFINE_HAVE_PTHREAD_YIELD@ HAVE_PTHREAD_YIELD +#undef HAVE_PTHREAD_YIELD /* Define to 1 if you have the `random' function. */ -#@DEFINE_HAVE_RANDOM@ HAVE_RANDOM +#undef HAVE_RANDOM /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_REPCDCE_H@ HAVE_REPCDCE_H +#undef HAVE_REPCDCE_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SCHED_H@ HAVE_SCHED_H +#undef HAVE_SCHED_H /* Define to 1 if you have the `sched_yield' function. */ -#@DEFINE_HAVE_SCHED_YIELD@ HAVE_SCHED_YIELD +#undef HAVE_SCHED_YIELD /* Define to 1 if you have the `select' function. */ -#@DEFINE_HAVE_SELECT@ HAVE_SELECT +#undef HAVE_SELECT /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SEMAPHORE_H@ HAVE_SEMAPHORE_H +#undef HAVE_SEMAPHORE_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SIGNAL_H@ HAVE_SIGNAL_H +#undef HAVE_SIGNAL_H /* Define to 1 if you have the `srandom' function. */ -#@DEFINE_HAVE_SRANDOM@ HAVE_SRANDOM +#undef HAVE_SRANDOM /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STDINT_H@ HAVE_STDINT_H +#undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STDLIB_H@ HAVE_STDLIB_H +#undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STRINGS_H@ HAVE_STRINGS_H +#undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STRING_H@ HAVE_STRING_H +#undef HAVE_STRING_H /* define if you have struct addrinfo */ -#@DEFINE_HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_ADDRINFO +#undef HAVE_STRUCT_ADDRINFO /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_FILIO_H@ HAVE_SYS_FILIO_H +#undef HAVE_SYS_FILIO_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_IOCTL_H@ HAVE_SYS_IOCTL_H +#undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_RESOURCE_H@ HAVE_SYS_RESOURCE_H +#undef HAVE_SYS_RESOURCE_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_SELECT_H@ HAVE_SYS_SELECT_H +#undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_STAT_H@ HAVE_SYS_STAT_H +#undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_SYSCTL_H@ HAVE_SYS_SYSCTL_H +#undef HAVE_SYS_SYSCTL_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_TIMEB_H@ HAVE_SYS_TIMEB_H +#undef HAVE_SYS_TIMEB_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_TIME_H@ HAVE_SYS_TIME_H +#undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_TYPES_H@ HAVE_SYS_TYPES_H +#undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_WAIT_H@ HAVE_SYS_WAIT_H +#undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `time' function. */ -#@DEFINE_HAVE_TIME@ HAVE_TIME +#undef HAVE_TIME /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_TIME_H@ HAVE_TIME_H +#undef HAVE_TIME_H /* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_UNISTD_H@ HAVE_UNISTD_H +#undef HAVE_UNISTD_H /* define if you have -fvisibility options */ -#@DEFINE_HAVE_VISIBILITY_OPTIONS@ HAVE_VISIBILITY_OPTIONS +#undef HAVE_VISIBILITY_OPTIONS /* Define to 1 if you have the `vprintf' function. */ -#@DEFINE_HAVE_VPRINTF@ HAVE_VPRINTF +#undef HAVE_VPRINTF /* Define if compiler provides wchar_t */ -#@DEFINE_HAVE_WCHAR_T@ HAVE_WCHAR_T +#undef HAVE_WCHAR_T -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#cmakedefine LT_OBJDIR "@LT_OBJDIR@" +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR /* Name of package */ -#cmakedefine PACKAGE "@PACKAGE@" +#undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ -#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" +#undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ -#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@" +#undef PACKAGE_NAME /* Define to the full name and version of this package. */ -#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" +#undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ -#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@" +#undef PACKAGE_TARNAME /* Define to the home page for this package. */ -#cmakedefine PACKAGE_URL "@PACKAGE_URL@" +#undef PACKAGE_URL /* Define to the version of this package. */ -#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" +#undef PACKAGE_VERSION /* Define if pthread_attr_getdetachstate() has one arg */ -#@DEFINE_PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG@ PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG +#undef PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG /* Define if pthread_getspecific() has two args */ -#@DEFINE_PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS@ PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS +#undef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS /* Define if sigwait takes one arg */ -#@DEFINE_SIGWAIT_TAKES_ONE_ARG@ SIGWAIT_TAKES_ONE_ARG +#undef SIGWAIT_TAKES_ONE_ARG /* The size of `char', as computed by sizeof. */ -@SIZEOF_CHAR_CODE@ +#undef SIZEOF_CHAR /* The size of `double', as computed by sizeof. */ -@SIZEOF_DOUBLE_CODE@ +#undef SIZEOF_DOUBLE /* The size of `float', as computed by sizeof. */ -@SIZEOF_FLOAT_CODE@ +#undef SIZEOF_FLOAT /* The size of `int', as computed by sizeof. */ -@SIZEOF_INT_CODE@ +#undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ -@SIZEOF_LONG_CODE@ +#undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ -@SIZEOF_LONG_LONG_CODE@ +#undef SIZEOF_LONG_LONG /* The size of `short', as computed by sizeof. */ -@SIZEOF_SHORT_CODE@ +#undef SIZEOF_SHORT /* The size of `wchar_t', as computed by sizeof. */ -@SIZEOF_WCHAR_T_CODE@ +#undef SIZEOF_WCHAR_T /* Define to 1 if you have the ANSI C header files. */ -#@DEFINE_STDC_HEADERS@ STDC_HEADERS +#undef STDC_HEADERS /* Version number of package */ -#cmakedefine VERSION "@VERSION@" +#undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -225,12 +224,12 @@ # endif #else # ifndef WORDS_BIGENDIAN -#@DEFINE_WORDS_BIGENDIAN@ WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN # endif #endif /* Define to empty if `const' does not conform to ANSI C. */ -#@DEFINE_const@ const +#undef const /* Define to `unsigned int' if does not define. */ -#cmakedefine size_t @size_t@ +#undef size_t From 32e4072aa7165827b49bf0d8c513f8a52a5f29a9 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Thu, 13 Nov 2025 15:25:04 -0700 Subject: [PATCH 2/3] externpro 25.06-15-g1a635a9 --- .devcontainer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer b/.devcontainer index 2351b765b..1a635a9c2 160000 --- a/.devcontainer +++ b/.devcontainer @@ -1 +1 @@ -Subproject commit 2351b765b99b17ec660561898dc919c6e26ace53 +Subproject commit 1a635a9c290fa0a634cae3bb0784609f873932f2 From 878e52bea9092c9e0e1ac3c6c10a65227b79aa8b Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Thu, 13 Nov 2025 15:31:18 -0700 Subject: [PATCH 3/3] configure.cmake: include(xpcfg) from externpro --- activemq-cpp/configure.cmake | 438 ++++++++--------------------------- 1 file changed, 92 insertions(+), 346 deletions(-) diff --git a/activemq-cpp/configure.cmake b/activemq-cpp/configure.cmake index 7929dc2e1..d6c7512fe 100644 --- a/activemq-cpp/configure.cmake +++ b/activemq-cpp/configure.cmake @@ -1,112 +1,73 @@ +include(xpcfg) include(CheckCXXCompilerFlag) -include(CheckCSourceCompiles) -include(CheckFunctionExists) -include(CheckIncludeFile) -include(CheckLibraryExists) -include(CheckSymbolExists) include(CheckTypeSize) include(CMakePushCheckState) include(TestBigEndian) +cmake_push_check_state(CONFIGURE_CMAKE) ######################################## -function(set_define var) - if(${ARGC} GREATER 1 AND ${var}) - set(DEFINE_${var} cmakedefine01 PARENT_SCOPE) - else() - set(DEFINE_${var} cmakedefine PARENT_SCOPE) - endif() - if(${var}) - set(AMQ_TEST_DEFINES "${AMQ_TEST_DEFINES} -D${var}" PARENT_SCOPE) - set(CMAKE_REQUIRED_DEFINITIONS ${AMQ_TEST_DEFINES} PARENT_SCOPE) - endif(${var}) -endfunction() -########## -macro(check_include_file_concat incfile var) - check_include_file("${incfile}" ${var}) - set_define(${var} 1) - if(${var}) - set(AMQ_INCLUDES ${AMQ_INCLUDES} ${incfile}) - endif(${var}) -endmacro() -########## -macro(check_exists_define01 func var) - if(UNIX) - check_function_exists("${func}" ${var}) - else() - check_symbol_exists("${func}" "${AMQ_INCLUDES}" ${var}) - endif() - set_define(${var} 1) -endmacro() -########## -macro(check_library_exists_concat lib symbol var) - check_library_exists("${lib};${AMQ_SYSTEM_LIBS}" ${symbol} "${CMAKE_LIBRARY_PATH}" ${var}) - set_define(${var} 1) - if(${var}) - set(AMQ_SYSTEM_LIBS ${lib} ${AMQ_SYSTEM_LIBS}) - set(CMAKE_REQUIRED_LIBRARIES ${AMQ_SYSTEM_LIBS}) - endif(${var}) -endmacro() -######################################## -check_include_file_concat(windows.h HAVE_WINDOWS_H) +xpcfgCheckIncludeFile(windows.h HAVE_WINDOWS_H) if(HAVE_WINDOWS_H) - set(WIN32_LEAN_AND_MEAN TRUE) # Define to avoid automatic inclusion of winsock.h + add_compile_definitions(WIN32_LEAN_AND_MEAN) # Define to avoid automatic inclusion of winsock.h endif() -set_define(WIN32_LEAN_AND_MEAN) -check_include_file_concat(dlfcn.h HAVE_DLFCN_H) -check_include_file_concat(errno.h HAVE_ERRNO_H) -check_include_file_concat(inttypes.h HAVE_INTTYPES_H) -check_include_file_concat(limits.h HAVE_LIMITS_H) -check_include_file_concat(memory.h HAVE_MEMORY_H) -check_include_file_concat(objbase.h HAVE_OBJBASE_H) -check_include_file_concat(pthread.h HAVE_PTHREAD_H) -check_include_file_concat(repcdce.h HAVE_REPCDCE_H) -check_include_file_concat(sched.h HAVE_SCHED_H) -check_include_file_concat(semaphore.h HAVE_SEMAPHORE_H) -check_include_file_concat(signal.h HAVE_SIGNAL_H) -check_include_file_concat(stdint.h HAVE_STDINT_H) -check_include_file_concat(stdlib.h HAVE_STDLIB_H) -check_include_file_concat(strings.h HAVE_STRINGS_H) -check_include_file_concat(string.h HAVE_STRING_H) -check_include_file_concat(sys/filio.h HAVE_SYS_FILIO_H) -check_include_file_concat(sys/ioctl.h HAVE_SYS_IOCTL_H) -check_include_file_concat(sys/resource.h HAVE_SYS_RESOURCE_H) -check_include_file_concat(sys/select.h HAVE_SYS_SELECT_H) -check_include_file_concat(sys/stat.h HAVE_SYS_STAT_H) -check_include_file_concat(sys/sysctl.h HAVE_SYS_SYSCTL_H) -check_include_file_concat(sys/timeb.h HAVE_SYS_TIMEB_H) -check_include_file_concat(sys/time.h HAVE_SYS_TIME_H) -check_include_file_concat(sys/types.h HAVE_SYS_TYPES_H) -check_include_file_concat(sys/wait.h HAVE_SYS_WAIT_H) -check_include_file_concat(time.h HAVE_TIME_H) -check_include_file_concat(unistd.h HAVE_UNISTD_H) -check_include_file_concat(stdio.h HAVE_STDIO_H) -check_include_file_concat(sys/socket.h HAVE_SYS_SOCKET_H) -check_include_file_concat(netdb.h HAVE_NETDB_H) +xpcfgCheckIncludeFile(dlfcn.h HAVE_DLFCN_H) +xpcfgCheckIncludeFile(errno.h HAVE_ERRNO_H) +xpcfgCheckIncludeFile(inttypes.h HAVE_INTTYPES_H) +xpcfgCheckIncludeFile(limits.h HAVE_LIMITS_H) +xpcfgCheckIncludeFile(memory.h HAVE_MEMORY_H) +xpcfgCheckIncludeFile(objbase.h HAVE_OBJBASE_H) +xpcfgCheckIncludeFile(pthread.h HAVE_PTHREAD_H) +xpcfgCheckIncludeFile(repcdce.h HAVE_REPCDCE_H) +xpcfgCheckIncludeFile(sched.h HAVE_SCHED_H) +xpcfgCheckIncludeFile(semaphore.h HAVE_SEMAPHORE_H) +xpcfgCheckIncludeFile(signal.h HAVE_SIGNAL_H) +xpcfgCheckIncludeFile(stdint.h HAVE_STDINT_H) +xpcfgCheckIncludeFile(stdlib.h HAVE_STDLIB_H) +xpcfgCheckIncludeFile(strings.h HAVE_STRINGS_H) +xpcfgCheckIncludeFile(string.h HAVE_STRING_H) +xpcfgCheckIncludeFile(sys/filio.h HAVE_SYS_FILIO_H) +xpcfgCheckIncludeFile(sys/ioctl.h HAVE_SYS_IOCTL_H) +xpcfgCheckIncludeFile(sys/resource.h HAVE_SYS_RESOURCE_H) +xpcfgCheckIncludeFile(sys/select.h HAVE_SYS_SELECT_H) +xpcfgCheckIncludeFile(sys/stat.h HAVE_SYS_STAT_H) +xpcfgCheckIncludeFile(sys/sysctl.h HAVE_SYS_SYSCTL_H) +xpcfgCheckIncludeFile(sys/timeb.h HAVE_SYS_TIMEB_H) +xpcfgCheckIncludeFile(sys/time.h HAVE_SYS_TIME_H) +xpcfgCheckIncludeFile(sys/types.h HAVE_SYS_TYPES_H) +xpcfgCheckIncludeFile(sys/wait.h HAVE_SYS_WAIT_H) +xpcfgCheckIncludeFile(time.h HAVE_TIME_H) +xpcfgCheckIncludeFile(unistd.h HAVE_UNISTD_H) +xpcfgCheckIncludeFile(stdio.h HAVE_STDIO_H) +xpcfgCheckIncludeFile(sys/socket.h HAVE_SYS_SOCKET_H) +xpcfgCheckIncludeFile(netdb.h HAVE_NETDB_H) ########## -check_library_exists_concat(pthread pthread_yield HAVE_LIBPTHREAD) +xpcfgCheckLibraryExists(pthread pthread_yield HAVE_LIBPTHREAD) +set(CMAKE_REQUIRED_LIBRARIES ${XP_SYSTEM_LIBS}) ########## -check_exists_define01(ftime HAVE_FTIME) -check_exists_define01(gettimeofday HAVE_GETTIMEOFDAY) -check_exists_define01(ioctl HAVE_IOCTL) -check_exists_define01(pthread_attr_setguardsize HAVE_PTHREAD_ATTR_SETGUARDSIZE) -check_exists_define01(pthread_key_delete HAVE_PTHREAD_KEY_DELETE) -check_exists_define01(pthread_rwlock_init HAVE_PTHREAD_RWLOCK_INIT) -check_exists_define01(pthread_timedjoin_np HAVE_PTHREAD_TIMEDJOIN_NP) -check_exists_define01(pthread_tryjoin_np HAVE_PTHREAD_TRYJOIN_NP) -check_exists_define01(pthread_yield HAVE_PTHREAD_YIELD) -check_exists_define01(random HAVE_RANDOM) -check_exists_define01(sched_yield HAVE_SCHED_YIELD) #TODO: configure doesn't find -check_exists_define01(select HAVE_SELECT) -check_exists_define01(srandom HAVE_SRANDOM) -check_exists_define01(time HAVE_TIME) -check_exists_define01(vprintf HAVE_VPRINTF) +xpcfgCheckSymFnExists(ftime HAVE_FTIME) +xpcfgCheckSymFnExists(gettimeofday HAVE_GETTIMEOFDAY) +xpcfgCheckSymFnExists(ioctl HAVE_IOCTL) +xpcfgCheckSymFnExists(pthread_attr_setguardsize HAVE_PTHREAD_ATTR_SETGUARDSIZE) +xpcfgCheckSymFnExists(pthread_key_delete HAVE_PTHREAD_KEY_DELETE) +xpcfgCheckSymFnExists(pthread_rwlock_init HAVE_PTHREAD_RWLOCK_INIT) +xpcfgCheckSymFnExists(pthread_timedjoin_np HAVE_PTHREAD_TIMEDJOIN_NP) +xpcfgCheckSymFnExists(pthread_tryjoin_np HAVE_PTHREAD_TRYJOIN_NP) +xpcfgCheckSymFnExists(pthread_yield HAVE_PTHREAD_YIELD) +xpcfgCheckSymFnExists(random HAVE_RANDOM) +xpcfgCheckSymFnExists(sched_yield HAVE_SCHED_YIELD) #TODO: configure doesn't find +xpcfgCheckSymFnExists(select HAVE_SELECT) +xpcfgCheckSymFnExists(srandom HAVE_SRANDOM) +xpcfgCheckSymFnExists(time HAVE_TIME) +xpcfgCheckSymFnExists(vprintf HAVE_VPRINTF) if(NOT HAVE_VPRINTF) - check_exists_define01(_doprnt HAVE_DOPRNT) + xpcfgCheckSymFnExists(_doprnt HAVE_DOPRNT) + # jasper calls xpcfgCheck_doprnt(HAVE_DOPRNT) + # TODO: determine which is more robust else() - set_define(HAVE_DOPRNT 1) + set(HAVE_DOPRNT 0) # cmakedefine endif() ########## cmake_push_check_state(RESET) -set(CMAKE_EXTRA_INCLUDE_FILES ${AMQ_INCLUDES}) +set(CMAKE_EXTRA_INCLUDE_FILES ${XP_INCLUDE_LIST}) check_type_size(char SIZEOF_CHAR) check_type_size(double SIZEOF_DOUBLE) check_type_size(float SIZEOF_FLOAT) @@ -116,284 +77,69 @@ check_type_size("long long" SIZEOF_LONG_LONG) check_type_size(short SIZEOF_SHORT) check_type_size(wchar_t SIZEOF_WCHAR_T) # sets HAVE_SIZEOF_WCHAR_T set(HAVE_WCHAR_T ${HAVE_SIZEOF_WCHAR_T}) -set_define(HAVE_WCHAR_T 1) check_type_size(size_t SIZEOF_SIZE_T) # sets HAVE_SIZEOF_SIZE_T if(NOT HAVE_SIZEOF_SIZE_T) set(size_t "unsigned int") # Define to `unsigned int' if does not define. +else() + set(size_t 0) # cmakedefine endif() set(CMAKE_EXTRA_INCLUDE_FILES) cmake_pop_check_state() ######################################## set(HAVE_OPENSSL ${OPENSSL_FOUND}) -set_define(HAVE_OPENSSL 1) -######################################## -# Define if building universal (internal helper macro) -set(AC_APPLE_UNIVERSAL_BUILD) #TODO: determine on Apple -set_define(AC_APPLE_UNIVERSAL_BUILD) -#################### -# Define if compiler provides atomic builtins -check_c_source_compiles(" -int main() -{ - unsigned long val = 1010, tmp, *mem = &val; - if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) - return 1; - tmp = val; - if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) - return 1; - if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) - return 1; - tmp = 3030; - if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) - return 1; - if (__sync_lock_test_and_set(&val, 4040) != 3030) - return 1; - mem = &tmp; - if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) - return 1; - __sync_synchronize(); - if (mem != &val) - return 1; - return 0; -} -" HAVE_ATOMIC_BUILTINS - ) -set_define(HAVE_ATOMIC_BUILTINS 1) -#################### -# Define if recursive pthread mutexes are available -check_c_source_compiles(" -#include -#include -#include -int main() -{ - pthread_mutexattr_t attr; - pthread_mutex_t m; - exit ( pthread_mutexattr_init(&attr) || - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) || - pthread_mutex_init(&m, &attr) ); -} -" HAVE_PTHREAD_MUTEX_RECURSIVE +set(AC_APPLE_UNIVERSAL_BUILD 0) # not used +xpcfgHaveAtomicBuiltins(HAVE_ATOMIC_BUILTINS) +xpcfgCheckPthreadFeatures( + HAVE_PTHREAD_MUTEX_RECURSIVE + HAVE_PTHREAD_MUTEX_ROBUST + HAVE_PTHREAD_MUTEX_ROBUST_NP + HAVE_PTHREAD_RWLOCKS ) -set_define(HAVE_PTHREAD_MUTEX_RECURSIVE 1) -#################### -# Define if pthread rwlocks are available -check_c_source_compiles(" -#include -#include -int main() -{ - pthread_rwlock_t *rwlock; - ; - return 0; -} -" HAVE_PTHREAD_RWLOCKS - ) -set_define(HAVE_PTHREAD_RWLOCKS 1) -#################### -# define if you have struct addrinfo -check_c_source_compiles(" -#ifdef HAVE_STDIO_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_NETDB_H -# include -#endif -int main() -{ - do { - struct addrinfo a; - (void) a.ai_flags; - } while(0) - ; - return 0; -} -" HAVE_STRUCT_ADDRINFO - ) -set_define(HAVE_STRUCT_ADDRINFO) -#################### +xpcfgHaveStructAddrinfo(HAVE_STRUCT_ADDRINFO) +if(HAVE_STRUCT_ADDRINFO) + set(DEFINE_HAVE_STRUCT_ADDRINFO cmakedefine) +endif() # define if you have -fvisibility options check_cxx_compiler_flag("-fvisibility=hidden -fvisibility-inlines-hidden" HAVE_VISIBILITY_OPTIONS) -set_define(HAVE_VISIBILITY_OPTIONS) -#################### -# Define to the sub-directory in which libtool stores uninstalled libraries. -execute_process(COMMAND libtool --version - OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE hasLibtool - ) -if(hasLibtool EQUAL 0) # 0 == success - set(LT_OBJDIR .libs/) +if(HAVE_VISIBILITY_OPTIONS) + set(DEFINE_HAVE_VISIBILITY_OPTIONS cmakedefine) endif() +xpcfgLtObjdir(LT_OBJDIR) #################### -# Name of package -set(PACKAGE ${PROJECT_NAME}) -# Version number of package +# determine version from configure.ac file(STRINGS configure.ac MAJOR REGEX "^ACTIVEMQ_MAJOR_VERSION=([0-9]+)") file(STRINGS configure.ac MINOR REGEX "^ACTIVEMQ_MINOR_VERSION=([0-9]+)") file(STRINGS configure.ac PATCH REGEX "^ACTIVEMQ_PATCH_VERSION=([0-9]+)") string(REGEX MATCH "([0-9]+)" MAJOR ${MAJOR}) string(REGEX MATCH "([0-9]+)" MINOR ${MINOR}) string(REGEX MATCH "([0-9]+)" PATCH ${PATCH}) -set(VERSION ${MAJOR}.${MINOR}.${PATCH}) +set(ver ${MAJOR}.${MINOR}.${PATCH}) +# Name of package +set(PACKAGE "\"${PROJECT_NAME}\"") # Define to the address where bug reports for this package should be sent. -set(PACKAGE_BUGREPORT "dev@activemq.apache.org") +set(PACKAGE_BUGREPORT "\"dev@activemq.apache.org\"") # Define to the full name of this package. -set(PACKAGE_NAME ${PACKAGE}) +set(PACKAGE_NAME "\"${PROJECT_NAME}\"") # Define to the full name and version of this package. -set(PACKAGE_STRING "${PACKAGE} ${VERSION}") +set(PACKAGE_STRING "\"${PROJECT_NAME} ${ver}\"") # Define to the one symbol short name of this package. -set(PACKAGE_TARNAME ${PACKAGE}) +set(PACKAGE_TARNAME "\"${PROJECT_NAME}\"") # Define to the home page for this package. -set(PACKAGE_URL http://activemq.apache.org/cms/) +set(PACKAGE_URL "\"http://activemq.apache.org/cms/\"") # Define to the version of this package. -set(PACKAGE_VERSION ${VERSION}) -#################### -# Define if pthread_attr_getdetachstate() has one arg -check_c_source_compiles(" -#include -int main() -{ - pthread_attr_t *attr; - pthread_attr_getdetachstate(attr); - ; - return 0; -} -" PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG - ) -set_define(PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG 1) -#################### -# Define if pthread_getspecific() has two args -check_c_source_compiles(" -#include -int main() -{ - pthread_key_t key; - void *tmp; - pthread_getspecific(key,&tmp); - ; - return 0; -} -" PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS - ) -set_define(PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS 1) +set(PACKAGE_VERSION "\"${ver}\"") +# Version number of package +set(VERSION "\"${ver}\"") #################### -# Define if sigwait takes one arg -check_c_source_compiles(" -#if defined(__NETBSD__) || defined(DARWIN) - /* When using the unproven-pthreads package, we need to pull in this - * header to get a prototype for sigwait(). Else things will fail later - * on. XXX Should probably be fixed in the unproven-pthreads package. - * Darwin is declaring sigwait() in the wrong place as well. - */ - #include -#endif -#include -int main() -{ - sigset_t set; - sigwait(&set); - ; - return 0; -} -" SIGWAIT_TAKES_ONE_ARG +xpcfgCheckPthreadAttrArgs( + PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG + PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS ) -set_define(SIGWAIT_TAKES_ONE_ARG 1) -#################### -# Define WORDS_BIGENDIAN to 1 if your processor stores words with the most -# significant byte first (like Motorola and SPARC, unlike Intel). +xpcfgCheckSigwaitArgs(SIGWAIT_TAKES_ONE_ARG) +xpcfgStdcHeaders(STDC_HEADERS) test_big_endian(WORDS_BIGENDIAN) -set_define(WORDS_BIGENDIAN 1) -######################################## -# Define to 1 if you have the ANSI C header files. -check_c_source_compiles(" -#include -#include -#include -#include -int main() -{ - ; - return 0; -} -" STDC_HEADERS - ) -set_define(STDC_HEADERS 1) -######################################## -# Define to empty if `const' does not conform to ANSI C. -check_c_source_compiles(" -int main() -{ -#ifndef __cplusplus - /* Ultrix mips cc rejects this sort of thing. */ - typedef int charset[2]; - const charset cs = { 0, 0 }; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = \"string\"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this sort of thing. */ - char tx; - char *t = &tx; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying - \"k.c\", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; } bx; - struct s *b = &bx; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - ; - return 0; -} -" ANSI_CONST - ) -if(NOT ANSI_CONST) - set(const empty) -endif() -set_define(const) -######################################## -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in .) -configure_file(${CMAKE_CURRENT_BINARY_DIR}/config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +xpcfgConst(const) +xpcfgDotinFile("config.h.in" "config.h") +cmake_pop_check_state() include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_definitions(-DHAVE_CONFIG_H) -################################################################################ -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_DEFINITIONS)