From: Stephen D. <sd...@gm...> - 2005-10-22 13:27:40
|
On 10/21/05, Zoran Vasiljevic <zv...@ar...> wrote: > Hi! > > I do not know how to resolve those... > > Normally, I have a Tcl module (built with TEA) and would like > to link it together with NS. It complains about PACKAGE and > VERSION already being defined in nsconfig.h... Bad thing is > that I use those things in my C-code so whenever I load > nsconfig.h, it re-defines them :-( > > Using TEA, you get all those things defined on the command line: > > gcc -pipe -DTCL_THREADS=3D1 -DUSE_THREAD_ALLOC=3D1 -D_REENTRANT=3D1 - > D_THREAD_SAFE=3D1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=3D1 - > DHAVE_PTHREAD_ATFORK=3D1 -DHAVE_READDIR_R=3D1 - > DHAVE_THREE_ARG_READDIR_R=3D1 -DHAVE_LIBKERN_OSATOMIC_H=3D1 - > DHAVE_OSSPINLOCKLOCK=3D1 -DMAC_OSX_TCL=3D1 -DUSE_VFORK=3D1 - > DTCL_DEFAULT_ENCODING=3D\"utf-8\" -DTCL_LOAD_FROM_MEMORY=3D1 - > DTCL_WIDE_INT_TYPE=3Dlong\ long -DWORDS_BIGENDIAN=3D1 -DHAVE_GETCWD=3D1 - > DHAVE_OPENDIR=3D1 -DHAVE_STRSTR=3D1 -DHAVE_STRTOL=3D1 -DHAVE_STRTOLL=3D1 = - > DHAVE_STRTOULL=3D1 -DHAVE_TMPNAM=3D1 -DHAVE_WAITPID=3D1 -DNO_VALUES_H=3D1= - > DHAVE_LIMITS_H=3D1 -DHAVE_UNISTD_H=3D1 -DHAVE_SYS_PARAM_H=3D1 - > DUSE_TERMIOS=3D1 -DHAVE_SYS_TIME_H=3D1 -DTIME_WITH_SYS_TIME=3D1 - > DHAVE_TM_ZONE=3D1 -DHAVE_GMTIME_R=3D1 -DHAVE_LOCALTIME_R=3D1 - > DHAVE_TM_GMTOFF=3D1 -DHAVE_ST_BLKSIZE=3D1 -DSTDC_HEADERS=3D1 - > DHAVE_SIGNED_CHAR=3D1 -DHAVE_PUTENV_THAT_COPIES=3D1 -DHAVE_LANGINFO=3D1 - > DHAVE_SYS_IOCTL_H=3D1 -DHAVE_SYS_FILIO_H=3D1 -DTCL_WIDE_INT_TYPE=3Dlong\ > long -DNO_VALUES_H=3D1 -DHAVE_UNISTD_H=3D1 -DHAVE_SYS_PARAM_H=3D1 -DVERSI= ON=3D > \"0.2\" -DPACKAGE=3D\"archdev\" -DUSE_THREAD_ALLOC=3D1 -D_REENTRANT=3D1 - > D_THREAD_SAFE=3D1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=3D1 -DHAVE_READDIR_R= =3D1 > -DTCL_THREADS=3D1 -DUSE_TCL_STUBS=3D1 -DNS_AOLSERVER=3D1 -arch ppc -pip= e - > I"/usr/local/include" -DNO_CONST -I../generic -I/Users/zoran/dev/ > libmacbinary/generic -I/Users/zoran/dev/libarchdev/generic -I/Users/ > zoran/dev/findutils-4.1/find -g -fno-common -g -fno-common -I/usr/ > local/aolserver/include -c `echo tclp_bg.c` -o tclp_bg.o > > -DVERSION=3D\"0.2\" > -DPACKAGE=3D\"archdev\" > > Now, as I understand, those symbols are defined by autoconf > automatically. > > Does anybody have any idea how to get out of this blues? > At the moment, I have to edit the nsconfig.h and remove > lines definig PACKAGE and VERSION but I assume this is > not the most elegant and fail-safe way... > > Another blues: the new TEA (3.3) uses PACKAGE_NAME and > PACKAGE_VERSION (obviously because of the above reason) > but NS uses them AS WELL since it also uses TEA! > My god, what a mess... How about this: Rename nsconfig.h -> config.h and don't install it. Include it explicitly where it's needed, not via ns.h. Create nsversion.h to hold version info, install it. This would mean that the results of configuration probing are not available to modules, but I'd like to move towards having modules run their own configure scripts, a bit like TEA. Is anyone depending on this? Generating nsversion.h feels better to me than running ns.h through configu= re. |