configure: Add --platform and --use-cc-builtins

--platform let you set the platform, instead of relying on uname -m
--use-cc-builtins force the usage of gcc atomic builtins, instead of using the one provided by CK.
ck_pring
Olivier Houchard 9 years ago
parent a7cf4a4dab
commit c0c0b19716

@ -7,4 +7,4 @@ Description: Toolkit for well-specified design and implementation of concurrent
URL: http://concurrencykit.org/ URL: http://concurrencykit.org/
Version: @VERSION@ Version: @VERSION@
Libs: -L${libdir} -lck Libs: -L${libdir} -lck
Cflags: -D__@PROFILE@__ -I${includedir} Cflags: -D__@PROFILE@__ -I${includedir} @PC_CFLAGS

19
configure vendored

@ -111,6 +111,7 @@ generate()
-e "s#@LDNAME@#$LDNAME#g" \ -e "s#@LDNAME@#$LDNAME#g" \
-e "s#@LDNAME_MAJOR@#$LDNAME_MAJOR#g" \ -e "s#@LDNAME_MAJOR@#$LDNAME_MAJOR#g" \
-e "s#@LDNAME_VERSION@#$LDNAME_VERSION#g" \ -e "s#@LDNAME_VERSION@#$LDNAME_VERSION#g" \
-e "s#@PC_CFLAGS#$PC_CFLAGS#g" \
$1 > $2 $1 > $2
} }
@ -175,6 +176,8 @@ for option; do
echo " --enable-rtm Enable restricted transactional memory (power, x86_64)" echo " --enable-rtm Enable restricted transactional memory (power, x86_64)"
echo " --memory-model=N Specify memory model (currently tso, pso or rmo)" echo " --memory-model=N Specify memory model (currently tso, pso or rmo)"
echo " --vma-bits=N Specify valid number of VMA bits" echo " --vma-bits=N Specify valid number of VMA bits"
echo " --platform=N Force the platform type, instead of relying on autodetection"
echo " --use-cc-builtins Use the compiler atomic bultin functions, instead of the CK implementation"
echo echo
echo "The following options affect regression testing." echo "The following options affect regression testing."
echo " --cores=N Specify number of cores available on target machine" echo " --cores=N Specify number of cores available on target machine"
@ -241,6 +244,12 @@ for option; do
--disable-option-checking) --disable-option-checking)
OPTION_CHECKING=0 OPTION_CHECKING=0
;; ;;
--use-cc-builtins)
USE_CC_BUILTINS=1
;;
--platform=*)
PLATFORM=$value
;;
--build=*|--host=*|--target=*|--exec-prefix=*|--bindir=*|--sbindir=*|\ --build=*|--host=*|--target=*|--exec-prefix=*|--bindir=*|--sbindir=*|\
--sysconfdir=*|--datadir=*|--libexecdir=*|--localstatedir=*|\ --sysconfdir=*|--datadir=*|--libexecdir=*|--localstatedir=*|\
--enable-static|\ --enable-static|\
@ -320,7 +329,10 @@ assert "$SYSTEM" "$SYSTEM" "unsupported"
CORES=${CORES:-${DCORES}} CORES=${CORES:-${DCORES}}
printf "Detecting machine architecture..." printf "Detecting machine architecture..."
if test "x$PLATFORM" = "x"; then
PLATFORM=`uname -m 2> /dev/null` PLATFORM=`uname -m 2> /dev/null`
fi
case $PLATFORM in case $PLATFORM in
"macppc"|"Power Macintosh"|"powerpc") "macppc"|"Power Macintosh"|"powerpc")
RTM_ENABLE="CK_MD_RTM_DISABLE" RTM_ENABLE="CK_MD_RTM_DISABLE"
@ -413,7 +425,7 @@ case $PLATFORM in
;; ;;
arm|armv6l|armv7l) arm|armv6l|armv7l)
if test "$PLATFORM" = "armv6l"; then if test "$PLATFORM" = "armv6l"; then
CFLAGS="$CFLAGS -march=armv6"; CFLAGS="$CFLAGS -march=armv6k";
elif test "$PLATFORM" = "armv7l"; then elif test "$PLATFORM" = "armv7l"; then
CFLAGS="$CFLAGS -march=armv7-a"; CFLAGS="$CFLAGS -march=armv7-a";
fi fi
@ -446,6 +458,11 @@ else
VMA_BITS_VALUE_R="${VMA_BITS}ULL" VMA_BITS_VALUE_R="${VMA_BITS}ULL"
fi fi
if test "$USE_CC_BUILTINS"; then
CFLAGS="$CFLAGS -DCK_CC_BUILTINS"
PC_CFLAGS="-DCK_CC_BULITINS"
fi
# `which` on Solaris sucks # `which` on Solaris sucks
pathsearch() pathsearch()
{ {

@ -34,6 +34,7 @@
#include <ck_stdint.h> #include <ck_stdint.h>
#include <stdbool.h> #include <stdbool.h>
#ifndef CK_USE_CC_BUILTINS
#if defined(__x86_64__) #if defined(__x86_64__)
#include "gcc/x86_64/ck_pr.h" #include "gcc/x86_64/ck_pr.h"
#elif defined(__x86__) #elif defined(__x86__)
@ -49,6 +50,7 @@
#elif !defined(__GNUC__) #elif !defined(__GNUC__)
#error Your platform is unsupported #error Your platform is unsupported
#endif #endif
#endif /* !CK_USE_CC_BUILTINS */
#if defined(__GNUC__) #if defined(__GNUC__)
#include "gcc/ck_pr.h" #include "gcc/ck_pr.h"

Loading…
Cancel
Save