dtsr: make it build; configure: fix cpu detection
authorJon Trulson <jon@radscan.com>
Fri, 22 Nov 2019 20:01:36 +0000 (13:01 -0700)
committerJon Trulson <jon@radscan.com>
Fri, 22 Nov 2019 20:01:36 +0000 (13:01 -0700)
cde/configure.ac
cde/programs/dtsr/Makefile.am

index bd5e48010d843c485617338e18ac98be35f04da9..3794fc4dfc54e8445e068b267d340d773bb16357 100644 (file)
@@ -13,6 +13,7 @@ dnl todo: determine what version of autoconf we depend on
 dnl AC_PREREQ()
 
 AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
 
 dnl global CDE versioning
 
@@ -124,23 +125,23 @@ is_mips=no
 is_arm=no
 is_ppc=no
 
-case "$target_or_host" in
-       i*86-*-*)
+case "${host_cpu}" in
+       i[3456]86*)
                is_i386=yes
                ;;
-       x86_64-*)
+       x86_64* | amd64*)
                is_x86_64=yes
                ;;
-       *arm*)
+       arm*)
                is_arm=yes
                ;;
-       *mips*)
+       mips*)
                is_mips=yes
                ;;
-       *sparc*)
+       sparc*)
                is_sparc=yes
                ;;
-       ppc-*-linux* | powerpc-*)
+       ppc* | powerpc*)
                is_ppc=yes
                ;;
 esac
@@ -457,6 +458,8 @@ programs/dtimsstart/Makefile
 
 programs/dtpdm/Makefile
 
+programs/dtsr/Makefile
+
 ])
 
 AC_OUTPUT
index 48d0b60fee49ad42c58b2a2998efb1349b833a7a..d4a424b582314886e1c169594dc67eb27b7cf2f8 100644 (file)
@@ -1,10 +1,24 @@
 MAINTAINERCLEANFILES = Makefile.in
 
 bin_PROGRAMS = dtsrcreate dtsrdbrec dtsrhan dtsrload dtsrindex dtsrdelete \
-              huffcode dtsrkdump
-PROGRAMS_CFLAGS = -I../../lib/DtSearch -I../../lib/DtSearch/raima \
-                 -DMAIN_PROGRAM -lc -lm ${X_LIBS}
-PROGRAMS_LDADD = ../../lib/DtSearch/libDtSearch.so
+              huffcode dtsrkdump dtsrclean
+
+AM_CFLAGS = -I../../lib/DtSearch -I../../lib/DtSearch/raima    \
+       $(DT_INCDIR) -DMAIN_PROGRAM
+
+if I386
+AM_CFLAGS += -DBYTE_SWAP
+endif
+
+if X86_64
+AM_CFLAGS += -DBYTE_SWAP
+endif
+
+if ARM
+AM_CFLAGS += -DBYTE_SWAP
+endif
+
+LDADD = ../../lib/DtSearch/libDtSearch.la
 
 dtsrcreate_SOURCES = dtsrcreate.c
 
@@ -14,9 +28,11 @@ dtsrhan_SOURCES = dtsrhan.c
 
 dtsrload_SOURCES = dtsrload.c
 
+dtsrclean_SOURCES = dtsrclean.c
+
 dtsrindex_SOURCES = dtsrindex.c
 
-dtsrdelete_SOURCES = dtsrdelete.c
+dtsrdelete_SOURCES = tomita.c
 
 huffcode_SOURCES = huffcode.c