Skip to content

Commit

Permalink
updating DISTCLEAN targets and build detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Troy Heber committed May 22, 2007
1 parent b37b6ce commit 67a5a8f
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 36 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
36 changes: 20 additions & 16 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
----------
Expand Down
31 changes: 23 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -179,21 +179,36 @@ 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
CFLAGS="-UJU_64BIT $CFLAGS"
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
Expand Down
5 changes: 1 addition & 4 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
8 changes: 8 additions & 0 deletions examples/README
Original file line number Diff line number Diff line change
@@ -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.
33 changes: 29 additions & 4 deletions src/Judy1/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/JudyCommon/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@
noinst_LTLIBRARIES = libJudyMalloc.la

libJudyMalloc_la_SOURCES = JudyMalloc.c

DISTCLEANFILES = .deps Makefile
2 changes: 2 additions & 0 deletions src/JudyHS/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@
noinst_LTLIBRARIES = libJudyHS.la

libJudyHS_la_SOURCES = JudyHS.c

DISTCLEANFILES = .deps Makefile
33 changes: 29 additions & 4 deletions src/JudyL/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/JudySL/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@
noinst_LTLIBRARIES = libJudySL.la

libJudySL_la_SOURCES = JudySL.c

DISTCLEANFILES = .deps Makefile
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
SUBDIRS = . JudyCommon JudyL Judy1 JudySL JudyHS obj

DISTCLEANFILES = .deps Makefile
2 changes: 2 additions & 0 deletions src/obj/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions tool/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@
noinst_PROGRAMS = jhton

jhton_SOURCES = jhton.c

DISTCLEANFILES = .deps Makefile

0 comments on commit 67a5a8f

Please sign in to comment.