dnl Process this file with autoconf to produce a configure script. AC_REVISION($Id$)dnl BOOTFILE=/usr/local/share/ecs/configure-options if test -f ${BOOTFILE} && test -z "${BOOTSTRAP}"; then echo "Reading options from ${BOOTFILE}" BOOTSTRAP="1" $0 `cat ${BOOTFILE}|tr "\n" " "` $* exit $? fi dnl This file ensures our --srcdir is right. Later it's also used to verify dnl the acceptable version of Java compiler and the options specific to the dnl versions. AC_INIT(src/java/org/apache/ecs/GenericElement.java) PACKAGE="ecs" VERSION="1.0.2" AC_SUBST(PACKAGE)dnl AC_SUBST(VERSION)dnl dnl AC_CONFIG_HEADER() dnl Place to install the results to AC_PREFIX_DEFAULT(/usr/local/ecs)dnl dnl AC_PREFIX_PROGRAM() AC_PREREQ(2.13)dnl AC_CONFIG_AUX_DIR(conf)dnl AC_CANONICAL_SYSTEM AC_SUBST(build)dnl AC_SUBST(target)dnl AC_SUBST(host)dnl dnl AC_CANONICAL_HOST AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})dnl dnl Checks for programs. AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PATH_PROG(FIND,find,$PATH)dnl AC_PATH_PROG(SED,sed,$PATH)dnl AC_PATH_PROG(RM,rm,$PATH)dnl AC_PATH_PROG(M4,m4,$PATH)dnl AC_PATH_PROG(MKDIR,mkdir,$PATH)dnl AC_PATH_PROG(FALSE,false,$PATH)dnl AC_PATH_PROG(CHMOD,chmod,$PATH)dnl AC_PATH_PROG(WC,wc,$PATH)dnl AC_PATH_PROG(CUT,cut,$PATH)dnl AC_PATH_PROG(BASENAME,basename,$PATH)dnl AC_PATH_PROG(ECHO,echo,echo,$PATH)dnl AC_PATH_PROG(DIRNAME,dirname,$PATH)dnl AC_PATH_PROG(UNAME,uname,$PATH)dnl AC_PATH_PROG(TEST,test,$PATH)dnl AC_PATH_PROG(SHELL,sh,sh,$PATH)dnl AC_PATH_PROG(SORT,sort,$PATH)dnl AC_PATH_PROG(UNIQ,uniq,$PATH)dnl AC_PATH_PROG(TOUCH,touch,$PATH)dnl AC_PATH_PROG(HEAD,head,$PATH)dnl AC_PATH_PROG(GREP,grep,$PATH)dnl AC_PATH_PROG(CP,cp,$PATH)dnl AC_PATH_PROG(MV,mv,$PATH)dnl dnl AC_PATH_PROG(PERL,perl,perl,$PATH)dnl HOST=`${UNAME} -n` AC_SUBST(HOST) # A trap here. Bash 2.0.2 on Linux sets the environment variable PWD, which # is not exactly what I wanted to be there. So, it used to be PWD, now it's # PWDPROG. AC_PATH_PROG(PWDPROG,pwd,$PATH)dnl dnl A dangerous way to ensure we have 'cd': on Solaris, this is actually a dnl program, and the way make invokes it leaves the new working directory... the dnl same as previous, because it's apparently being run from the subshell. dnl So, it's commented out as a reminder that this is not the right thing to do. dnl AC_PATH_PROG(CD,cd,cd,$PATH)dnl dnl Placeholder for java options, used in JAVACX later. JAVA_OPT="" AC_MSG_CHECKING(if the thread lib is good) OS_NAME=`uname -s` if test ${OS_NAME} = "Linux"; then # Make it a default GREEN="-green" AC_MSG_RESULT([OS is Linux, better use green threads]) else GREEN="" AC_MSG_RESULT([OS is not Linux, don't HAVE to use green threads]) fi AC_ARG_ENABLE(green, [ --enable-green use the green threads (as opposed to native)], [ if test ${OS_NAME} != "Linux"; then AC_MSG_RESULT(--enable-green is not implemented on anything except Linux - ignored) else AC_MSG_RESULT(Using green threads) fi ], [ if test ${OS_NAME} = "Linux"; then if test -z "$GREEN"; then AC_MSG_RESULT([OS is Linux, native threads??? You're asking for trouble, but oh well]) GREEN="" fi else GREEN="" fi ] ) JAVA_OPT="${GREEN} ${JAVA_OPT}" OPENXML_PACKAGE="" AC_ARG_ENABLE(openxml, [ --enable-openxml Enable OpenXML (org.apache.ecs.html2ecs)], [ AC_PATH_JAVACLASS(OPENXML,openxml,org.openxml.XMLDocument,[ Where to find the OpenXML classes]) OPENXML_PACKAGE="org.apache.ecs.html2ecs" ]) AC_SUBST(OPENXML_PACKAGE) dnl Define the TARGET_CLASSPATH. All the components must be found before dnl this point. TARGET_CLASSPATH=`cd ${srcdir} && pwd`/src/java:`cd ${srcdir} && pwd`/example:$OPENXML_CLASSES AC_PROG_JAVATOOL(JAVA,java,[ Java runtime]) AC_PROG_JAVATOOL(JAVAC,javac,[ Java compiler]) AC_PROG_JAVATOOL(JAVADOC,javadoc,[ Java documentation compiler], [You will not be able to create the Javadoc documentation]) AC_PROG_JAVATOOL(JAR,jar,[ Java Archiver]) dnl Checks for libraries. dnl Checks for header files. dnl Checks for typedefs, structures, and compiler characteristics. AC_SUBST(TARGET_CLASSPATH)dnl dnl Checks for library functions. dnl Checks for command line options. AC_MSG_CHECKING(overview) AC_ARG_ENABLE(overview, [ --enable-overview enables the overview option for javadoc, using the package.html as an overview file.], [ case "${enableval}" in y | yes) if test "${JAVA_PLATFORM}" != "2"; then AC_MSG_RESULT(Overview enabled with non-1.2 JVM - expect problems making javadoc) else AC_MSG_RESULT(enabled) OVERVIEW="-overview package.html" fi ;; n | no) AC_MSG_RESULT(disabled) OVERVIEW="" ;; esac AC_SUBST(OVERVIEW) ], [ if test "${JAVA_PLATFORM}" = "2"; then AC_MSG_RESULT(enabled) OVERVIEW="-overview package.html" else AC_MSG_RESULT(disabled) OVERVIEW="" fi AC_SUBST(OVERVIEW) ]) dnl Check if the JAR signature was requested, and the alias of the signer. AC_ARG_WITH(signature, [ --with-signature[=alias] sign the JAR archive with the given alias (logged user is default).], [ if test ${JAVA_PLATFORM} != "2"; then AC_MSG_ERROR(--with-signature is not supported with JDK other than 1.2) fi AC_MSG_CHECKING(signer identity) case "$withval" in yes) JAR_SIGNER=`whoami` AC_MSG_RESULT([${JAR_SIGNER} (default)]) ;; *) JAR_SIGNER=$withval AC_MSG_RESULT($withval) ;; esac AC_SUBST(JAR_SIGNER) ]) AC_SUBST(SERVER_OPT) AC_SUBST(JAVA_OPT) AC_OUTPUT( index.html docs/Makefile docs/apidocs/Makefile example/Makefile example/ecs.example.sh src/Makefile src/java/Makefile src/java/org/Makefile src/java/org/apache/Makefile src/java/org/apache/Makefile src/java/org/apache/ecs/Makefile src/java/org/apache/ecs/filter/Makefile src/java/org/apache/ecs/html/Makefile src/java/org/apache/ecs/html2ecs/Makefile src/java/org/apache/ecs/xml/Makefile Makefile ) AC_MSG_RESULT() AC_MSG_RESULT(ECS will be installed to: ${prefix}) AC_MSG_RESULT(Build classpath is set to: ${TARGET_CLASSPATH}) AC_MSG_RESULT() if test -z "$BOOTSTRAP"; then AC_MSG_RESULT([You may want to create the ${BOOTFILE} file (see documentation)]) else AC_MSG_RESULT([${BOOTFILE} content was used to configure:]) AC_MSG_RESULT([--- start ---]) cat ${BOOTFILE} AC_MSG_RESULT([---- end ----]) fi AC_MSG_RESULT() AC_MSG_RESULT([Run 'make', optionally 'make check' and then 'make install']) AC_MSG_RESULT(to complete the building process.) AC_MSG_RESULT() AC_MSG_RESULT(Run 'make javadoc' to render the API documentation in docs/apidocs) AC_MSG_RESULT()