Help with elkhound port development

Mark Brethen mark.brethen at gmail.com
Fri Dec 12 11:08:27 PST 2014


I'm attempting to create a port for elkhound (a GLR Parser Generator) but running into build issues. 

:notice:configure --->  Configuring elkhound
:debug:configure Using compiler 'Xcode Clang'
:debug:configure Executing org.macports.configure (elkhound)
:info:configure Testing C++ compiler ...
:info:configure testcout: works
:info:configure C++ compiler seems to work
:info:configure 
:info:configure smbase configuration summary:
:info:configure   command:     ./configure 
:info:configure 
:info:configure Compile flags:
:info:configure   CC:          gcc
:info:configure   CXX:         g++
:info:configure   CCFLAGS:     -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:configure 
:info:configure creating Makefile ...
:info:configure 
:info:configure You can now run make, usually called 'make' or 'gmake'.
:info:configure Testing C++ compiler ...
:info:configure testcout: works
:info:configure C++ compiler seems to work
:info:configure checking how to run perl... perl
:info:configure 
:info:configure ast configuration summary:
:info:configure   command:     ./configure 
:info:configure 
:info:configure Compile flags:
:info:configure   CC:          gcc
:info:configure   CXX:         g++
:info:configure   CCFLAGS:     -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:configure 
:info:configure creating Makefile ...
:info:configure 
:info:configure You can now run make, usually called 'make' or 'gmake'.
:info:configure Testing C++ compiler ...
:info:configure testcout: works
:info:configure C++ compiler seems to work
:info:configure checking whether compiler needs "-I."... yes
:info:configure checking how to run perl... perl
:info:configure 
:info:configure Invoking ./configure in 'c' directory..
:info:configure Testing C++ compiler ...
:info:configure testcout: works
:info:configure C++ compiler seems to work
:info:configure 
:info:configure elkhound/c configuration summary:
:info:configure   command:     ./configure 
:info:configure 
:info:configure Compile flags:
:info:configure   CC:          gcc
:info:configure   CXX:         g++
:info:configure   CCFLAGS:     -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:configure   AST:         ../../ast
:info:configure   ELKHOUND:    ..
:info:configure 
:info:configure creating Makefile ...
:info:configure 
:info:configure You can now run make, usually called 'make' or 'gmake'.
:info:configure elkhound configuration summary:
:info:configure   command:     ./configure 
:info:configure 
:info:configure Compile flags:
:info:configure   CC:          gcc
:info:configure   CXX:         g++
:info:configure   CCFLAGS:     -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG -I.
:info:configure   loc:         1
:info:configure   compression: <none>
:info:configure 
:info:configure creating Makefile ...
:info:configure creating glrconfig.h ...
:info:configure 
:info:configure You can now run make, usually called 'make' or 'gmake'.
:debug:configure Privilege de-escalation not attempted as not running as root.
:debug:build build phase started at Thu Dec 11 22:19:43 CST 2014
:notice:build --->  Building elkhound
:debug:build Executing org.macports.build (elkhound)
:info:build /Applications/Xcode.app/Contents/Developer/usr/bin/make -C smbase
:info:build g++ -c -o autofile.o autofile.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o bflatten.o bflatten.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build bflatten.cc:35:10: warning: cast to 'const void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
:info:build   return (void const*)(data->intName);
:info:build          ^
:info:build bflatten.cc:68:20: warning: cast to 'const void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
:info:build     ownerTable.add((void const*)(map->intName), map);
:info:build                    ^
:info:build bflatten.cc:103:42: warning: cast to 'const void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
:info:build       OwnerMapping *map = ownerTable.get((void const*)name);
:info:build                                          ^
:info:build 3 warnings generated.
:info:build g++ -c -o bit2d.o bit2d.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o bitarray.o bitarray.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o boxprint.o boxprint.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o breaker.o breaker.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o crc.o crc.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build gcc -c -o cycles.o cycles.c -g -Wall -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o datablok.o datablok.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o exc.o exc.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o flatten.o flatten.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build gcc -c -o gprintf.o gprintf.c -g -Wall -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o growbuf.o growbuf.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o hashline.o hashline.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o hashtbl.o hashtbl.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build gcc -c -g -O3 malloc_stub.c
:info:build g++ -c -o missing.o missing.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build gcc -c -o mypopen.o mypopen.c -g -Wall -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -g mysig.cc
:info:build g++ -c -o nonport.o nonport.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o point.o point.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o pprint.o pprint.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o smregexp.o smregexp.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o srcloc.o srcloc.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o str.o str.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o strdict.o strdict.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o strhash.o strhash.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o stringset.o stringset.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o strtokp.o strtokp.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o strutil.o strutil.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o svdict.o svdict.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o syserr.o syserr.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o trace.o trace.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o trdelete.o trdelete.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build gcc -c -o unixutil.o unixutil.c -g -Wall -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o vdtllist.o vdtllist.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o vptrmap.o vptrmap.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o voidlist.o voidlist.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build g++ -c -o warn.o warn.cpp -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG
:info:build rm -f libsmbase.a
:info:build ar -r libsmbase.a autofile.o bflatten.o bit2d.o bitarray.o boxprint.o breaker.o crc.o cycles.o datablok.o exc.o flatten.o gprintf.o growbuf.o hashline.o hashtbl.o malloc_stub.o missing.o mypopen.o mysig.o nonport.o point.o pprint.o smregexp.o srcloc.o str.o strdict.o strhash.o stringset.o strtokp.o strutil.o svdict.o syserr.o trace.o trdelete.o unixutil.o vdtllist.o vptrmap.o voidlist.o warn.o
:info:build ar: creating archive libsmbase.a
:info:build ranlib libsmbase.a
:info:build /Applications/Xcode.app/Contents/Developer/usr/bin/make -C ast
:info:build c++ -c -o reporterr.o reporterr.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG -I../smbase
:info:build c++ -c -o embedded.o embedded.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG -I../smbase
:info:build c++ -o ccsstr -DTEST_CCSSTR -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG -I../smbase ccsstr.cc reporterr.o embedded.o -g -Wall ../smbase/libsmbase.a
:info:build c++ -c -o gramlex.o gramlex.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG -I../smbase
:info:build bison -d -v agrampar.y
:info:build mv -f agrampar.tab.c tmp
:info:build sed -e 's/typedef union {/typedef union YYSTYPE {/' \
:info:build 	    -e 's/__attribute__ ((__unused__))//' \
:info:build 	  < tmp > agrampar.tab.cc
:info:build mv -f agrampar.tab.h tmp
:info:build sed -e 's/typedef union {/typedef union YYSTYPE {/' < tmp > agrampar.tab.h
:info:build rm tmp
:info:build head -n 73 agrampar.tab.h > agrampar.codes.h
:info:build c++ -c -o agrampar.tab.o agrampar.tab.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG -I../smbase
:info:build c++ -c -o ccsstr.o ccsstr.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG -I../smbase
:info:build perl ../smbase/run-flex.pl -oagramlex.yy.cc agramlex.lex
:info:build flex -oagramlex.yy.cc agramlex.lex
:info:build modifying agramlex.yy.cc
:info:build c++ -c -o agramlex.yy.o agramlex.yy.cc -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG -I../smbase
:info:build In file included from agramlex.lex:14:
:info:build ./agrampar.codes.h:44:2: error: unterminated conditional directive
:info:build #ifndef YYTOKENTYPE
:info:build  ^
:info:build ./agrampar.codes.h:33:2: error: unterminated conditional directive
:info:build #ifndef YY_YY_AGRAMPAR_TAB_H_INCLUDED
:info:build  ^
:info:build In file included from agramlex.yy.cc:548:
:info:build In file included from /usr/include/unistd.h:72:
:info:build /usr/include/sys/unistd.h:132:1: error: expected identifier
:info:build struct accessx_descriptor {
:info:build ^
:info:build agramlex.lex:332:1: error: expected '}'
:info:build ^
:info:build ./agrampar.codes.h:48:21: note: to match this '{'
:info:build    enum yytokentype {
:info:build                     ^
:info:build agramlex.lex:331:2: error: expected ';' after enum
:info:build }
:info:build  ^
:info:build  ;
:info:build 5 errors generated.
:info:build make[1]: *** [agramlex.yy.o] Error 1
:info:build make: *** [all] Error 2
:info:build Command failed: /usr/bin/make
:info:build Exit code: 2
:error:build org.macports.build for port elkhound returned: command execution failed
:debug:build Error code: NONE
:debug:build Backtrace: command execution failed
   while executing
"proc-org.macports.build-build-0 org.macports.build"
   ("eval" body line 1)
   invoked from within
"eval $procedure $targetname"
:info:build Warning: targets not executed for elkhound: org.macports.build
:notice:build Please see the log file for port elkhound for details:
   /opt/local/var/macports/logs/_Users_marbre_ports_lang_elkhound/elkhound/main.log


There is a top-level configure file (nonstandard):

#!/bin/sh
# toplevel elsa distribution configure

# for now, just fire off default configurations
# in each of the subdirs; users can then go customize
# as desired

(cd smbase && ./configure "$@") || exit
(cd ast && ./configure "$@") || exit
(cd elkhound && ./configure "$@") || exit

The 3 configure files in the subdirectories execute perl scripts. So, in my Portfile I have:

configure {
   system -W ${worksrcpath} "${configure.cmd}"
}

I ran that and looked at the status files:

In /smbase/config.status:

#!/bin/sh
# config.status

# this file was created by ./configure

if [ "$1" = "-reconfigure" ]; then
 # re-issue the ./configure command
 exec ./configure 
fi

# report on configuration
./config.summary

echo "creating Makefile ..."

# overcome my chmod below
rm -f Makefile

cat >Makefile <<EOF
# Makefile for smbase
# NOTE: generated by ./configure, do not edit

EOF

# variable substitution
sed -e "s|@CCFLAGS@|-g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG|g" \
   -e "s|@CFLAGS@|-g -Wall -D__UNIX__ -O2 -DNDEBUG|g" \
   -e "s|@CC@|gcc|g" \
   -e "s|@CXX@|g++|g" \
   -e "s|@CROSSTARGET@|0|g" \
   -e "s|@EXE@||g" \
   -e "s|@SMBASE@|.|g" \
-e "s|@DEBUG_HEAP@|0|g" \
-e "s|@TRACE_HEAP@|0|g" \
 <Makefile.in >>Makefile

# discourage editing ..
chmod a-w Makefile

The config.status output is similar for the other 2 subdirectories. Below is the smbase makefile:

# Makefile for smbase
# NOTE: generated by ./configure, do not edit

# Makefile.in for libsmbase
# see license.txt for copyright and terms of use

# main target
THIS := libsmbase.a
all: gensrc $(THIS)


# C preprocessor, compiler and linker
CC := gcc

# C++ compiler, etc.
CXX := g++

# flags for the C and C++ compilers (and preprocessor)
CFLAGS  := -g -Wall -D__UNIX__ -O2 -DNDEBUG
CCFLAGS := -g -Wall -Wno-deprecated -D__UNIX__ -O2 -DNDEBUG

# cross-compile info
CROSSTARGET   := 0
EXE           := 

# flags for the linker
LDFLAGS := -g -Wall libsmbase.a


# some other tools
AR     := ar
RANLIB := ranlib


# compile .cc to .o
%.o: %.cc
	$(CXX) -c -o $@ $< $(CCFLAGS)
	@perl ./depend.pl -o $@ $< $(CCFLAGS) > $*.d

%.o: %.cpp
	$(CXX) -c -o $@ $< $(CCFLAGS)
	@perl ./depend.pl -o $@ $< $(CCFLAGS) > $*.d

%.o: %.c
	$(CC) -c -o $@ $< $(CFLAGS)


# remake the generated Makefile if its inputs have changed
Makefile: Makefile.in config.status
	./config.status

# reconfigure if the configure script has changed
config.status: configure.pl sm_config.pm
	./config.status -reconfigure


# -------- experimenting with m4 for related files -------
# I don't delete these during make clean because I don't want
# to force people to have m4 installed
gensrc: sobjlist.h objlist.h

sobjlist.h: xobjlist.h
	rm -f sobjlist.h
	m4 -Dm4_output=sobjlist.h --prefix-builtins xobjlist.h > sobjlist.h
	chmod a-w sobjlist.h

objlist.h: xobjlist.h
	rm -f objlist.h
	m4 -Dm4_output=objlist.h --prefix-builtins xobjlist.h > objlist.h
	chmod a-w objlist.h


# ----------------------- malloc ------------------------
# Doug Lea's malloc:
#   add the -DDEBUG flag to turn on doug lea's additional checks
#   add the -DDEBUG_HEAP flag to turn on my zone-based protection
#   add the -DTRACE_MALLOC_CALLS flag to print on every alloc/dealloc
#   normally -O3 is specified
MALLOC_CCFLAGS := -O3

# By default, compile+link a stub module that does nothing, so that
# we will just use the normal system malloc.  Only if the user wants
# special malloc features will we switch to Doug Lea's.  The reason
# is I've only tested my extra features on Linux, and on some other
# systems (cygwin, OSX) they don't work and I don't have the inclination
# to fix all my hacks.
MALLOC_MODULE := malloc_stub

# debug version (much slower, but *great* for finding memory errors)
ifeq (0,1)
 MALLOC_CCFLAGS := -DDEBUG -DDEBUG_HEAP
 MALLOC_MODULE := malloc
endif

# tracing messages
ifeq (0,1)
 MALLOC_CCFLAGS += -DTRACE_MALLOC_CALLS
 MALLOC_MODULE := malloc
endif

$(MALLOC_MODULE).o: $(MALLOC_MODULE).c
	$(CC) -c -g $(MALLOC_CCFLAGS) $(MALLOC_MODULE).c


# --------------------- main target ---------------------

# mysig needs some flags to *not* be set ....
mysig.o: mysig.cc mysig.h
	$(CXX) -c -g mysig.cc

# library itself
OBJS := \
 autofile.o \
 bflatten.o \
 bit2d.o \
 bitarray.o \
 boxprint.o \
 breaker.o \
 crc.o \
 cycles.o \
 datablok.o \
 exc.o \
 flatten.o \
 gprintf.o \
 growbuf.o \
 hashline.o \
 hashtbl.o \
 $(MALLOC_MODULE).o \
 missing.o \
 mypopen.o \
 mysig.o \
 nonport.o \
 point.o \
 pprint.o \
 smregexp.o \
 srcloc.o \
 str.o \
 strdict.o \
 strhash.o \
 stringset.o \
 strtokp.o \
 strutil.o \
 svdict.o \
 syserr.o \
 trace.o \
 trdelete.o \
 unixutil.o \
 vdtllist.o \
 vptrmap.o \
 voidlist.o \
 warn.o
-include $(OBJS:.o=.d)

# some modules do not build on mingw32; for the moment I do not need them
ifeq ($(strip $(CROSSTARGET)),i386-mingw32msvc)
 OBJS := $(filter-out mypopen.o mysig.o smregexp.o,$(OBJS))
endif

$(THIS): $(OBJS)
	rm -f $(THIS)
	$(AR) -r $(THIS) $(OBJS)
	-$(RANLIB) $(THIS)


# ---------- module tests ----------------
# test program targets
TESTS := nonport voidlist tobjlist bit2d growbuf testmalloc mypopen \
        strdict svdict str strutil trdelete bflatten mysig \
        testmalloc mypopen tobjpool strhash cycles tsobjlist crc \
        srcloc hashline gprintf smregexp vptrmap vdtllist pprint \
        boxprint tarrayqueue testarray taillist_test autofile \
        bitarray

# some programs do not build on mingw32
ifeq ($(strip $(CROSSTARGET)),i386-mingw32msvc)
 TESTS := $(filter-out testmalloc mypopen mysig smregexp,$(TESTS))
endif

TESTS := $(addsuffix $(EXE),$(TESTS))

tests: $(TESTS)


# command to compile and link
TESTCC  := $(CC) -g -Wall
TESTCXX := $(CXX) -g -Wall

# this goes at the end of most commands that build a test binary
TESTFLAGS := $(CCFLAGS) $(LDFLAGS)

# this one is explicitly *not* linked against $(THIS)
nonport$(EXE): nonport.cpp nonport.h gprintf.o
	$(TESTCXX) -o $@ -DTEST_NONPORT nonport.cpp gprintf.o $(CCFLAGS)

voidlist$(EXE): voidlist.cc voidlist.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_VOIDLIST voidlist.cc $(TESTFLAGS)

vdtllist$(EXE): vdtllist.cc vdtllist.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_VDTLLIST vdtllist.cc $(TESTFLAGS)

taillist_test$(EXE): taillist_test.cc taillist.h $(THIS)
	$(TESTCXX) -o $@ taillist_test.cc $(TESTFLAGS)

tobjlist$(EXE): tobjlist.cc objlist.h voidlist.o $(THIS)
	$(TESTCXX) -o $@ tobjlist.cc voidlist.o $(TESTFLAGS)

tsobjlist$(EXE): tsobjlist.cc sobjlist.h voidlist.o $(THIS)
	$(TESTCXX) -o $@ tsobjlist.cc voidlist.o $(TESTFLAGS)

bit2d$(EXE): bit2d.cc bit2d.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_BIT2D bit2d.cc $(TESTFLAGS)

growbuf$(EXE): growbuf.cc growbuf.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_GROWBUF growbuf.cc $(TESTFLAGS)

strdict$(EXE): strdict.cc strdict.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_STRDICT strdict.cc $(TESTFLAGS)

svdict$(EXE): svdict.cc svdict.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_SVDICT svdict.cc $(TESTFLAGS)

str$(EXE): str.cpp str.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_STR str.cpp $(TESTFLAGS)

strutil$(EXE): strutil.cc strutil.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_STRUTIL strutil.cc $(TESTFLAGS)

strhash$(EXE): strhash.cc strhash.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_STRHASH strhash.cc $(TESTFLAGS)

trdelete$(EXE): trdelete.cc trdelete.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_TRDELETE trdelete.cc $(TESTFLAGS)

bflatten$(EXE): bflatten.cc bflatten.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_BFLATTEN bflatten.cc $(TESTFLAGS)

mysig$(EXE): mysig.cc mysig.h $(THIS)
	$(TESTCXX) -o $@ -DTEST_MYSIG mysig.cc $(TESTFLAGS)

testmalloc$(EXE): testmalloc.cc $(THIS)
	echo TESTS is $(TESTS)
	$(TESTCXX) -o $@ testmalloc.cc $(TESTFLAGS)

mypopen$(EXE): mypopen.c mypopen.h
	$(TESTCC) -o $@ -DTEST_MYPOPEN mypopen.c

# this test is only useful when malloc is compiled with DEBUG_HEAP
tmalloc$(EXE): tmalloc.c libsmbase.a
	$(TESTCC) -o $@ tmalloc.c $(TESTFLAGS)

tobjpool$(EXE): tobjpool.cc objpool.h
	$(TESTCXX) -o $@ tobjpool.cc $(TESTFLAGS)

cycles$(EXE): cycles.h cycles.c
	$(TESTCC) -o $@ -DTEST_CYCLES cycles.c

crc$(EXE): crc.cpp
	$(TESTCXX) -o $@ $(CCFLAGS) -DTEST_CRC crc.cpp

srcloc$(EXE): srcloc.cc $(THIS)
	$(TESTCXX) -o $@ -DTEST_SRCLOC srcloc.cc $(TESTFLAGS)

hashline$(EXE): hashline.cc $(THIS)
	$(TESTCXX) -o $@ -DTEST_HASHLINE hashline.cc $(TESTFLAGS)

gprintf$(EXE): gprintf.c gprintf.h
	$(TESTCC) -o $@ -DTEST_GPRINTF gprintf.c $(CFLAGS)

smregexp$(EXE): smregexp.cc $(THIS)
	$(TESTCXX) -o $@ -DTEST_SMREGEXP smregexp.cc $(TESTFLAGS)

vptrmap$(EXE): vptrmap.cc $(THIS)
	$(TESTCXX) -o $@ -DTEST_VPTRMAP vptrmap.cc $(TESTFLAGS)

pprint$(EXE): pprint.cc $(THIS)
	$(TESTCXX) -o $@ -DTEST_PPRINT pprint.cc $(TESTFLAGS)

boxprint$(EXE): boxprint.cc $(THIS)
	$(TESTCXX) -o $@ -DTEST_BOXPRINT boxprint.cc $(TESTFLAGS)

tarrayqueue$(EXE): tarrayqueue.cc $(THIS)
	$(TESTCXX) -o $@ tarrayqueue.cc $(TESTFLAGS)

testarray$(EXE): testarray.cc $(THIS)
	$(TESTCXX) -o $@ testarray.cc $(TESTFLAGS)

autofile$(EXE): autofile.cc $(THIS)
	$(TESTCXX) -o $@ -DTEST_AUTOFILE autofile.cc $(TESTFLAGS)

bitarray$(EXE): bitarray.cc $(THIS)
	$(TESTCXX) -o $@ -DTEST_BITARRAY bitarray.cc $(TESTFLAGS)

ifeq ($(CROSSTARGET),0)
 RUN :=
else
 # there is a necessary space at the end of the next line ...
 RUN := true
endif

check: $(TESTS)
	$(RUN)./nonport$(EXE)
	$(RUN)./voidlist$(EXE)
	$(RUN)./vdtllist$(EXE)
	$(RUN)./tobjlist$(EXE)
	$(RUN)./bit2d$(EXE)
	$(RUN)./growbuf$(EXE)
	$(RUN)./strdict$(EXE)
	$(RUN)./svdict$(EXE)
	$(RUN)./str$(EXE)
	$(RUN)./strutil$(EXE)
	$(RUN)./strhash$(EXE)
	$(RUN)./trdelete$(EXE)
	$(RUN)./bflatten$(EXE)
	$(RUN)./mysig$(EXE)
	$(RUN)./testmalloc$(EXE) >/dev/null 2>&1
	$(RUN)./mypopen$(EXE)
	$(RUN)./tobjpool$(EXE)
	$(RUN)./cycles$(EXE)
	$(RUN)./tsobjlist$(EXE)
	$(RUN)./hashline$(EXE)
	$(RUN)./srcloc$(EXE)
	$(RUN)./gprintf$(EXE)
	$(RUN)./smregexp$(EXE)
	$(RUN)./vptrmap$(EXE)
	$(RUN)./pprint$(EXE)
	$(RUN)./boxprint$(EXE)
	$(RUN)./tarrayqueue$(EXE)
	$(RUN)./testarray$(EXE)
	$(RUN)./taillist_test$(EXE)
	$(RUN)./autofile$(EXE) autofile.cc
	$(RUN)./bitarray$(EXE)
ifeq ($(CROSSTARGET),0)
	@echo
	@echo "make check: all the tests PASSED"
else
	@echo
	@echo "make check: all the test programs were built, but I did not"
	@echo "try to run any of them because of cross-compile mode; you"
	@echo "may want to try running the above commands yourself on the target"
	@echo "(remove the 'true' prefixes)"
endif



I need to set the CC, CXX and CPP environment variables and probably use a gccXX compiler instead of clang? Will 'build.args-append' even work in this case?


Mark






More information about the macports-dev mailing list