Skip to content

Commit b9cb8bb

Browse files
author
Herbert Koelman
committed
Merge branch 'iss-69' into develop
2 parents ea85274 + 3944956 commit b9cb8bb

File tree

9 files changed

+125
-17
lines changed

9 files changed

+125
-17
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
v1.6.2
2+
- the library name now includes verion infos
23
- change sonar project key

Makefile.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PACKAGE=@PACKAGE_NAME@-@PACKAGE_VERSION@-@[email protected]
1616
HEADERS=@HEADERS@
1717
DOXYGEN=@DOXYGEN@
1818
CODECHECK=@CODECHECK@
19+
LN_S=@LN_S@
1920

2021
PTHREADLIB=libcpp-pthread.a
2122

@@ -46,8 +47,10 @@ doxygen:
4647
install:
4748
$(MKDIR) $(INCLUDEDIR)
4849
cd include/pthread && $(INSTALL) *.hpp *.h $(INCLUDEDIR)
49-
$(INSTALL) lib/$(PTHREADLIB) @libdir@
50+
$(INSTALL) lib/lib@PACKAGE_NAME@-@[email protected] @libdir@
51+
cd ${LIBDIR} && $(LN_S) -f lib@PACKAGE_NAME@-@[email protected] lib@[email protected]
5052

5153
uninstall:
5254
$(RM) -R $(INCLUDEDIR)
53-
$(RM) @libdir@/$(PTHREADLIB)
55+
# not a good idea $(RM) @libdir@/lib@PACKAGE_NAME@-@[email protected] @libdir@/lib@[email protected]
56+
$(RM) @libdir@/lib@PACKAGE_NAME@*.a

configure

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ ac_subst_vars='LTLIBOBJS
589589
LIBOBJS
590590
HEADERS
591591
subdirs
592+
LN_S
592593
MKDIR_P
593594
DOXYGEN
594595
RM
@@ -600,6 +601,7 @@ build_os
600601
build_vendor
601602
build_cpu
602603
build
604+
BUILD
603605
target_alias
604606
host_alias
605607
build_alias
@@ -641,6 +643,8 @@ SHELL'
641643
ac_subst_files=''
642644
ac_user_opts='
643645
enable_option_checking
646+
enable_build
647+
enable_release
644648
enable_codecheck
645649
'
646650
ac_precious_vars='build_alias
@@ -1259,6 +1263,8 @@ Optional Features:
12591263
--disable-option-checking ignore unrecognized --enable/--with options
12601264
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
12611265
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1266+
--enable-build build name.
1267+
--enable-release build as release.
12621268
\
12631269
--enable-codecheck=PATH set CODECHECK to run a specific program
12641270
@@ -1734,6 +1740,26 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
17341740
17351741
17361742
1743+
# Check whether --enable-build was given.
1744+
if test "${enable_build+set}" = set; then :
1745+
enableval=$enable_build; BUILD=$enable_build
1746+
fi
1747+
1748+
# Check whether --enable-release was given.
1749+
if test "${enable_release+set}" = set; then :
1750+
enableval=$enable_release; BUILD=$PACKAGE_VERSION
1751+
fi
1752+
1753+
1754+
if test -z "$BUILD"
1755+
then
1756+
BUILD="SNAPSHOT"
1757+
{ $as_echo "$as_me:${as_lineno-$LINENO}: using default BUILD name $BUILD" >&5
1758+
$as_echo "$as_me: using default BUILD name $BUILD" >&6;}
1759+
fi
1760+
BUILD=$BUILD
1761+
1762+
17371763
# Make sure we can run config.sub.
17381764
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
17391765
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
@@ -1991,6 +2017,17 @@ fi
19912017
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
19922018
$as_echo "$MKDIR_P" >&6; }
19932019
2020+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
2021+
$as_echo_n "checking whether ln -s works... " >&6; }
2022+
LN_S=$as_ln_s
2023+
if test "$LN_S" = "ln -s"; then
2024+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2025+
$as_echo "yes" >&6; }
2026+
else
2027+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
2028+
$as_echo "no, using $LN_S" >&6; }
2029+
fi
2030+
19942031
19952032
# Okay, no cppcheck found, maybe we have sonar
19962033
if test -z "$CODECHECK"

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ AC_LANG(C++)
77

88
AC_CONFIG_AUX_DIR([/usr/bin . bin])
99

10+
AC_ARG_ENABLE([build], AS_HELP_STRING([--enable-build],[build name.]), BUILD=$enable_build)
11+
AC_ARG_ENABLE([release], AS_HELP_STRING([--enable-release],[build as release.]), BUILD=$PACKAGE_VERSION)
12+
13+
if test -z "$BUILD"
14+
then
15+
BUILD="SNAPSHOT"
16+
AC_MSG_NOTICE([using default BUILD name $BUILD])
17+
fi
18+
AC_SUBST(BUILD,$BUILD)
19+
1020
AC_CANONICAL_BUILD
1121

