diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 07:50:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 07:50:14 +0000 |
commit | 7020f6bf1e08bb16ab742cfd17b109e196096ee2 (patch) | |
tree | 7ef0713cfca533a50589c9c64577c7986b485042 /configure | |
parent | Adding upstream version 0.7.1. (diff) | |
download | ck-upstream.tar.xz ck-upstream.zip |
Adding upstream version 0.7.2.upstream/0.7.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 114 |
1 files changed, 75 insertions, 39 deletions
@@ -32,15 +32,16 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 WANT_PIC=yes -P_PWD=`pwd` +BUILD_DIR=`pwd` MAINTAINER='sbahra@repnop.org' -VERSION=${VERSION:-'0.7.1'} +VERSION=${VERSION:-'0.7.2'} VERSION_MAJOR='0' BUILD="$PWD/build/ck.build" PREFIX=${PREFIX:-"/usr/local"} LDNAME="libck.so" LDNAME_VERSION="libck.so.$VERSION" LDNAME_MAJOR="libck.so.$VERSION_MAJOR" +EXTRA_BUILD='doc' OPTION_CHECKING=1 @@ -119,6 +120,7 @@ generate() -e "s#@GZIP_SUFFIX@#$GZIP_SUFFIX#g" \ -e "s#@POINTER_PACK_ENABLE@#$POINTER_PACK_ENABLE#g" \ -e "s#@DISABLE_DOUBLE@#$DISABLE_DOUBLE#g" \ + -e "s#@DISABLE_SHARED@#$DISABLE_SHARED#g" \ -e "s#@DISABLE_STATIC@#$DISABLE_STATIC#g" \ -e "s#@SSE_DISABLE@#$SSE_DISABLE#g" \ -e "s#@PPC32_LWSYNC_ENABLE@#$PPC32_LWSYNC_ENABLE#g" \ @@ -127,13 +129,14 @@ generate() -e "s#@VMA_BITS@#$VMA_BITS_R#g" \ -e "s#@VMA_BITS_VALUE@#$VMA_BITS_VALUE_R#g" \ -e "s#@MM@#$MM#g" \ - -e "s#@BUILD_DIR@#$P_PWD#g" \ - -e "s#@SRC_DIR@#$BUILD_DIR#g" \ + -e "s#@BUILD_DIR@#$BUILD_DIR#g" \ + -e "s#@SRC_DIR@#$SRC_DIR#g" \ -e "s#@LDNAME@#$LDNAME#g" \ -e "s#@LDNAME_MAJOR@#$LDNAME_MAJOR#g" \ -e "s#@LDNAME_VERSION@#$LDNAME_VERSION#g" \ -e "s#@PC_CFLAGS@#$PC_CFLAGS#g" \ -e "s#@GIT_SHA@#$GIT_SHA#g" \ + -e "s#@EXTRA_BUILD@#$EXTRA_BUILD#g" \ $1 > $2 } @@ -143,8 +146,8 @@ generate_stdout() echo echo " VERSION = $VERSION" echo " GIT_SHA = $GIT_SHA" - echo " BUILD_DIR = $P_PWD" - echo " SRC_DIR = $BUILD_DIR" + echo " BUILD_DIR = $BUILD_DIR" + echo " SRC_DIR = $SRC_DIR" echo " SYSTEM = $SYSTEM" echo " PROFILE = $PROFILE" echo " AR = $AR" @@ -157,7 +160,9 @@ generate_stdout() echo " LDNAME_VERSION = $LDNAME_VERSION" echo " LDNAME_MAJOR = $LDNAME_MAJOR" echo " LDFLAGS = $LDFLAGS" - echo " STATIC_LIB = $DISABLE_STATIC" + echo " SHARED_LIB = `expr $DISABLE_SHARED = 0`" + echo " STATIC_LIB = `expr $DISABLE_STATIC = 0`" + echo " EXTRA_BUILD = $EXTRA_BUILD" echo " GZIP = $GZIP" echo " CORES = $CORES" echo " POINTER_PACK = $POINTER_PACK_ENABLE" @@ -175,14 +180,14 @@ generate_stdout() for option; do case "$option" in - *=?*) + --*=?*) optname=`echo $option|cut -c 3-` value=`expr "$optname" : '[^=]*=\(.*\)'` ;; - *=) + --*=) value= ;; - *) + --*) value=yes ;; esac @@ -296,6 +301,9 @@ for option; do --disable-double) DISABLE_DOUBLE="CK_PR_DISABLE_DOUBLE" ;; + --disable-shared) + DISABLE_SHARED=1 + ;; --disable-static) DISABLE_STATIC=1 ;; @@ -305,7 +313,7 @@ for option; do --build=*|--host=*|--target=*|--exec-prefix=*|--bindir=*|--sbindir=*|\ --sysconfdir=*|--datadir=*|--libexecdir=*|--localstatedir=*|\ --enable-static|\ - --sharedstatedir=*|--infodir=*|--enable-shared|--disable-shared|\ + --sharedstatedir=*|--infodir=*|--enable-shared|\ --cache-file=*|--srcdir=*) # ignore for compat with regular configure ;; @@ -317,8 +325,8 @@ for option; do fi ;; *=*) - optname=`echo $option|cut -c 3-` - NAME=`expr "$optname" : '\([^=]*\)='` + value=`echo $option|cut -d '=' -f 2-` + NAME=`expr "$option" : '\([^=]*\)='` eval "$NAME='$value'" export $NAME ;; @@ -336,6 +344,7 @@ MANDIR=${MANDIR:-"${PREFIX}/share/man"} GZIP=${GZIP-"gzip -c"} POINTER_PACK_ENABLE=${POINTER_PACK_ENABLE:-"CK_MD_POINTER_PACK_DISABLE"} DISABLE_DOUBLE=${DISABLE_DOUBLE:-"CK_PR_ENABLE_DOUBLE"} +DISABLE_SHARED=${DISABLE_SHARED:-"0"} DISABLE_STATIC=${DISABLE_STATIC:-"0"} PPC32_LWSYNC_ENABLE=${PPC32_LWSYNC_ENABLE:-"CK_MD_PPC32_LWSYNC_DISABLE"} RTM_ENABLE=${RTM_ENABLE_SET:-"CK_MD_RTM_DISABLE"} @@ -424,6 +433,9 @@ case $PLATFORM in LDFLAGS="-m64 $LDFLAGS" ;; i386|i486|i586|i686|i586_i686|pentium*|athlon*|k5|k6|k6_2|k6_3) + if test "${SSE_DISABLE}" = "CK_MD_SSE_ENABLE"; then + CFLAGS="$CFLAGS -msse -msse2" + fi LSE_ENABLE="CK_MD_LSE_DISABLE" MM="${MM:-"CK_MD_TSO"}" case $SYSTEM in @@ -523,6 +535,18 @@ case $PLATFORM in PLATFORM=aarch64 ENVIRONMENT=64 ;; + "riscv32"|"riscv") + RTM_ENABLE="CK_MD_RTM_DISABLE" + MM="${MM:-"CK_MD_RMO"}" + PLATFORM=riscv32 + ENVIRONMENT=32 + ;; + "riscv64") + RTM_ENABLE="CK_MD_RTM_DISABLE" + MM="${MM:-"CK_MD_RMO"}" + PLATFORM=riscv64 + ENVIRONMENT=64 + ;; "s390x") RTM_ENABLE="CK_MD_RTM_DISABLE" LSE_ENABLE="CK_MD_LSE_DISABLE" @@ -551,8 +575,8 @@ else fi if test "$USE_CC_BUILTINS"; then - CFLAGS="$CFLAGS -DCK_CC_BUILTINS" - PC_CFLAGS="-DCK_CC_BULITINS" + CFLAGS="$CFLAGS -DCK_USE_CC_BUILTINS=1" + PC_CFLAGS="-DCK_USE_CC_BUILTINS=1" fi # `which` on Solaris sucks @@ -583,13 +607,13 @@ fi if test -z "$DIRNAME"; then echo "not found (out of source build unsupported)" else - printf "Determining build directory......" + printf "Determining source directory......" - BUILD_DIR=`$DIRNAME $0` + SRC_DIR=`$DIRNAME $0` cd `$DIRNAME $0` - BUILD_DIR=`pwd` + SRC_DIR=`pwd` - echo "success [$BUILD_DIR]" + echo "success [$SRC_DIR]" fi if test -n "$GZIP"; then @@ -716,9 +740,15 @@ elif test "$COMPILER" = "gcc" || test "$COMPILER" = "clang" || test "$COMPILER" LDFLAGS="$LDFLAGS -shared -fPIC" CFLAGS="$CFLAGS -fPIC" - if [ "$DISABLE_STATIC" -eq 1 ]; then + if [ "$DISABLE_SHARED" -eq 1 ] && [ "$DISABLE_STATIC" -eq 1 ]; then + echo "Error: You have choosen to disable the shared lib, yet you also disabled the static lib." 1>&2 + exit $EXIT_FAILURE + elif [ "$DISABLE_STATIC" -eq 1 ]; then ALL_LIBS="libck.so" INSTALL_LIBS="install-so" + elif [ "$DISABLE_SHARED" -eq 1 ]; then + ALL_LIBS="libck.a" + INSTALL_LIBS="install-lib" else ALL_LIBS="libck.so libck.a" INSTALL_LIBS="install-so install-lib" @@ -735,12 +765,18 @@ elif test "$COMPILER" = "gcc" || test "$COMPILER" = "clang" || test "$COMPILER" fi fi - CFLAGS="-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe -Wno-parentheses $CFLAGS" + CFLAGS="-D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe -Wno-parentheses $CFLAGS" PTHREAD_CFLAGS="-pthread" if test "$COMPILER" = "mingw64"; then ENVIRONMENT=64 PLATFORM=x86_64 fi + if test "$SYSTEM" = "netbsd"; then + CFLAGS="$CFLAGS -D_NETBSD_SOURCE" + fi + if test "$SYSTEM" != "dragonflybsd"; then + CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600" + fi else assert "" "unknown compiler" fi @@ -846,31 +882,31 @@ PROFILE="${PROFILE:-$PLATFORM}" PLATFORM="__${PLATFORM}__" printf "Generating header files.........." -generate include/ck_md.h.in include/ck_md.h -generate include/freebsd/ck_md.h.in include/freebsd/ck_md.h +mkdir -p $BUILD_DIR/include +mkdir -p $BUILD_DIR/include/freebsd +generate include/ck_md.h.in $BUILD_DIR/include/ck_md.h +generate include/freebsd/ck_md.h.in $BUILD_DIR/include/freebsd/ck_md.h echo "success" printf "Generating build files..........." -mkdir -p $P_PWD/doc -mkdir -p $P_PWD/build -mkdir -p $P_PWD/include -mkdir -p $P_PWD/src +mkdir -p $BUILD_DIR/doc +mkdir -p $BUILD_DIR/build +mkdir -p $BUILD_DIR/src -if test "$P_PWD" '!=' "$BUILD_DIR"; then - mkdir -p $P_PWD/regressions - cp $BUILD_DIR/regressions/Makefile.unsupported $P_PWD/regressions/Makefile &> /dev/null - cp $BUILD_DIR/build/ck.build.$PROFILE $P_PWD/build/ck.build.$PROFILE &> /dev/null - cp $BUILD_DIR/include/ck_md.h $P_PWD/include/ck_md.h &> /dev/null +if test "$BUILD_DIR" '!=' "$SRC_DIR"; then + mkdir -p $BUILD_DIR/regressions + cp $SRC_DIR/regressions/Makefile.unsupported $BUILD_DIR/regressions/Makefile &> /dev/null + cp $SRC_DIR/build/ck.build.$PROFILE $BUILD_DIR/build/ck.build.$PROFILE &> /dev/null fi -generate src/Makefile.in $P_PWD/src/Makefile -generate doc/Makefile.in $P_PWD/doc/Makefile -generate build/ck.build.in $P_PWD/build/ck.build -generate build/regressions.build.in $P_PWD/build/regressions.build -generate build/ck.pc.in $P_PWD/build/ck.pc -generate build/ck.spec.in $P_PWD/build/ck.spec -generate Makefile.in $P_PWD/Makefile +generate src/Makefile.in $BUILD_DIR/src/Makefile +generate doc/Makefile.in $BUILD_DIR/doc/Makefile +generate build/ck.build.in $BUILD_DIR/build/ck.build +generate build/regressions.build.in $BUILD_DIR/build/regressions.build +generate build/ck.pc.in $BUILD_DIR/build/ck.pc +generate build/ck.spec.in $BUILD_DIR/build/ck.spec +generate Makefile.in $BUILD_DIR/Makefile touch src/*.c echo "success" generate_stdout |