diff options
author | minskim <minskim@pkgsrc.org> | 2006-05-04 09:35:33 +0000 |
---|---|---|
committer | minskim <minskim@pkgsrc.org> | 2006-05-04 09:35:33 +0000 |
commit | 68d95b8ba613cb5b4b027e2b1f06d2075e720760 (patch) | |
tree | 2b20c8fdfa2b3f742dd06c6dcbad9aa289890322 /devel/sgb/patches | |
parent | 01fa4bcccd394932d789d37492e99b0e0945b3b9 (diff) | |
download | pkgsrc-68d95b8ba613cb5b4b027e2b1f06d2075e720760.tar.gz |
Import sgb.
The Stanford GraphBase is a highly portable collection of programs and
data for researchers who study combinatorial algorithms and data
structures. All files are in the public domain and usable with only
one restriction: They must not be changed! A ``change file'' mechanism
allows local customization while the master files stay intact.
The programs are intended to be interesting in themselves as examples
of ``literate programming.'' Thus, the Stanford GraphBase can also be
regarded as a collection of approximately 30 essays for programmers to
enjoy reading, whether or not they are doing algorithmic research.
The programs are written in CWEB, a combination of TeX and C that is
easy to use by anyone who knows those languages and easy to read by
anyone familiar with the rudiments of C.
Diffstat (limited to 'devel/sgb/patches')
-rw-r--r-- | devel/sgb/patches/patch-aa | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/devel/sgb/patches/patch-aa b/devel/sgb/patches/patch-aa new file mode 100644 index 00000000000..1de47fb3d61 --- /dev/null +++ b/devel/sgb/patches/patch-aa @@ -0,0 +1,122 @@ +$NetBSD: patch-aa,v 1.1.1.1 2006/05/04 09:35:33 minskim Exp $ + +--- Makefile.orig 1999-12-27 14:27:24.000000000 -0800 ++++ Makefile +@@ -8,22 +8,22 @@ + # current directory. (Not recommended for serious users.) + + # Change SGBDIR to the directory where all GraphBase files will go: +-SGBDIR = /usr/local/sgb ++SGBDIR = @PREFIX@/share/sgb + + # Change DATADIR to the directory where GraphBase data files will go: + DATADIR = $(SGBDIR)/data + + # Change INCLUDEDIR to the directory where GraphBase header files will go: +-INCLUDEDIR = $(SGBDIR)/include ++INCLUDEDIR = @PREFIX@/include + + # Change LIBDIR to the directory where GraphBase library routines will go: +-LIBDIR = /usr/local/lib ++LIBDIR = @PREFIX@/lib + + # Change BINDIR to the directory where installdemos will put demo programs: +-BINDIR = /usr/local/bin ++BINDIR = @PREFIX@/bin + + # Change CWEBINPUTS to the directory where CWEB include files will go: +-CWEBINPUTS = /usr/local/lib/cweb ++CWEBINPUTS = @PREFIX@/lib/cweb + + # SHORTCUT: Uncomment these lines, for single-directory installation: + #DATADIR = . +@@ -36,11 +36,11 @@ CWEBINPUTS = /usr/local/lib/cweb + #SYS = -DSYSV + + # If you prefer optimization to debugging, change -g to something like -O: +-CFLAGS = -g -I$(INCLUDEDIR) $(SYS) ++CFLAGS += -I$(INCLUDEDIR) $(SYS) + + ########## You shouldn't have to change anything after this point ########## + +-LDFLAGS = -L. -L$(LIBDIR) ++LDFLAGS += -L. -L$(LIBDIR) + LDLIBS = -lgb + LOADLIBES = $(LDLIBS) + +@@ -67,6 +67,12 @@ LOADLIBES = $(LDLIBS) + make $*.tex + make $*.dvi + ++.c.o: ++ ${LIBTOOL} --mode=compile ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c ++ ++.c: ++ ${LIBTOOL} --mode=link ${CC} -o $* $*.c ${LDLIBS} ++ + DATAFILES = anna.dat david.dat econ.dat games.dat homer.dat huck.dat \ + jean.dat lisa.dat miles.dat roget.dat words.dat + KERNELFILES = gb_flip.w gb_graph.w gb_io.w gb_sort.w +@@ -98,20 +104,20 @@ lib: libgb.a + + libgb.a: $(OBJS) + rm -f certified +- ar rcv libgb.a $(OBJS) +- - ranlib libgb.a ++ ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} \ ++ -rpath ${PREFIX}/lib -version-info 0:0 + + gb_io.o: gb_io.c +- $(CC) $(CFLAGS) -DDATA_DIRECTORY=\"$(DATADIR)/\" -c gb_io.c ++ ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -DDATA_DIRECTORY=\"$(DATADIR)/\" -c gb_io.c + + test_io: gb_io.o +- $(CC) $(CFLAGS) test_io.c gb_io.o -o test_io ++ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) test_io.c gb_io.lo -o test_io + + test_graph: gb_graph.o +- $(CC) $(CFLAGS) test_graph.c gb_graph.o -o test_graph ++ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) test_graph.c gb_graph.lo -o test_graph + + test_flip: gb_flip.o +- $(CC) $(CFLAGS) test_flip.c gb_flip.o -o test_flip ++ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) test_flip.c gb_flip.lo -o test_flip + + tests: test_io test_graph test_flip + ./test_io +@@ -128,24 +134,22 @@ tests: test_io test_graph test_flip + touch certified + + install: lib +- if test ! -r certified; then echo "Please run 'make tests' first!"; fi +- test -r certified + make installdata +- - mkdir $(LIBDIR) +- - cp libgb.a $(LIBDIR) +- - mkdir $(CWEBINPUTS) +- - cp -p boilerplate.w gb_types.w $(CWEBINPUTS) +- - mkdir $(INCLUDEDIR) +- - cp -p $(HEADERS) Makefile $(INCLUDEDIR) ++ - ${BSD_INSTALL_LIB_DIR} $(LIBDIR) ++ - ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} libgb.la $(LIBDIR) ++ - ${BSD_INSTALL_DATA_DIR} $(CWEBINPUTS) ++ - ${BSD_INSTALL_DATA} boilerplate.w gb_types.w $(CWEBINPUTS) ++ - ${BSD_INSTALL_DATA_DIR} $(INCLUDEDIR) ++ - ${BSD_INSTALL_DATA} $(HEADERS) $(INCLUDEDIR) + + installdata: $(DATAFILES) +- - mkdir $(SGBDIR) +- - mkdir $(DATADIR) +- - cp -p $(DATAFILES) $(DATADIR) ++ - ${BSD_INSTALL_DATA_DIR} $(SGBDIR) ++ - ${BSD_INSTALL_DATA_DIR} $(DATADIR) ++ - ${BSD_INSTALL_DATA} $(DATAFILES) $(DATADIR) + + installdemos: lib $(DEMOS) +- - mkdir $(BINDIR) +- - mv $(DEMOS) $(BINDIR) ++ - ${BSD_INSTALL_PROGRAM_DIR} $(BINDIR) ++ - ${BSD_INSTALL_PROGRAM} $(DEMOS) $(BINDIR) + + uninstalldemos: + - cd $(BINDIR); rm -f $(DEMOS) |