Newlisp does not compile on slackware 13.0

Started by Tim Johnson, January 17, 2010, 08:11:05 PM

Previous topic - Next topic

Tim Johnson

Here is the output from configure
bash-3.1$ ./configure

removing old objects and setting correct permissions ...
discovering platform and default memory model ...

detected memory model ILP32
detected Operating System LINUX
creating makefile_configure ...

to make for ILP32 on LINUX type:
    make
to make for any other system do:
    make -f makefile_xxx
where makefile_xxx is one of the preconfigured makefiles

What I infer from the above is that all I need to do is invoke "make"

Now here is the output from make:
bash-3.1$ make
make -f makefile_configure
make[1]: Entering directory `/home/tim/downloads/install/newlisp-10.1.7'
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX newlisp.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-symbol.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-math.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-list.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-liststr.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-string.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-filesys.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-sock.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-import.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-xml.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-web.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-matrix.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-debug.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX nl-utf8.c
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX pcre.c
gcc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o -m32 -g -lm -ldl -lreadline -o newlisp # for UBUNTU Debian
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `PC'
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `tgetflag'
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `tgetent'
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `UP'
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `tputs'
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `tgoto'
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `tgetnum'
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `BC'
/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../libreadline.so: undefined reference to `tgetstr'
collect2: ld returned 1 exit status
make[1]: *** [default] Error 1
make[1]: Leaving directory `/home/tim/downloads/install/newlisp-10.1.7'
make: *** [default] Error 2

 Following is the text of the automatically generated make_configure:

# makefile for newLISP v.10.x.x on LINUX with readline and UTF-8 support
#
# Note, that readline support may require different libraries on different OSs
#

OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o
    nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o

CFLAGS = -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX

CC = gcc

default: $(OBJS)
    $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -o newlisp # for UBUNTU Debian
#   $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -ltermcap -o newlisp # slackware
#   $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -lncurses -o newlisp # other Linux Dist
#   $(CC) $(OBJS) -m32 -g -lm -ldl -o newlisp # without readline support
    strip newlisp

.c.o:
    $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_linux_utf8

Perhaps the line referenced by the comment: "# for UBUNTU Debian" might be the problem,

because this is not not ubuntu debian.
Programmer since 1987. Unix environment.

Tim Johnson

#1
Heh. Heh. Walked away from the computer. Poured myself a glass of my good old homebrew.

Came back, commented out the the line about debian and uncommented the line about

slack.

Flawless install followed.

cheers

tim
Programmer since 1987. Unix environment.

TedWalther

#2
Tim, could you recompile, but this time use ./configure-alt instead of ./configure?  I'm willing to bet it would work out of the box without any editing of the resulting makefile_configure.  I designed it to handle situations like yours.



Ted
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

Tim Johnson

#3
You were right Ted. No changes were necessary. Just curious:

What did you do differently with the shell script on configure-alt?



Also, I could probably figure this out myself, but perhaps we can share with

the community how to target newlisp for installation under /usr/local.

The reason for this is that on many *nix systems, /usr/local is used

for user installed binary and their systems and many tarball installations,

like mutt for instance automatically install to /usr/local/bin, /usr/local/share

etc. Many linux installations (mine included) put /usr/local on a separate

partition. This enables upgrading the OS without wiping the user installed

stuff.



thanks

tim
Programmer since 1987. Unix environment.

TedWalther

#4
I guess I should update configure-alt to support --exec-prefix --prefix and a few other GNUisms.  That would involve a bigger change though; so far the configure-alt script has been running in parallel to the main Makefile; for this I'd have to alter the main Makefile itself.



Lutz, is there any reason configure-alt can't become the default configure now?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

Tim Johnson

#5
consider the following code block in Makefile
NOTE when changing PREFIX, then newlisp should only run
# run in an environment, where NEWLISPDIR is predefined,
# else NEWLISPDIR will be defined during newlisp startup
# as /usr/share/newlisp which is hardcoded in newlisp.c
prefix=/usr
datadir=$(prefix)/share
bindir=$(prefix)/bin
mandir=$(prefix)/share/man

I'm not entirely clear what the comments mean. But will it suffice to

change prefix to /usr/local?

or

make --prefix=/usr/local install
Programmer since 1987. Unix environment.

Lutz

#6
Both, the configure and configure-alt scripts follow a different philosophy. The configure script assigns a pre-made makefile to a specific platform, while configure-alt tries to investigate the specific capabilities of a platform. But the distinction isn't sharp, as both methods do some of what the other does.



For people not very familiar with UNIX scripting, the configure script and prefabricated makefiles are easier to understand and modify/port to unknown platforms.



For the time being I want to keep both, and they are documented in the doc/INSTALL file.

Tim Johnson

#7
I consider it very important that I be able to install and run newlisp from /usr/local. And in my experience,

many sysadmins for remote servers wouldn't have it any other way.

Here is what I did on my system, it is a bit of a hack and I would invite information on a cleaner way to do

it.

at line 522 in newlisp.c, changedresult = setenv("NEWLISPDIR", "/usr/share/newlisp", TRUE);
to result = setenv("NEWLISPDIR", "/usr/local/share/newlisp", TRUE);
And prior to compiling:

NEWLISPDIR=/usr/local/share/newlisp

And I have a complete install in /usr/local/bin, /usr/local/share/newlisp.

But this is a bit of a hack...

thanks

 tim
Programmer since 1987. Unix environment.