#-------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #-------------------------------------------------------------------- #-------------------------------------------------------------------- # __CHANGE__ # This very first macro is used to verify that the configure script can # find the sources. The argument to AC_INIT should be a unique filename # for this package, and can be a relative path, such as: # #-------------------------------------------------------------------- define(NsfVersion, 2.0.0) AC_INIT([nsf], [NsfVersion]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows". #-------------------------------------------------------------------- TEA_INIT([3.9]) AC_CONFIG_AUX_DIR(config) #-------------------------------------------------------------------- # specify some extra flags #-------------------------------------------------------------------- AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm=GDBM_INCLUDE_DIR,GDBM_LIB_DIR], [build with gdbm support; provide path to gdbm.h and optionally to the shared library (default: off)]), [with_gdbm=$withval], [with_gdbm=no]) AC_ARG_WITH(aolserver3, AC_HELP_STRING([--with-aolserver3=AOL_SERVER_DIR], [build an AOLserver 3 module; point to directory containing aolsever/include (default: off)]), [with_aol3=$withval], [with_aol3=no]) AC_ARG_WITH(actiweb, AC_HELP_STRING([--with-actiweb=yes|no], [build with actiweb components (default: off)]), [with_actiweb=$withval], [with_actiweb=no]) AC_ARG_WITH(expat, AC_HELP_STRING([--with-expat], [ choose expat support; --with-expat=sys assumes a system-wide expat installation --with-expat= point to a custom expat installation, --without-expat falls back to the bundled expat installation]), [with_expat=$withval],[with_expat=bundle]) AC_ARG_WITH(profile, AC_HELP_STRING([--with-profile=yes|no], [--without-profile disables builds with profile support]), [with_profile=$withval], [with_profile=no]) AC_ARG_ENABLE(dtrace, AC_HELP_STRING([--enable-dtrace], [build with dtrace (default: off)]), [enable_dtrace=$enableval], [enable_dtrace=no]) subdirs="" if test "$with_actiweb" = yes; then test_actiweb="test-actiweb" libdirs_actiweb="actiweb rdf registry store xml patterns" apps_actiweb="actiweb persistence" subdirs="$subdirs library/store/XOTclSdbm/" if ! test "$with_gdbm" = no; then subdirs="$subdirs library/store/XOTclGdbm/" fi subdirs="$subdirs library/xml/TclExpat-1.1/" else test_actiweb="" libdirs_actiweb="" apps_actiweb="" if ! test "${with_expat}" = bundle ; then AC_MSG_RESULT([WARNING: expat configuration ${with_expat} ignored]) with_expat="bundle" fi fi AC_SUBST(subdirs) #-------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. The NODOT_VERSION is # required for constructing the library name on systems that don't like # dots in library names (Windows). The VERSION variable is used on the # other systems. #-------------------------------------------------------------------- # do not modify the following lines manually, they are generated with # the script changeXOTclVersion NSF_MAJOR_VERSION=2 NSF_MINOR_VERSION=0 NSF_RELEASE_SERIAL=0 NSF_PATCH_LEVEL=${NSF_MAJOR_VERSION}.${NSF_MINOR_VERSION}.${NSF_RELEASE_SERIAL} NSF_VERSION=${NSF_MAJOR_VERSION}.${NSF_MINOR_VERSION} NODOT_VERSION=${NSF_MAJOR_VERSION}${NSF_MINOR_VERSION} AC_SUBST(NSF_VERSION) AC_SUBST(NSF_MAJOR_VERSION) AC_SUBST(NSF_MINOR_VERSION) AC_SUBST(NSF_PATCH_LEVEL) echo "Configuring next Version $PACKAGE_VERSION" #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG AC_CHECK_FUNCS([strnstr]) #-------------------------------------------------------------------- # check for TK #-------------------------------------------------------------------- #-------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #-------------------------------------------------------------------- # check for extra flags # # FORCE_NO_STUBS is deactivated for now if ! test "$with_aol3" = "no"; then echo "Pre-configuring AOL-Server (xotcl)" AOL_DEFINES="-DAOL_SERVER -DUSE_TCL8X -I$with_aol3/include -I$TCL_SRC_DIR/generic" FORCE_NO_STUBS=1 else AOL_DEFINES="" FORCE_NO_STUBS=0 fi # set the default aol_prefix aol_prefix="/usr/local/aolserver" # if we have under ${prefix} either modules/tcl/init.tcl (aolserver # style) or modules/tcl/init.tcl (naviserver style), then use # ${prefix} as aol_prefix (path for the installation of # aolserver/naviserver specific tcl files). if test -f "${prefix}/modules/tcl/init.tcl" ; then aol_prefix="${prefix}" else if test -f "${prefix}/tcl/init.tcl" ; then aol_prefix="${prefix}" fi fi AC_SUBST(aol_prefix) #-------------------------------------------------------------------- # check for tclCompile.h (needed, when compiled without full source) if test -f "$TCL_SRC_DIR/generic/tclCompile.h"; then HAVE_TCL_COMPILE_H="-DHAVE_TCL_COMPILE_H=1" else HAVE_TCL_COMPILE_H="" fi if test "$with_profile" = yes; then NSF_PROFILE_FLAG="-DNSF_PROFILE=1" else NSF_PROFILE_FLAG="" fi if test "enable_dtrace" = yes; then AC_DEFINE(NSF_DTRACE, 1, [Are we building with DTrace support?]) fi #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- TEA_ADD_SOURCES([nsf.c nsfError.c nsfObjectData.c nsfProfile.c \ nsfTrace.c nsfUtil.c nsfShadow.c nsfCompile.c aolstub.c nsfStubInit.c]) TEA_ADD_HEADERS([generic/nsf.h generic/nsfInt.h generic/nsfDecls.h generic/nsfIntDecls.h]) TEA_ADD_INCLUDES([]) TEA_ADD_LIBS([]) TEA_ADD_CFLAGS([-DNSF_VERSION=\\\"$NSF_VERSION\\\" -DNSF_PATCHLEVEL=\\\"$NSF_PATCH_LEVEL\\\" \ $AOL_DEFINES $HAVE_TCL_COMPILE_H $NSF_PROFILE_FLAG]) TEA_ADD_STUB_SOURCES([nsfStubLib.c]) TEA_ADD_TCL_SOURCES([]) #-------------------------------------------------------------------- #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This must be done AFTER calling TEa_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG # so that we can extract TCL_SRC_DIR from the config file (in the case # of private headers #-------------------------------------------------------------------- #TEA_PUBLIC_TCL_HEADERS TEA_PRIVATE_TCL_HEADERS #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_xotcl in this case) so # that we create the export library with the dll. See sha1.h on how # to use this. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # Define any extra compiler flags in the PACKAGE_CFLAGS variable. # These will be appended to the current set of compiler flags for # your system. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "$GCC" != "yes" ; then AC_DEFINE(VISUAL_CC) fi CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/w else CLEANFILES="*.o *.a *.so *~ core gmon.out" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS # Without the following two eval statements, NSF_SHARED_LIB_SUFFIX # in nsfConfig.sh has $PACKAGE_VERSION unresolved. When another # app links against xotcl, the PACKAGE_VERSIONs are confused. # # Without the first eval, we get # NSF_SHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}${SHLIB_SUFFIX} # NSF_UNSHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}.a # # after the first eval, we get # NSF_SHARED_LIB_SUFFIX=1.2.1${DBGX}.so # NSF_UNSHARED_LIB_SUFFIX=1.2.1${DBGX}.a # after the second eval, all variables are resolved. eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" #eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" #eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols # option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. #-------------------------------------------------------------------- #if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then # FORCE_NO_STUBS=1 #fi if test "${FORCE_NO_STUBS}" = "0" ; then AC_DEFINE(USE_TCL_STUBS) fi #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- TEA_MAKE_LIB #-------------------------------------------------------------------- # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl # file during the install process. Don't run the TCLSH_PROG through # ${CYGPATH} because it's being used directly by make. # Require that we use a tclsh shell version 8.2 or later since earlier # versions have bugs in the pkg_mkIndex routine. #-------------------------------------------------------------------- TEA_PROG_TCLSH # make this available, for such as nsfConfig.sh NSF_COMPATIBLE_TCLSH=${TCLSH_PROG} AC_SUBST(NSF_COMPATIBLE_TCLSH) # resolve the variables eval "libdir=${libdir}" eval "datadir=${datadir}" eval "includedir=${includedir}" PKG_DIR="${PACKAGE_NAME}${PACKAGE_VERSION}" pkgdatadir="${datadir}/${PKG_DIR}" pkglibdir="${libdir}/${PKG_DIR}" # make sure this is right (then remove this comment) pkgincludedir="${includedir}/${PKG_DIR}" AC_SUBST(PKG_DIR) AC_SUBST(pkgdatadir) AC_SUBST(pkglibdir) AC_SUBST(pkgincludedir) # # XOTcl specific configs # if test "${TEA_PLATFORM}" != "windows" ; then NSF_BUILD_LIB_SPEC="-L`pwd` -lnsf${PACKAGE_VERSION}" NSF_LIB_SPEC="-L${pkglibdir} -lnsf${PACKAGE_VERSION}" # stub libs are not build for 8.0 if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then NSF_BUILD_STUB_LIB_PATH="" NSF_STUB_LIB_PATH="" NSF_BUILD_STUB_LIB_SPEC="" NSF_STUB_LIB_SPEC="" else NSF_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" NSF_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" NSF_BUILD_STUB_LIB_SPEC="-L`pwd` -lnsfstub${PACKAGE_VERSION}" NSF_STUB_LIB_SPEC="-L${pkglibdir} -lnsfstub${PACKAGE_VERSION}" AC_DEFINE(COMPILE_NSF_STUBS) fi else NSF_BUILD_LIB_SPEC="`pwd`/${PKG_LIB_FILE}" NSF_LIB_SPEC="${pkglibdir}/${PKG_LIB_FILE}" NSF_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" NSF_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" NSF_BUILD_STUB_LIB_SPEC="`pwd`/${PKG_STUB_LIB_FILE}" NSF_STUB_LIB_SPEC="${pkglibdir}/${PKG_STUB_LIB_FILE}" fi AC_SUBST(SHARED_LIB_SUFFIX) AC_SUBST(UNSHARED_LIB_SUFFIX) AC_SUBST(NSF_BUILD_LIB_SPEC) AC_SUBST(NSF_LIB_SPEC) AC_SUBST(NSF_BUILD_STUB_LIB_SPEC) AC_SUBST(NSF_STUB_LIB_SPEC) AC_SUBST(NSF_BUILD_STUB_LIB_PATH) AC_SUBST(NSF_STUB_LIB_PATH) NSF_SRC_DIR=$srcdir AC_SUBST(NSF_SRC_DIR) AC_SUBST(NXSH) AC_SUBST(XOWISH) # include dir of xotcl during build process (i.e., does not assume installed) NSF_BUILD_INCLUDE_DIR="${NSF_SRC_DIR}/generic" NSF_BUILD_INCLUDE_SPEC="-I${NSF_BUILD_INCLUDE_DIR}" AC_SUBST(NSF_BUILD_INCLUDE_DIR) AC_SUBST(NSF_BUILD_INCLUDE_SPEC) AC_SUBST(test_actiweb) AC_SUBST(libdirs_actiweb) AC_SUBST(apps_actiweb) AC_SUBST(TEA_PLATFORM) dnl macro expanding to the names of files ./configure is to generate. dnl reasoning: this is a factoring; I use this value elsewhere. dnl dnl Change the value of -this- macro if you want to add or remove dnl such files. AC_DEFUN(CONFIG_OUTPUT_FILES, [[Makefile nsfConfig.sh library/xotcl/xotclsh library/xotcl/xowish unix/xotcl.spec unix/pkgIndex.unix nxsh nxwish]]) #-------------------------------------------------------------------- # the value of this variable is set to the files which are to be # removed when the user invokes 'make distclean' (i.e., those # files generated by ./configure) and is used in the make distclean # target, defined in Makefile.in #-------------------------------------------------------------------- CONFIG_CLEAN_FILES="CONFIG_OUTPUT_FILES autom4te.cache/" AC_SUBST(CONFIG_CLEAN_FILES) AC_CONFIG_FILES(CONFIG_OUTPUT_FILES) #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile, # and generate the other output files. (this is done by invoking # config.status) # # NOTE the lack of parameters! AC_OUTPUT with params is deprecated; # use macros such as AC_CONFIG_FILES, AC_HEADER_FILES, etc to add # to the files output by ./configure. #-------------------------------------------------------------------- AC_OUTPUT chmod +x nxsh nxwish library/xotcl/xotclsh library/xotcl/xowish echo "==================== building genstubs (needed for Tcl 8.6)" make genstubs echo "==================== genstubs built" here=${PWD} for subdir in ${subdirs} do echo "==================== configure $subdir" if test x"${srcdir}" = x. ; then confdir=. else mkdir -p $subdir confdir=${srcdir}/$subdir fi (cd $subdir; echo $SHELL ${confdir}/configure ${ac_configure_args} --prefix=${prefix} --with-xotcl=${here}; eval $SHELL ${confdir}/configure ${ac_configure_args} --prefix=${prefix} --with-xotcl=${here}) done