Skip to content

Commit df3cca7

Browse files
issue #24
- moved doxyfile into doxyfile.in. configure now sets the documentation version (doxyfile.in)
1 parent cbc1511 commit df3cca7

File tree

8 files changed

+94
-45
lines changed

8 files changed

+94
-45
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ config.log
5050
Makefile
5151

5252
# layout
53+
doxyfile
54+
distrib/
5355
lib/
5456
doc/
5557
pthread-tests

Makefile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ all:
1818
cd src && $(MAKE) clean all
1919

2020
pkg:
21-
tar cf - ./ | gzip -c > distrib/$(PACKAGE)
21+
$(MKDIR) distrib
22+
tar cf - `git ls-files` | gzip -c > distrib/$(PACKAGE)
2223

2324
globber:clean
2425
-$(RM) -R Makefile autom4te.cache config.log config.status
25-
-(cd src && $(MAKE) globber)
2626

2727
clean:
28-
cd src && $(MAKE) clean
28+
-(cd src && $(MAKE) clean)
2929

3030
doxygen:
3131
${DOXYGEN} doxyfile

README.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,44 @@ Install moves files into your system's default localtion of headers and librarie
1616
configure --prefix=/usr/local
1717
```
1818

19-
[Doxygen documentation](http://herbertkoelman.github.io/cpp-pthread/doc/html/) can be generated with this command:
19+
[Doxygen documentation](http://herbertkoelman.github.io/cpp-pthread/doc/html/) can be generated with this command. I hope this help make things easier to use and understand.
2020
```
2121
make doxygen
22-
...
2322
```
2423

25-
The target `pkg` will produce au tar.gz.
24+
> Doxygen can be downloaded [here](http://www.stack.nl/~dimitri/doxygen/index.html).
2625
27-
This command creates a `doc` directory wich will contain the generated documentation.
28-
29-
> **warning** generating documentation requires that doxygen is installed.
30-
31-
The confugre file is not versionned, therefore it is required to run `autoconf` to generate one
32-
```
33-
autoconf
34-
( cd src && autoconf )
35-
( cd tests && autoconf )
36-
```
26+
The `make` target `pkg` will produce au tar.gz that can be distributed.
3727

3828
### How to use it
3929

40-
Once compiled and installed in a location that suites you, use your compiler options to reference the headers and the libraries directory. In almoast all casses you can:
30+
Once compiled and installed in a location that suites you, use your compiler options to reference the headers and the library directory. In almoast all casses you can:
4131
* include `#include "pthread/phtread.hpp"` in your code.
4232
* comment the c++11 standard includes in your code
4333
* declare that you're now using the namespace pthread (`using namespace pthread ;`)
4434

45-
It should now compile use this very simple (but often good enough) implementation.
35+
Sample code can be found in the `tests` directory. To use it, run the following commands:
36+
```
37+
cd tests
38+
./configure
39+
./make
40+
```
4641

4742
### Usefull links
4843