1222
AC_ARG_VAR([CODECHECK], [code quality control program])
@@ -18,6 +28,7 @@ AC_PROG_INSTALL
1828
AC_CHECK_PROG([RM],[rm],[rm -f])
1929
AC_CHECK_PROG([DOXYGEN],[doxygen],[doxygen],[echo \"please install doxygen and re-run ./configure, or run it manualy doxygen \"])
2030
AC_PROG_MKDIR_P
31+
AC_PROG_LN_S
2132

2233
# Okay, no cppcheck found, maybe we have sonar
2334
if test -z "$CODECHECK"

doxyfile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ DOXYFILE_ENCODING = UTF-8
3232
# title of most generated pages and in a few other places.
3333
# The default value is: My Project.
3434

35-
PROJECT_NAME = "C++ pThread wrapper"
35+
PROJECT_NAME = "@PACKAGE_NAME@"
3636

3737
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = (@PACKAGE_VERSION@)
41+
PROJECT_NUMBER = (@BUILD@)
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

sonar-project.properties.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sonar.projectKey=ITC-cpp-pthread
1414

1515
# Name of the project that will be displayed on the web interface.
1616
sonar.projectName=pmu:cpp-pthread
17-
sonar.projectVersion=@PACKAGE_VERSION@
17+
sonar.projectVersion=@BUILD@
1818

1919
# Comma-separated paths to directories containing source files
2020
sonar.sources=src,include/pthread

src/Makefile.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RANLIB=@RANLIB@
2020
RM=rm -f
2121
AR=@AR@ @ARFLAGS@
2222
MV=@MV@
23+
LN_S=@LN_S@
2324

2425
BITS=@BITS@
2526
OBJECT_MODE=$(BITS)
@@ -34,20 +35,21 @@ LIBS=@LIBS@
3435

3536
OBJECTS=@OBJECTS@
3637

37-
TARGETS=libcpp-pthread.a
38+
TARGETS=lib@PACKAGE_NAME@-@BUILD@.a
3839

3940
all:${TARGETS}
4041

41-
libcpp-pthread.a: $(OBJECTS)
42+
lib@PACKAGE_NAME@-@BUILD@.a: $(OBJECTS)
4243
${AR} ${LIBDIR}/$@ $(OBJECTS)
4344
$(RANLIB) ${LIBDIR}/$@
45+
cd ${LIBDIR} && $(LN_S) -f lib@PACKAGE_NAME@-@[email protected] lib@[email protected]
4446

4547
globber: clean
4648
-$(RM) -R Makefile autom4te.cache config.log config.status
4749

4850
clean:
4951
${RM} *.o core *.a
50-
${RM} $(LIBDIR)/libcpp-pthread.a ${TARGETS}
52+
cd $(LIBDIR) && ${RM} lib@PACKAGE_NAME@*
5153

5254
cxref:
5355
cxref *.c -xref -index-all -latex209 -O${XREFDIR} -I${INCDIR} -I${INCTUX}

src/configure

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ BITS
630630
EGREP
631631
GREP
632632
CXXCPP
633+
BUILD
634+
LN_S
633635
RANLIB
634636
MV
635637
AR
@@ -684,6 +686,8 @@ SHELL'
684686
ac_subst_files=''
685687
ac_user_opts='
686688
enable_option_checking
689+
enable_build
690+
enable_release
687691
'
688692
ac_precious_vars='build_alias
689693
host_alias
@@ -1302,6 +1306,13 @@ if test -n "$ac_init_help"; then
13021306
esac
13031307
cat <<\_ACEOF
13041308
1309+
Optional Features:
1310+
--disable-option-checking ignore unrecognized --enable/--with options
1311+
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1312+
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1313+
--enable-build build name.
1314+
--enable-release build as release.
1315+
13051316
Some influential environment variables:
13061317
CXX C++ compiler command
13071318
CXXFLAGS C++ compiler flags
@@ -2358,11 +2369,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
23582369
ac_config_headers="$ac_config_headers ../include/pthread/config.h"
23592370
23602371
2361-
cat >>confdefs.h <<_ACEOF
2362-
#define CPP_PTHREAD_VERSION "$PACKAGE_NAME $PACKAGE_VERSION - $(git log --pretty='%H' | head -1) - compiled on `uname -sv`."
2363-
_ACEOF
2364-
2365-
23662372
# Checks for programs.
23672373
ac_ext=cpp
23682374
ac_cpp='$CXXCPP $CPPFLAGS'
@@ -3385,6 +3391,42 @@ else
33853391
RANLIB="$ac_cv_prog_RANLIB"
33863392
fi
33873393

3394+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
3395+
$as_echo_n "checking whether ln -s works... " >&6; }
3396+
LN_S=$as_ln_s
3397+
if test "$LN_S" = "ln -s"; then
3398+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3399+
$as_echo "yes" >&6; }
3400+
else
3401+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
3402+
$as_echo "no, using $LN_S" >&6; }
3403+
fi
3404+
3405+
3406+
# Check whether --enable-build was given.
3407+
if test "${enable_build+set}" = set; then :
3408+
enableval=$enable_build; BUILD=$enable_build
3409+
fi
3410+
3411+
# Check whether --enable-release was given.
3412+
if test "${enable_release+set}" = set; then :
3413+
enableval=$enable_release; BUILD=$PACKAGE_VERSION
3414+
fi
3415+
3416+
3417+
if test -z "$BUILD"
3418+
then
3419+
BUILD="SNAPSHOT"
3420+
{ $as_echo "$as_me:${as_lineno-$LINENO}: using default BUILD name $BUILD" >&5
3421+
$as_echo "$as_me: using default BUILD name $BUILD" >&6;}
3422+
fi
3423+
BUILD=$BUILD
3424+
3425+
3426+
cat >>confdefs.h <<_ACEOF
3427+
#define CPP_PTHREAD_VERSION "$PACKAGE_NAME $BUILD - $(git log --pretty='commit: %h, %cn (%cI)' | head -1) - compiled on `uname -sv`."
3428+
_ACEOF
3429+
33883430

