hash/Makefile.am, hash/crc32.h: Make the CRC table be `const'.
[mLib] / hash / Makefile.am
index 26099d6..877cd3a 100644 (file)
@@ -28,6 +28,7 @@ include $(top_srcdir)/vars.am
 
 noinst_LTLIBRARIES      = libhash.la
 libhash_la_SOURCES      =
+nodist_libhash_la_SOURCES =
 libhash_la_LIBADD       =
 
 ###--------------------------------------------------------------------------
@@ -43,15 +44,24 @@ crc_mktab_SOURCES    = crc-mktab.c
 crc_mktab_LDADD                 = $(UTIL_LIBS)
 PROGMANS               += crc-mktab.1
 
-libhash_la_SOURCES     += crc32-tab.c
-CLEANFILES             += crc32-tab.c
-crc32-tab.c:
-       @$(build_util_libs)
+nodist_libhash_la_SOURCES += ../precomp/crc32-tab.c
+PRECOMPS               += $(precomp)/crc32-tab.c
+if !CROSS_COMPILING
+$(precomp)/crc32-tab.c:
+       @$(mkdir_p) $(precomp)
        @$(MAKE) crc-mktab$(EXEEXT)
-       ./crc-mktab -o $@.new \
-               -p0x04c11db7 -b32 -B8 -r -c \
+       $(AM_V_GEN)./crc-mktab -o $@.new \
+               -p0x04c11db7 -b32 -B8 -r -cC \
                -scrc32_table -icrc32.h -tuint32 && \
        mv $@.new $@
+endif
+
+check_PROGRAMS         += t/crc32.t
+t_crc32_t_SOURCES       = t/crc32-test.c
+t_crc32_t_CPPFLAGS      = $(TEST_CPPFLAGS)
+t_crc32_t_LDFLAGS       = -static
+
+EXTRA_DIST             += t/crc32.tests
 
 ## Universal hashing.
 pkginclude_HEADERS     += unihash.h
@@ -65,26 +75,21 @@ unihash_mkstatic_SOURCES = unihash-mkstatic.c
 unihash_mkstatic_LDADD  = libunihash.la $(UTIL_LIBS)
 PROGMANS               += unihash-mkstatic.1
 
-libhash_la_SOURCES     += unihash-global.c
-CLEANFILES             += unihash-global.c
-unihash-global.c:
-       @$(build_util_libs)
+nodist_libhash_la_SOURCES += ../precomp/unihash-global.c
+PRECOMPS               += $(precomp)/unihash-global.c
+if !CROSS_COMPILING
+$(precomp)/unihash-global.c:
+       @$(mkdir_p) $(precomp)
        @$(MAKE) unihash-mkstatic$(EXEEXT)
-       ./unihash-mkstatic -c -sunihash_global -iunihash.h -o$@.new && \
-               mv $@.new $@
-
-check_PROGRAMS         += unihash.t
-unihash_t_SOURCES       = unihash.c
-unihash_t_CPPFLAGS      = $(TEST_CPPFLAGS)
-unihash_t_LDFLAGS       = -static
-
-tests:: unihash.t unihash.in
-       ./unihash.t -f unihash.in
+       $(AM_V_GEN)./unihash-mkstatic -c -sunihash_global -iunihash.h \
+               -o$@.new && mv $@.new $@
+endif
 
-EXTRA_DIST             += unihash-check.pl
-CLEANFILES             += unihash.in
-unihash.in: unihash-check.pl
-       perl $(srcdir)/unihash-check.pl >$@.new && mv $@.new $@
+check_PROGRAMS         += t/unihash.t
+t_unihash_t_SOURCES     = t/unihash-test.c
+t_unihash_t_CPPFLAGS    = $(TEST_CPPFLAGS)
+t_unihash_t_LDFLAGS     = -static
 
+EXTRA_DIST             += t/unihash-testgen.py
 
 ###----- That's all, folks --------------------------------------------------