49-
* [documentation](http://pubs.opengroup.org/onlinepubs/007908799/xsh/threads.html) of the underlying POSIX threading library
44+
#### project links
45+
5046
* [project's home](https://github.com/HerbertKoelman/cpp-pthread)
5147
* [project's doxygen](http://herbertkoelman.github.io/cpp-pthread/doc/html/)
48+
49+
#### other
50+
51+
* POSIX Threads [documentation](http://pubs.opengroup.org/onlinepubs/007908799/xsh/threads.html)
5252
* [std::thread](http://en.cppreference.com/w/cpp/thread/thread) implementation we try to mimic
5353
* [std::lock_guard](http://en.cppreference.com/w/cpp/thread/lock_guard/lock_guard) implementation we try to mimic
5454
* [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex) implementation we try to mimic
5555
* [std::condition_variable](http://en.cppreference.com/w/cpp/thread/condition_variable) implementation we try to mimic
5656

57-
More [here](https://github.com/HerbertKoelman/cpp-pthread/wiki)
58-
5957
### misc
6058

6159
* author herbert koelman

configure

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for cpp-pthread v1.2.0-13-g4209365.
3+
# Generated by GNU Autoconf 2.69 for cpp-pthread v1.2.0.
44
#
5-
# Report bugs to <herbert.koelman@pmu.fr>.
5+
# Report bugs to <herbert.koelman@me.com>.
66
#
77
#
88
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -266,7 +266,7 @@ fi
266266
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
267267
else
268268
$as_echo "$0: Please tell [email protected] and
269-
$0: herbert.koelman@pmu.fr about your system, including any
269+
$0: herbert.koelman@me.com about your system, including any
270270
$0: error possibly output before this message. Then install
271271
$0: a modern shell, or manually run the script under such a
272272
$0: shell if you do have one."
@@ -579,10 +579,10 @@ MAKEFLAGS=
579579
# Identity of this package.
580580
PACKAGE_NAME='cpp-pthread'
581581
PACKAGE_TARNAME='cpp-pthread'
582-
PACKAGE_VERSION='v1.2.0-13-g4209365'
583-
PACKAGE_STRING='cpp-pthread v1.2.0-13-g4209365'
584-
PACKAGE_BUGREPORT='herbert.koelman@pmu.fr'
585-
PACKAGE_URL=''
582+
PACKAGE_VERSION='v1.2.0'
583+
PACKAGE_STRING='cpp-pthread v1.2.0'
584+
PACKAGE_BUGREPORT='herbert.koelman@me.com'
585+
PACKAGE_URL='http://herbertkoelman.github.io/cpp-pthread/'
586586

587587
enable_option_checking=no
588588
ac_subst_vars='LTLIBOBJS
@@ -644,7 +644,7 @@ enable_option_checking
644644
ac_precious_vars='build_alias
645645
host_alias
646646
target_alias'
647-
ac_subdirs_all='src tests'
647+
ac_subdirs_all='src'
648648

649649
# Initialize some variables set by options.
650650
ac_init_help=
@@ -1184,7 +1184,7 @@ if test "$ac_init_help" = "long"; then
11841184
# Omit some internal or obsolete options to make the list less imposing.
11851185
# This message is too long to be a string in the A/UX 3.1 sh.
11861186
cat <<_ACEOF
1187-
\`configure' configures cpp-pthread v1.2.0-13-g4209365 to adapt to many kinds of systems.
1187+
\`configure' configures cpp-pthread v1.2.0 to adapt to many kinds of systems.
11881188
11891189
Usage: $0 [OPTION]... [VAR=VALUE]...
11901190
@@ -1248,11 +1248,12 @@ fi
12481248

12491249
if test -n "$ac_init_help"; then
12501250
case $ac_init_help in
1251-
short | recursive ) echo "Configuration of cpp-pthread v1.2.0-13-g4209365:";;
1251+
short | recursive ) echo "Configuration of cpp-pthread v1.2.0:";;
12521252
esac
12531253
cat <<\_ACEOF
12541254
1255-
Report bugs to <[email protected]>.
1255+
Report bugs to <[email protected]>.
1256+
cpp-pthread home page: <http://herbertkoelman.github.io/cpp-pthread/>.
12561257
_ACEOF
12571258
ac_status=$?
12581259
fi
@@ -1315,7 +1316,7 @@ fi
13151316
test -n "$ac_init_help" && exit $ac_status
13161317
if $ac_init_version; then
13171318
cat <<\_ACEOF
1318-
cpp-pthread configure v1.2.0-13-g4209365
1319+
cpp-pthread configure v1.2.0
13191320
generated by GNU Autoconf 2.69
13201321
13211322
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1332,7 +1333,7 @@ cat >config.log <<_ACEOF
13321333
This file contains any messages produced by compilers while
13331334
running configure, to aid debugging if configure makes a mistake.
13341335
1335-
It was created by cpp-pthread $as_me v1.2.0-13-g4209365, which was
1336+
It was created by cpp-pthread $as_me v1.2.0, which was
13361337
generated by GNU Autoconf 2.69. Invocation command line was
13371338
13381339
$ $0 $@
@@ -1988,9 +1989,9 @@ HEADERS=$HEADERS
19881989

19891990

19901991

1991-
subdirs="$subdirs src tests"
1992+
subdirs="$subdirs src"
19921993

1993-
ac_config_files="$ac_config_files Makefile"
1994+
ac_config_files="$ac_config_files Makefile doxyfile"
19941995

19951996
cat >confcache <<\_ACEOF
19961997
# This file is a shell script that caches the results of configure
@@ -2534,7 +2535,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
25342535
# report actual input values of CONFIG_FILES etc. instead of their
25352536
# values after options handling.
25362537
ac_log="
2537-
This file was extended by cpp-pthread $as_me v1.2.0-13-g4209365, which was
2538+
This file was extended by cpp-pthread $as_me v1.2.0, which was
25382539
generated by GNU Autoconf 2.69. Invocation command line was
25392540
25402541
CONFIG_FILES = $CONFIG_FILES
@@ -2581,13 +2582,14 @@ Usage: $0 [OPTION]... [TAG]...
25812582
Configuration files:
25822583
$config_files
25832584
2584-
Report bugs to <[email protected]>."
2585+
Report bugs to <[email protected]>.
2586+
cpp-pthread home page: <http://herbertkoelman.github.io/cpp-pthread/>."
25852587
25862588
_ACEOF
25872589
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
25882590
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
25892591
ac_cs_version="\\
2590-
cpp-pthread config.status v1.2.0-13-g4209365
2592+
cpp-pthread config.status v1.2.0
25912593
configured by $0, generated by GNU Autoconf 2.69,
25922594
with options \\"\$ac_cs_config\\"
25932595
@@ -2700,6 +2702,7 @@ for ac_config_target in $ac_config_targets
27002702
do
27012703
case $ac_config_target in
27022704
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
2705+
"doxyfile") CONFIG_FILES="$CONFIG_FILES doxyfile" ;;
27032706
27042707
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
27052708
esac

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ(2.69)
5-
AC_INIT([cpp-pthread],[m4_esyscmd_s(echo $(git describe --always))],[herbert.koelman@pmu.fr],[])
5+
AC_INIT([cpp-pthread],[m4_esyscmd_s(echo $(git describe --always --abbrev=0))],[herbert.koelman@me.com],[],[http://herbertkoelman.github.io/cpp-pthread/])
66
AC_LANG(C++)
77

88
AC_CONFIG_AUX_DIR([/usr/bin . bin])
@@ -29,7 +29,7 @@ do
2929
done
3030
AC_SUBST(HEADERS,$HEADERS)
3131

32-
AC_CONFIG_SUBDIRS(src tests)
33-
AC_CONFIG_FILES([Makefile])
32+
AC_CONFIG_SUBDIRS(src)
33+
AC_CONFIG_FILES([Makefile doxyfile])
3434
AC_OUTPUT
3535

doxyfile renamed to doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "C++ pThread wrapper"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = v1.2.0
41+
PROJECT_NUMBER = (@PACKAGE_VERSION@)
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

tests/configure

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3989,7 +3989,53 @@ else
39893989
as_fn_error $? "missing pthread library." "$LINENO" 5
39903990
fi
39913991

3992-
#AC_CHECK_LIB([cpp-pthread], [cpp_pthread_version],[],[AC_ERROR([missing cpp-thread library.])])
3992+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpp_pthread_version in -lcpp-pthread" >&5
3993+
$as_echo_n "checking for cpp_pthread_version in -lcpp-pthread... " >&6; }
3994+
if ${ac_cv_lib_cpp_pthread_cpp_pthread_version+:} false; then :
3995+
$as_echo_n "(cached) " >&6
3996+
else
3997+
ac_check_lib_save_LIBS=$LIBS
3998+
LIBS="-lcpp-pthread $LIBS"
3999+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4000+
/* end confdefs.h. */
4001+
4002+
/* Override any GCC internal prototype to avoid an error.
4003+
Use char because int might match the return type of a GCC
4004+
builtin and then its argument prototype would still apply. */
4005+
#ifdef __cplusplus
4006+
extern "C"
4007+
#endif
4008+
char cpp_pthread_version ();
4009+
int
4010+
main ()
4011+
{
4012+
return cpp_pthread_version ();
4013+
;
4014+
return 0;
4015+
}
4016+
_ACEOF
4017+
if ac_fn_cxx_try_link "$LINENO"; then :
4018+
ac_cv_lib_cpp_pthread_cpp_pthread_version=yes
4019+
else
4020+
ac_cv_lib_cpp_pthread_cpp_pthread_version=no
4021+
fi
4022+
rm -f core conftest.err conftest.$ac_objext \
4023+
conftest$ac_exeext conftest.$ac_ext
4024+
LIBS=$ac_check_lib_save_LIBS
4025+
fi
4026+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpp_pthread_cpp_pthread_version" >&5
4027+
$as_echo "$ac_cv_lib_cpp_pthread_cpp_pthread_version" >&6; }
4028+
if test "x$ac_cv_lib_cpp_pthread_cpp_pthread_version" = xyes; then :
4029+
cat >>confdefs.h <<_ACEOF
4030+
#define HAVE_LIBCPP_PTHREAD 1
4031+
_ACEOF
4032+
4033+
LIBS="-lcpp-pthread $LIBS"
4034+
4035+
else
4036+
as_fn_error $? "missing cpp-thread library." "$LINENO" 5
4037+
fi
4038+
39934039

39944040
# Checks for header files.
39954041
#AC_HEADER_STDC

tests/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ CPPFLAGS="$CPPFLAGS $CFLAGS"
5454

5555
# Checks for libraries.
5656
AC_CHECK_LIB([pthread], [pthread_create],[],[AC_ERROR([missing pthread library.])])
57-
#AC_CHECK_LIB([cpp-pthread], [cpp_pthread_version],[],[AC_ERROR([missing cpp-thread library.])])
57+
AC_CHECK_LIB([cpp-pthread], [cpp_pthread_version],[],[AC_ERROR([missing cpp-thread library.])])
5858

5959
# Checks for header files.
6060
#AC_HEADER_STDC

0 commit comments

Comments
 (0)