From 67a5a8f1c12c6f4f140923757dd58faba26d68fc Mon Sep 17 00:00:00 2001 From: Troy Heber Date: Tue, 22 May 2007 14:38:41 +0000 Subject: [PATCH] updating DISTCLEAN targets and build detection --- ChangeLog | 2 ++ Makefile.am | 2 ++ README | 36 ++++++++++++++++++++---------------- configure.ac | 31 +++++++++++++++++++++++-------- doc/Makefile.am | 5 +---- examples/README | 8 ++++++++ src/Judy1/Makefile.am | 33 +++++++++++++++++++++++++++++---- src/JudyCommon/Makefile.am | 2 ++ src/JudyHS/Makefile.am | 2 ++ src/JudyL/Makefile.am | 33 +++++++++++++++++++++++++++++---- src/JudySL/Makefile.am | 2 ++ src/Makefile.am | 2 ++ src/obj/Makefile.am | 2 ++ test/Makefile.am | 3 +++ tool/Makefile.am | 2 ++ 15 files changed, 129 insertions(+), 36 deletions(-) create mode 100644 examples/README diff --git a/ChangeLog b/ChangeLog index 92793ac..704735e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 1.0.5 Version (May 2007) by (twh) o added proper clean targets to enable multiple builds o added examples directory +o Correctly Detects 32/64-bit build environment +o Allow explicit configure for 32/64-bit environment 1.0.4 Version (May 2007) by (twh) o fixed the Checkit problem "error Judy1PrevEmpty Rcode != 1 = 0" diff --git a/Makefile.am b/Makefile.am index 18449cd..75e6968 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,3 +15,5 @@ SUBDIRS = src tool doc test # These files will be included in our tarballs, even though automake knows # nothing else about them. #EXTRA_DIST = Makefile.multi original_configure .cvsignore + +DISTCLEANFILES = config.log config.status Makefile libtool make.out diff --git a/README b/README index cab1de0..cee3526 100644 --- a/README +++ b/README @@ -69,35 +69,28 @@ For a quick description see the INSTALL file. Judy is now based on the GNU Auto tools. This means that you can do the standard configure, make, make check and make install and everything should work, with -one minor differnece and a little caviot. +one minor difference and a little caveat. -Judy is capiable of being built as a 32-bit or a 64-bit library. Therefor you -need to tell Judy what you want. You MUST run configure with one of the -following flags: +Judy is capable of being built as a 32-bit or a 64-bit library. Configure +will test to detect the native environment and default to that. Therefor if you +explicitly want to to compile for the non-native environment you need to tell +Judy what you want. You can run ./configure with one of the following flags: --enable-32-bit --enable-64-bit -If your compiler generates 32-bit code by default, such as x86, and you run -configure with --enable-32-bit, your done. You can now run make, make check and -make install. - -If your compiler generates 64-bit code by default, such as Linux IA-64, and you -run configure with --enable-64-bit, your done. You can now run make, make check -and make install. - -The caviot comes in on machines that support both at 32-bit and 64-bit runtime +The caveat comes in on machines that support both at 32-bit and 64-bit runtime environments such as RISC platforms and x86-64. In this case your compiler will either use 32-bit or 64-bit as default. If you plan to use the default you can follow the above instructions and be finished. However, if you wish to compile for the non-default target type. YOU ARE -RESPONSIABLE FOR SETTING THE CORRECT FLAGS! Such as CFLAGS to make your compiler +RESPONSIBLE FOR SETTING THE CORRECT FLAGS! Such as CFLAGS to make your compiler switch modes LDFLAGS to make your linker behave, etc. For example: On HP-UX PA-RISC the compiler generates 32-bit code by default. If -I wish to stick with the defautls I can build Judy by: - ./configure --enable-32-bit +I wish to stick with the defaults I can simply build Judy by: + ./configure make make check make install @@ -108,6 +101,17 @@ If I want to build Judy as a 64-bit library on HP-UX PA-RISC I have to do: make check make install +If I want to build Judy native (64-bit) on Linux AMD64 I have to do: + ./configure + make + make check + make install + +If I want to build Judy 32-bit on Linux AMD64 I have to do: + ./configure --enable-32-bit + make + make check + make install 4. LICENSE ---------- diff --git a/configure.ac b/configure.ac index 1b0dd85..ddfed18 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.57) -AC_INIT(Judy, 1.0.0, doug@sourcejudy.com) +AC_INIT(Judy, 1.0.5, dougbaskins@yahoo.com) AM_MAINTAINER_MODE @@ -179,14 +179,17 @@ AC_C_BIGENDIAN(, AC_DEFINE(JU_LITTLE_ENDIAN, 1, dnl Figure out if we are 32-bit or 64-bit (LP64) AC_CHECK_SIZEOF(void *) if test "$ac_cv_sizeof_void_p" = 8; then - AC_MSG_RESULT(Building 64-bit) - if test x"$GCC" = xyes; then - CFLAGS="-DJU_64BIT -m64 $CFLAGS" - else - CFLAGS="-DJU_64BIT $CFLAGS" - fi + AC_MSG_RESULT(Detected 64-bit Build Environment) + CFLAGS="-DJU_64BIT $CFLAGS" else - AC_MSG_RESULT(Building 32-bit) + AC_MSG_RESULT(Detected 32-bit Build Environment) + CFLAGS="-UJU_64BIT $CFLAGS" +fi + +AC_ARG_ENABLE(32-bit, [ --enable-32-bit Generate code for a 32-bit environment], + b32="$enableval", b32="no") +if test x"$b32" != "xno"; then + AC_MSG_RESULT(Configured to Build 32-bit) if test x"$GCC" = xyes; then CFLAGS="-UJU_64BIT -m32 $CFLAGS" else @@ -194,6 +197,18 @@ else fi fi +AC_ARG_ENABLE(64-bit, [ --enable-64-bit Generate code for a 64-bit environment], + b64="$enableval", b64="no") +if test x"$b64" != "xno"; then + AC_MSG_RESULT(Configured to Building 64-bit) + if test x"$GCC" = xyes; then + CFLAGS="-DJU_64BIT -m64 $CFLAGS" + else + CFLAGS="-DJU_64BIT $CFLAGS" + fi +fi + + # dnl Determine whether or not we're compiling for a 64-bit system by looking # dnl at the size of a 'long'. This will define SIZEOF_LONG in config.h. We diff --git a/doc/Makefile.am b/doc/Makefile.am index 8ba7426..8e6706a 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -206,7 +206,4 @@ man/man3/JudyHS_funcs: cd man/man3; ln -s JudyHS_funcs JudyHSDel cd man/man3; ln -s JudyHS_funcs JudyHSFreeArray -distclean: clean - -clean: - rm -f man/man3/* +CLEANFILES = man/man3/* diff --git a/examples/README b/examples/README new file mode 100644 index 0000000..6e440b6 --- /dev/null +++ b/examples/README @@ -0,0 +1,8 @@ +This directory contains example programs that show some of the many ways Judy +can be utilized, in other words it contains useful applications of Judy. + +Judy1Dup: Clone (duplicate) a Judy Array. + +Judy1Op: Support Logical "set" operations on Judy1 arrays. + +See the source code for more information. diff --git a/src/Judy1/Makefile.am b/src/Judy1/Makefile.am index cea3945..0a06053 100644 --- a/src/Judy1/Makefile.am +++ b/src/Judy1/Makefile.am @@ -83,7 +83,32 @@ Judy1PrevEmpty.c:../JudyCommon/JudyPrevNextEmpty.c Judy1TablesGen.c:../JudyCommon/JudyTables.c cp -f ../JudyCommon/JudyTables.c Judy1TablesGen.c -distclean: clean - -clean: - rm -Rf Judy1ByCount.c Judy1Cascade.c Judy1Count.c Judy1CreateBranch.c Judy1Decascade.c Judy1Unset.c Judy1First.c Judy1FreeArray.c Judy1Test.c j__udy1Test.c Judy1SetArray.c Judy1Set.c Judy1InsertBranch.c Judy1MallocIF.c Judy1MemActive.c Judy1MemUsed.c Judy1Next.c Judy1Prev.c Judy1NextEmpty.c Judy1PrevEmpty.c Judy1TablesGen.c .libs Judy1TablesGen *.o *.lo +DISTCLEANFILES = .deps Makefile + +CLEANFILES = Judy1ByCount.c \ + Judy1Cascade.c \ + Judy1Count.c \ + Judy1CreateBranch.c \ + Judy1Decascade.c \ + Judy1Unset.c \ + Judy1First.c \ + Judy1FreeArray.c \ + Judy1Test.c \ + j__udy1Test.c \ + Judy1SetArray.c \ + Judy1Set.c \ + Judy1InsertBranch.c \ + Judy1MallocIF.c \ + Judy1MemActive.c \ + Judy1MemUsed.c \ + Judy1Next.c \ + Judy1Prev.c \ + Judy1NextEmpty.c \ + Judy1PrevEmpty.c \ + Judy1TablesGen.c \ + Judy1Tables.c \ + .libs \ + Judy1TablesGen \ + *.o \ + *.lo \ + *.la diff --git a/src/JudyCommon/Makefile.am b/src/JudyCommon/Makefile.am index bf4705f..fae0e67 100644 --- a/src/JudyCommon/Makefile.am +++ b/src/JudyCommon/Makefile.am @@ -4,3 +4,5 @@ AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@ noinst_LTLIBRARIES = libJudyMalloc.la libJudyMalloc_la_SOURCES = JudyMalloc.c + +DISTCLEANFILES = .deps Makefile diff --git a/src/JudyHS/Makefile.am b/src/JudyHS/Makefile.am index 6cfe295..44a278e 100644 --- a/src/JudyHS/Makefile.am +++ b/src/JudyHS/Makefile.am @@ -4,3 +4,5 @@ AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@ noinst_LTLIBRARIES = libJudyHS.la libJudyHS_la_SOURCES = JudyHS.c + +DISTCLEANFILES = .deps Makefile diff --git a/src/JudyL/Makefile.am b/src/JudyL/Makefile.am index cfc29c1..ef7f61d 100644 --- a/src/JudyL/Makefile.am +++ b/src/JudyL/Makefile.am @@ -83,7 +83,32 @@ JudyLPrevEmpty.c:../JudyCommon/JudyPrevNextEmpty.c JudyLTablesGen.c:../JudyCommon/JudyTables.c cp -f ../JudyCommon/JudyTables.c JudyLTablesGen.c -distclean: clean - -clean: - rm -Rf JudyLByCount.c JudyLCascade.c JudyLCount.c JudyLCreateBranch.c JudyLDecascade.c JudyLDel.c JudyLFirst.c JudyLFreeArray.c JudyLGet.c j__udyLGet.c JudyLInsArray.c JudyLIns.c JudyLInsertBranch.c JudyLMallocIF.c JudyLMemActive.c JudyLMemUsed.c JudyLNext.c JudyLPrev.c JudyLNextEmpty.c JudyLPrevEmpty.c JudyLTablesGen.c JudyLTablesGen .libs *.o *.lo +DISTCLEANFILES = .deps Makefile + +CLEANFILES = JudyLByCount.c \ + JudyLCascade.c \ + JudyLCount.c \ + JudyLCreateBranch.c \ + JudyLDecascade.c \ + JudyLDel.c \ + JudyLFirst.c \ + JudyLFreeArray.c \ + JudyLGet.c \ + j__udyLGet.c \ + JudyLInsArray.c \ + JudyLIns.c \ + JudyLInsertBranch.c \ + JudyLMallocIF.c \ + JudyLMemActive.c \ + JudyLMemUsed.c \ + JudyLNext.c \ + JudyLPrev.c \ + JudyLNextEmpty.c \ + JudyLPrevEmpty.c \ + JudyLTablesGen.c \ + JudyLTables.c \ + JudyLTablesGen \ + .libs \ + *.o \ + *.lo \ + *.la diff --git a/src/JudySL/Makefile.am b/src/JudySL/Makefile.am index ada1169..8d0d0d3 100644 --- a/src/JudySL/Makefile.am +++ b/src/JudySL/Makefile.am @@ -4,3 +4,5 @@ AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@ noinst_LTLIBRARIES = libJudySL.la libJudySL_la_SOURCES = JudySL.c + +DISTCLEANFILES = .deps Makefile diff --git a/src/Makefile.am b/src/Makefile.am index a2e0c0e..9cfb2e9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1 +1,3 @@ SUBDIRS = . JudyCommon JudyL Judy1 JudySL JudyHS obj + +DISTCLEANFILES = .deps Makefile diff --git a/src/obj/Makefile.am b/src/obj/Makefile.am index 2d68ade..7195238 100644 --- a/src/obj/Makefile.am +++ b/src/obj/Makefile.am @@ -11,3 +11,5 @@ libJudy_la_SOURCES = libJudy_la_LIBADD = ../JudyCommon/*.lo ../JudyL/*.lo ../Judy1/*.lo ../JudyHS/*.lo ../JudySL/*.lo libJudy_la_LDFLAGS = @VERSION_INFO@ + +DISTCLEANFILES = .deps Makefile diff --git a/test/Makefile.am b/test/Makefile.am index b61aa45..1b3256d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,3 +3,6 @@ EXTRA_DIST = $(TESTS) TEST_ENVIRONMENT = top_builddir=$(top_builddir) TESTS = Checkit + +DISTCLEANFILES = .deps Makefile +CLEANFILES = Judy1LHCheck Judy1LHTime Makefile SL_Hash SL_Judy SL_Redblack SL_Splay diff --git a/tool/Makefile.am b/tool/Makefile.am index 5efe3a9..33d218a 100644 --- a/tool/Makefile.am +++ b/tool/Makefile.am @@ -4,3 +4,5 @@ AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@ noinst_PROGRAMS = jhton jhton_SOURCES = jhton.c + +DISTCLEANFILES = .deps Makefile