Forum OpenACS Q&A: Re: Problem compiling Aolserver 4.5 with tcl 8.5.5

Collapse
Posted by Richard Hamilton on
The relevant section in configure.in occurs in a "case" statement and is conditional upon the system being "darwin". I am probably misreading the case statement but this looks a bit strange to me. I can't figure out what the *) is doing there. I will continue working on nsmak.in as you suggest.
#
# TCL_SHLIB_LD from tclConfig.sh is not quite right for aolserver.
#

test "x$prefix" = "xNONE" && prefix="/usr/local/aolserver"
system=`uname`
case "$system" in
    Darwin)
	LDLIB="\$(CC) -dynamiclib -install_name \$(INSTLIB)/\$(DLLBIN)"
	LDSO="\$(CC) -bundle"
	CCRFLAG=
	LDRFLAG=
	CCRPATHS=
	LDRPATHS=
	;;
    *)
	LDLIB="$TCL_SHLIB_LD"
	case "$LDLIB" in
	    *gcc*)
		LDLIB="$LDLIB -nostartfiles"
		;;
	    *shared*)
		LDLIB="$LDLIB -nostartfiles"
		;;
	esac
	CCRPATH="\$(CCRFLAG)\$(INSTLIB)"
	LDRPATH="\$(LDRFLAG)\$(INSTLIB)"
	if test "$TCL_EXEC_PREFIX" != "$prefix"
	then
		CCRPATH="$CCRPATH \$(CCRFLAG)\$(TCL_EXEC_PREFIX)/lib"
		LDRPATH="$LDRPATH \$(LDRFLAG)\$(TCL_EXEC_PREFIX)/lib"
	fi
	if test -d /usr/lib/lwp
	then
		CCRPATH="$CCRPATH \$(CCRFLAG)/usr/lib/lwp"
		LDRPATH="$LDRPATH \$(LDRFLAG)/usr/lib/lwp"
	fi
	LDSO="\$(LDLIB)"
	CCRPATHS="\$(CCRPATH)"
	LDRPATHS="\$(LDRPATH)"
	CCRFLAG=$TCL_CC_SEARCH_FLAGS
	LDRFLAG=$TCL_LD_SEARCH_FLAGS
        if test "$CCRFLAG" = "" ; then
            CCRPATH=
        fi
        if test "$LDRFLAG" = "" ; then
            LDRPATH=
        fi
	;;
esac
Collapse
Posted by Gustaf Neumann on
If the goal is to get configure work correctly, configure.in is the right place to fix, or at least to figure out, why the configurations goes wrong.

But you are misreading the code. The first case branch is for "Darwin", all other systems ("*") use the 2nd branch. That's why i asked you in http://www.openacs.org/forums/message-view?message_id=2376173, what the value of LDLIB on your system is.

Collapse
Posted by Richard Hamilton on
Ah! Thank you Gustaf. So that is what the mysterious *) was all about! 😊

I do want to achieve a successful compilation, but I would like to solve the problem properly so that the fix will be documented here.

To find out the value of LDLIB I will add an echo statement to configure.in and run it (unless there's a better way). I now understand what you meant about 'after configure' because ns.mak is created by the configure script. I had not realised initially.

(By the way, I have just realised that I have been mis-spelling your name - I am very sorry, how rude of me.

Regards and thanks
Richard

Collapse
Posted by Richard Hamilton on
Here is the relevant section from ns.mak following the execution of nsconfig.tcl as follows:

# pwd
/usr/local/src/aolserver45r0/aolserver

# /usr/local/aolserver45r0/bin/tclsh8.4 nsconfig.tcl

...
#
# Install directories.
#

AOLSERVER	= /usr/local/aolserver45r0
TCLSH		= /usr/local/aolserver45r0/bin/tclsh8.4
INSTBIN		= $(AOLSERVER)/bin
INSTLIB		= $(AOLSERVER)/lib
INSTINC		= $(AOLSERVER)/include
INSTTCL         = $(AOLSERVER)/modules/tcl
INSTSRV         = $(AOLSERVER)/servers/server1
INSTSRVMOD      = $(INSTSRV)/modules
INSTSRVPAG      = $(INSTSRV)/pages
SH		= /bin/sh

#
# Compiler and linker options.
#

LIBEXT		= .so
LDLIB		= ${CC} -shared ${CFLAGS} ${LDFLAGS} -nostartfiles
LDSO		= $(LDLIB)
CCRFLAG         = -Wl,-rpath,${LIB_RUNTIME_DIR}
LDRFLAG         = -Wl,-rpath,${LIB_RUNTIME_DIR}
CCRPATH         += $(CCRFLAG)$(INSTLIB)
LDRPATH         += $(LDRFLAG)$(INSTLIB)
CC		= $(PURIFY) gcc

I note the following:

  1. The LDLIB assignment DOES in fact have "-nostartfiles" at the end after all.
  2. that CC is defined after LDLIB and that its value is $(PURIFY) gcc
  3. There is no other reference to PURIFY anywhere else in ns.mak
Could the problem be because PURIFY returns no value? What is it supposed to do? R.
Collapse
Posted by Richard Hamilton on
Aha! Fantastic. Aolserver appears to have compiled this time. The only thing I did differently this time was to install vtmalloc which previously I had decided not to do. I had problems with the Google Perftools malloc a few months ago and had not realised that vtmalloc is a tcl specific memory allocator.

Could this be the reason or has it just been one of those strange things where I must have done something in a different order or something?

Collapse
Posted by Richard Hamilton on
Thank you so very much for your help. Aolserver 4.5.0 is now up and running and serving the default page with tcl 8.4.19, vtmalloc and all the other bells and whistles. Fantastic!

Now all I have to do is figure out the differences in the config.tcl file between 4.0.x and 4.5.x

R.