33893431
CFLAGS="-I ../include -I ./"
33903432

@@ -3817,12 +3859,12 @@ _ACEOF
38173859

38183860
if test $ac_cv_sizeof_long == "8"
38193861
then
3862+
# AC_MSG_RESULT([using 64 bits (long is $ac_cv_sizeof_long bytes)])
38203863
BITS="64"
38213864

38223865
bits=64
38233866
else
3824-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using 32 bits (default)" >&5
3825-
$as_echo "using 32 bits (default)" >&6; }
3867+
# AC_MSG_RESULT([using 32 bits (long is $ac_cv_sizeof_long bytes)])
38263868
BITS="32"
38273869

38283870
bits=32

src/configure.ac

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,36 @@ AC_LANG(C++)
77
AC_CONFIG_SRCDIR([thread.cpp])
88
AC_CONFIG_AUX_DIR([/usr/bin ../ ../bin])
99
AC_CONFIG_HEADERS([../include/pthread/config.h])
10-
AC_DEFINE_UNQUOTED(CPP_PTHREAD_VERSION, ["$PACKAGE_NAME $PACKAGE_VERSION - $(git log --pretty='%H' | head -1) - compiled on `uname -sv`."], [pthread C++ wrapper.])
1110

1211
# Checks for programs.
1312
AC_PROG_CXX([xlC_r xlC g++ c++ gcc cl KCC CC cxx cc++ aCC ])
1413
AC_PROG_CC([xlc xlc_r gcc cl cc])
1514
AC_CHECK_PROG([AR],[ar],[ar -rv])
1615
AC_CHECK_PROG([MV],[mv],[mv],[echo "no mv command found"])
1716
AC_PROG_RANLIB
17+
AC_PROG_LN_S
18+
19+
AC_ARG_ENABLE([build], AS_HELP_STRING([--enable-build],[build name.]), BUILD=$enable_build)
20+
AC_ARG_ENABLE([release], AS_HELP_STRING([--enable-release],[build as release.]), BUILD=$PACKAGE_VERSION)
21+
22+
if test -z "$BUILD"
23+
then
24+
BUILD="SNAPSHOT"
25+
AC_MSG_NOTICE([using default BUILD name $BUILD])
26+
fi
27+
AC_SUBST(BUILD,$BUILD)
28+
AC_DEFINE_UNQUOTED(CPP_PTHREAD_VERSION, ["$PACKAGE_NAME $BUILD - $(git log --pretty='commit: %h, %cn (%cI)' | head -1) - compiled on `uname -sv`."], [pthread C++ wrapper.])
1829

1930
CFLAGS="-I ../include -I ./"
2031

2132
AC_CHECK_SIZEOF([long])
2233
if test $ac_cv_sizeof_long == "8"
2334
then
35+
# AC_MSG_RESULT([using 64 bits (long is $ac_cv_sizeof_long bytes)])
2436
AC_SUBST(BITS,"64")
2537
bits=64
2638
else
27-
AC_MSG_RESULT([using 32 bits (default)])
39+
# AC_MSG_RESULT([using 32 bits (long is $ac_cv_sizeof_long bytes)])
2840
AC_SUBST(BITS,"32")
2941
bits=32
3042
fi

0 commit comments

Comments
 (0)