diff --git a/Makefile.in b/Makefile.in index d590f73..dfd9e1e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -8,6 +8,7 @@ LIBRARY=@LIBRARY@ HEADERS=@HEADERS@ PKGCONFIG_DATA=@LIBRARY@/pkgconfig MANDIR=@MANDIR@ +GZIP_SUFFIX=@GZIP_SUFFIX@ all: doc $(MAKE) -C src all || exit @@ -34,7 +35,7 @@ install-headers: install-doc: doc mkdir -p $(DESTDIR)/$(MANDIR)/man3 || exit - cp doc/*.3.gz $(DESTDIR)/$(MANDIR)/man3 || exit + cp doc/*.3$(GZIP_SUFFIX) $(DESTDIR)/$(MANDIR)/man3 || exit install: all install-headers install-doc mkdir -p $(DESTDIR)/$(LIBRARY) || exit @@ -71,3 +72,4 @@ distribution: clean rm -f build/ck.spec rm -f build/ck.pc rm -f Makefile + rm -f doc/Makefile diff --git a/configure b/configure index 9c9859a..5f696a8 100755 --- a/configure +++ b/configure @@ -89,6 +89,8 @@ generate() -e "s#@LDFLAGS@#$LDFLAGS#g" \ -e "s#@PTHREAD_CFLAGS@#$PTHREAD_CFLAGS#g" \ -e "s#@MANDIR@#$MANDIR#g" \ + -e "s#@GZIP@#$GZIP#g" \ + -e "s#@GZIP_SUFFIX@#$GZIP_SUFFIX#g" \ $1 > $2 } @@ -103,6 +105,7 @@ generate_stdout() echo " PTHREAD_CFLAGS = $PTHREAD_CFLAGS" echo " LD = $LD" echo " LDFLAGS = $LDFLAGS" + echo " GZIP = $GZIP" echo echo "Headers will be installed in $HEADERS" echo "Libraries will be installed in $LIBRARY" @@ -122,11 +125,14 @@ for option in $*; do echo "The following options may be used to modify installation behavior." echo " --includedir=N Headers directory (default is ${PREFIX}/include)" echo " --libdir=N Libraries directory (default is ${PREFIX}/lib)" + echo " --mandir=N Manual pages directory (default is ${PREFIX}/man)" echo " --prefix=N Installs library files in N (default is $PREFIX)" echo echo "The following environment variables may be used:" echo " CC C compiler command" echo " CFLAGS C compiler flags" + echo " LDFLAGS Linker flags" + echo " GZIP GZIP compression tool" echo echo "Report bugs to ${MAINTAINER}." exit $EXIT_SUCCESS @@ -156,6 +162,7 @@ done HEADERS=${HEADERS:-"${PREFIX}/include"} LIBRARY=${LIBRARY:-"${PREFIX}/lib"} MANDIR=${MANDIR:-"${PREFIX}/man"} +GZIP=${GZIP:-"gzip -c"} if test "$PROFILE"; then printf "Using user-specified profile....." @@ -172,6 +179,7 @@ if test "$PROFILE"; then echo "success [$PROFILE]" printf "Generating build files..........." + generate doc/Makefile.in doc/Makefile generate build/ck.build.in build/ck.build generate build/regressions.build.in build/regressions.build generate build/ck.pc.in build/ck.pc @@ -305,8 +313,6 @@ assert "$PLATFORM" "$PLATFORM" "unsupported" PROFILE="${PROFILE:-$PLATFORM}" PLATFORM="__${PLATFORM}__" -printf "Finding suitable compiler........" - # `which` on Solaris sucks pathsearch() { @@ -323,6 +329,24 @@ pathsearch() IFS="$oldFS" } +printf "Finding gzip tool................" +GZIP=`pathsearch "${GZIP:-gzip}"` +if test -z "$GZIP" -o ! -x "$GZIP"; then + GZIP=`pathsearch "${GZIP:-gzip}"` + GZIP="$GZIP" +fi + +if test -z "$GZIP"; then + echo "not found" + GZIP=cat + GZIP_SUFFIX="" +else + echo "success [$GZIP]" + GZIP="$GZIP -c" + GZIP_SUFFIX=".gz" +fi + +printf "Finding suitable compiler........" CC=`pathsearch "${CC:-cc}"` if test -z "$CC" -o ! -x "$CC"; then CC=`pathsearch "${CC:-gcc}"` @@ -396,6 +420,7 @@ done printf "Generating build files..........." +generate doc/Makefile.in doc/Makefile generate build/ck.build.in build/ck.build generate build/regressions.build.in build/regressions.build generate build/ck.pc.in build/ck.pc diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index e2fc70f..0000000 --- a/doc/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -.PHONY: all clean - -GZIP=gzip -OBJECTS=ck_ht_allocator_set.3.gz \ - ck_ht_count.3.gz \ - ck_ht_destroy.3.gz \ - ck_ht_get_spmc.3.gz \ - ck_ht_grow_spmc.3.gz \ - ck_ht_hash.3.gz \ - ck_ht_hash_direct.3.gz \ - ck_ht_init.3.gz \ - ck_ht_put_spmc.3.gz \ - ck_ht_remove_spmc.3.gz \ - ck_ht_reset_spmc.3.gz \ - ck_ht_set_spmc.3.gz \ - ck_ht_entry_empty.3.gz - -all: $(OBJECTS) - -ck_ht_allocator_set.3.gz: ck_ht_allocator_set.3 - $(GZIP) -c ck_ht_allocator_set.3 > ck_ht_allocator_set.3.gz - -ck_ht_count.3.gz: ck_ht_count.3 - $(GZIP) -c ck_ht_count.3 > ck_ht_count.3.gz - -ck_ht_destroy.3.gz: ck_ht_destroy.3 - $(GZIP) -c ck_ht_destroy.3 > ck_ht_destroy.3.gz - -ck_ht_get_spmc.3.gz: ck_ht_get_spmc.3 - $(GZIP) -c ck_ht_get_spmc.3 > ck_ht_get_spmc.3.gz - -ck_ht_grow_spmc.3.gz: ck_ht_grow_spmc.3 - $(GZIP) -c ck_ht_grow_spmc.3 > ck_ht_grow_spmc.3.gz - -ck_ht_hash.3.gz: ck_ht_hash.3 - $(GZIP) -c ck_ht_hash.3 > ck_ht_hash.3.gz - -ck_ht_hash_direct.3.gz: ck_ht_hash_direct.3 - $(GZIP) -c ck_ht_hash_direct.3 > ck_ht_hash_direct.3.gz - -ck_ht_init.3.gz: ck_ht_init.3 - $(GZIP) -c ck_ht_init.3 > ck_ht_init.3.gz - -ck_ht_put_spmc.3.gz: ck_ht_put_spmc.3 - $(GZIP) -c ck_ht_put_spmc.3 > ck_ht_put_spmc.3.gz - -ck_ht_remove_spmc.3.gz: ck_ht_remove_spmc.3 - $(GZIP) -c ck_ht_remove_spmc.3 > ck_ht_remove_spmc.3.gz - -ck_ht_reset_spmc.3.gz: ck_ht_reset_spmc.3 - $(GZIP) -c ck_ht_reset_spmc.3 > ck_ht_reset_spmc.3.gz - -ck_ht_set_spmc.3.gz: ck_ht_set_spmc.3 - $(GZIP) -c ck_ht_set_spmc.3 > ck_ht_set_spmc.3.gz - -ck_ht_entry_empty.3.gz: ck_ht_entry_empty.3 - $(GZIP) -c ck_ht_entry_empty.3 > ck_ht_entry_empty.3.gz - -clean: - rm -f *~ *.o *.3.gz - diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..5f4fb4f --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,62 @@ +.PHONY: all clean + +GZIP=@GZIP@ +GZIP_SUFFIX=.3@GZIP_SUFFIX@ +OBJECTS=ck_ht_allocator_set$(GZIP_SUFFIX) \ + ck_ht_count$(GZIP_SUFFIX) \ + ck_ht_destroy$(GZIP_SUFFIX) \ + ck_ht_get_spmc$(GZIP_SUFFIX) \ + ck_ht_grow_spmc$(GZIP_SUFFIX) \ + ck_ht_hash$(GZIP_SUFFIX) \ + ck_ht_hash_direct$(GZIP_SUFFIX) \ + ck_ht_init$(GZIP_SUFFIX) \ + ck_ht_put_spmc$(GZIP_SUFFIX) \ + ck_ht_remove_spmc$(GZIP_SUFFIX) \ + ck_ht_reset_spmc$(GZIP_SUFFIX) \ + ck_ht_set_spmc$(GZIP_SUFFIX) \ + ck_ht_entry_empty$(GZIP_SUFFIX) + +all: $(OBJECTS) + +ck_ht_allocator_set$(GZIP_SUFFIX): ck_ht_allocator_set + $(GZIP) ck_ht_allocator_set > ck_ht_allocator_set$(GZIP_SUFFIX) + +ck_ht_count$(GZIP_SUFFIX): ck_ht_count + $(GZIP) ck_ht_count > ck_ht_count$(GZIP_SUFFIX) + +ck_ht_destroy$(GZIP_SUFFIX): ck_ht_destroy + $(GZIP) ck_ht_destroy > ck_ht_destroy$(GZIP_SUFFIX) + +ck_ht_get_spmc$(GZIP_SUFFIX): ck_ht_get_spmc + $(GZIP) ck_ht_get_spmc > ck_ht_get_spmc$(GZIP_SUFFIX) + +ck_ht_grow_spmc$(GZIP_SUFFIX): ck_ht_grow_spmc + $(GZIP) ck_ht_grow_spmc > ck_ht_grow_spmc$(GZIP_SUFFIX) + +ck_ht_hash$(GZIP_SUFFIX): ck_ht_hash + $(GZIP) ck_ht_hash > ck_ht_hash$(GZIP_SUFFIX) + +ck_ht_hash_direct$(GZIP_SUFFIX): ck_ht_hash_direct + $(GZIP) ck_ht_hash_direct > ck_ht_hash_direct$(GZIP_SUFFIX) + +ck_ht_init$(GZIP_SUFFIX): ck_ht_init + $(GZIP) ck_ht_init > ck_ht_init$(GZIP_SUFFIX) + +ck_ht_put_spmc$(GZIP_SUFFIX): ck_ht_put_spmc + $(GZIP) ck_ht_put_spmc > ck_ht_put_spmc$(GZIP_SUFFIX) + +ck_ht_remove_spmc$(GZIP_SUFFIX): ck_ht_remove_spmc + $(GZIP) ck_ht_remove_spmc > ck_ht_remove_spmc$(GZIP_SUFFIX) + +ck_ht_reset_spmc$(GZIP_SUFFIX): ck_ht_reset_spmc + $(GZIP) ck_ht_reset_spmc > ck_ht_reset_spmc$(GZIP_SUFFIX) + +ck_ht_set_spmc$(GZIP_SUFFIX): ck_ht_set_spmc + $(GZIP) ck_ht_set_spmc > ck_ht_set_spmc$(GZIP_SUFFIX) + +ck_ht_entry_empty$(GZIP_SUFFIX): ck_ht_entry_empty + $(GZIP) ck_ht_entry_empty > ck_ht_entry_empty$(GZIP_SUFFIX) + +clean: + rm -f *~ *.o *.3.gz + diff --git a/doc/ck_ht_allocator_set.3 b/doc/ck_ht_allocator_set similarity index 100% rename from doc/ck_ht_allocator_set.3 rename to doc/ck_ht_allocator_set diff --git a/doc/ck_ht_count.3 b/doc/ck_ht_count similarity index 100% rename from doc/ck_ht_count.3 rename to doc/ck_ht_count diff --git a/doc/ck_ht_destroy.3 b/doc/ck_ht_destroy similarity index 100% rename from doc/ck_ht_destroy.3 rename to doc/ck_ht_destroy diff --git a/doc/ck_ht_entry_empty.3 b/doc/ck_ht_entry_empty similarity index 100% rename from doc/ck_ht_entry_empty.3 rename to doc/ck_ht_entry_empty diff --git a/doc/ck_ht_get_spmc.3 b/doc/ck_ht_get_spmc similarity index 100% rename from doc/ck_ht_get_spmc.3 rename to doc/ck_ht_get_spmc diff --git a/doc/ck_ht_grow_spmc.3 b/doc/ck_ht_grow_spmc similarity index 100% rename from doc/ck_ht_grow_spmc.3 rename to doc/ck_ht_grow_spmc diff --git a/doc/ck_ht_hash.3 b/doc/ck_ht_hash similarity index 100% rename from doc/ck_ht_hash.3 rename to doc/ck_ht_hash diff --git a/doc/ck_ht_hash_direct.3 b/doc/ck_ht_hash_direct similarity index 100% rename from doc/ck_ht_hash_direct.3 rename to doc/ck_ht_hash_direct diff --git a/doc/ck_ht_init.3 b/doc/ck_ht_init similarity index 100% rename from doc/ck_ht_init.3 rename to doc/ck_ht_init diff --git a/doc/ck_ht_put_spmc.3 b/doc/ck_ht_put_spmc similarity index 100% rename from doc/ck_ht_put_spmc.3 rename to doc/ck_ht_put_spmc diff --git a/doc/ck_ht_remove_spmc.3 b/doc/ck_ht_remove_spmc similarity index 100% rename from doc/ck_ht_remove_spmc.3 rename to doc/ck_ht_remove_spmc diff --git a/doc/ck_ht_reset_spmc.3 b/doc/ck_ht_reset_spmc similarity index 100% rename from doc/ck_ht_reset_spmc.3 rename to doc/ck_ht_reset_spmc diff --git a/doc/ck_ht_set_spmc.3 b/doc/ck_ht_set_spmc similarity index 100% rename from doc/ck_ht_set_spmc.3 rename to doc/ck_ht_set_spmc