[unix-pc.general] shared libraries with curses

egray@fthood.UUCP (01/02/88)

Hello netlanders!

A while back, somebody had asked how to get arround the duplicate
symbols errors when using shared libraries and the curses library.

Enclosed is a sample makefile and shell script that will extract the
missing object files from the normal c library and create a local
version of shlib.ifile with the duplicate names edited out.

Have fun...

Emmet P. Gray				US Army, HQ III Corps & Fort Hood
...!ihnp4!uiucuxc!fthood!egray		Attn: AFZF-DE-ENV
					Directorate of Engineering & Housing
					Environmental Management Office
					Fort Hood, TX 76544-5057

----------------------------------------------------------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	Makefile
#	ifile.sh
# This archive created: Fri Jan  1 13:53:36 1988
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'Makefile'" '(1429 characters)'
if test -f 'Makefile'
then
	echo shar: "will not over-write existing file 'Makefile'"
else
sed 's/^X//' << \SHAR_EOF > 'Makefile'
X#				PCOMM
X#
X# DEFAULT   (init.c)    location of the global default directory
X# VERSION   (init.c)    version number of PCOMM
X# LPR       (d_print.c) name of the line printer program
X# NOPROMOTE (misc.c)    do not promote missing video attributes to standout
X
XCFLAGS = -DWATTRON -DKEYPAD
XCC = cc -O
XSHAREDLIB = /lib/crt0s.o
X
XOBJECTS = main.o help.o l_menu.o s_menu.o d_menu.o strdup.o \
X	d_lib.o d_revise.o init.o fcopy.o p_lib.o d_prompt.o \
X	misc.o d_delete.o d_manual.o d_print.o error.o s_modem.o \
X	s_term.o s_gen.o s_xfer.o s_prompt.o
X
XOTHERS = shlib_c.ifile setvbuf.o doprnt.o
X
Xpcomm:	$(OBJECTS) $(OTHERS)
X	$(LD) $(LDFLAGS) $(SHAREDLIB) $(OTHERS) $(OBJECTS) -lcurses -o pcomm
X
Xlint:
X	lint $(CFLAGS) *.c
X
Xshar:
X	shar -a Makefile Readme param.pcm dir.pcm param.h dir.h misc.h \
X	main.c help.c l_menu.c s_menu.c d_menu.c strdup.c \
X	d_lib.c d_revise.c init.c fcopy.c p_lib.c d_prompt.c \
X	misc.c d_delete.c d_manual.c d_print.c error.c s_modem.c \
X	s_term.c s_gen.c s_xfer.c s_prompt.c > pcomm.sh
X
Xd_delete.o:	dir.h
Xd_lib.o:	dir.h
Xd_manual.o:	param.h
Xd_menu.o:	dir.h param.h
Xd_print.o:	dir.h
Xd_prompt.o:	dir.h
Xd_revise.o:	dir.h
Xinit.o:		param.h
Xmain.o:		param.h
Xp_lib.o:	param.h
Xs_menu.o:	param.h
Xs_modem.o:	param.h
Xs_term.o:	param.h
Xs_gen.o:	param.h
Xs_xfer.o:	param.h
X
Xsetvbuf.o:
X	ar x /lib/libc.a setvbuf.o
X
Xdoprnt.o:
X	ar x /lib/libc.a doprnt.o
X
Xshlib_c.ifile:
X	cp /lib/shlib.ifile shlib_c.ifile
X	sh ifile.sh shlib_c.ifile
SHAR_EOF
if test 1429 -ne "`wc -c < 'Makefile'`"
then
	echo shar: "error transmitting 'Makefile'" '(should have been 1429 characters)'
fi
fi
echo shar: "extracting 'ifile.sh'" '(705 characters)'
if test -f 'ifile.sh'
then
	echo shar: "will not over-write existing file 'ifile.sh'"
else
sed 's/^X//' << \SHAR_EOF > 'ifile.sh'
Xex - $1 << EOF
X1,\$s/^PC/xPC/
X1,\$s/^BC/xBC/
X1,\$s/^UP/xUP/
X1,\$s/^ospeed/xospeed/
X1,\$s/^LINES/xLINES/
X1,\$s/^COLS/xCOLS/
X1,\$s/^tgetflag/xtgetflag/
X1,\$s/^tgetent/xtgetent/
X1,\$s/^tgetstr/xtgetstr/
X1,\$s/^tgetnum/xtgetnum/
X1,\$s/^tgoto/xtgoto/
X1,\$s/^tputs/xtputs/
X1,\$s/^wrefresh/xwrefresh/
X1,\$s/^initscr/xinitscr/
X1,\$s/^cbreak/xcbreak/
X1,\$s/^nl/xnl/
X1,\$s/^flushinp/xflushinp/
X1,\$s/^noecho/xnoecho/
X1,\$s/^savetty/xsavetty/
X1,\$s/^resetty/xresetty/
X1,\$s/^echo/xecho/
X1,\$s/^nocbreak/xnocbreak/
X1,\$s/^nonl/xnonl/
X1,\$s/^keypad/xkeypad/
X1,\$s/^endwin/xendwin/
X1,\$s/^printw/xprintw/
X1,\$s/^fixterm/xfixterm/
X1,\$s/^resetterm/xresetterm/
X1,\$s/^setterm/xsetterm/
X1,\$s/^baudrate/xbaudrate/
Xw
Xq
XEOF
SHAR_EOF
if test 705 -ne "`wc -c < 'ifile.sh'`"
then
	echo shar: "error transmitting 'ifile.sh'" '(should have been 705 characters)'
fi
fi
exit 0
#	End of shell archive