dnl @synopsis AX_PROG_JACORBIDL([required-version [, fatal]]) dnl Mark Holder tweaked AX_PROG_ANT to create this dnl check for Jacorb's idl compiler (which is called simply idl) dnl idl -v prints out something like: dnl JacORB IDL compiler V2.2.2, 1-Jun-2005, dnl (C) Gerald Brose, FU Berlin/XTRADYNE Technologies, 1997-2004. dnl so we use sed to delete line 2 - the end dnl from the first line. AC_DEFUN([AX_PROG_JACORBIDL],[ AC_PATH_PROG([JACORBIDL], idl, no, [$PATH:$JACORB_TOP/bin]) if test "x$JACORBIDL" = "xno" then if test -n "$2" then AC_MSG_ERROR([The JacORB idl compiler, idl, is a required tool for building Java, but not found on PATH]) fi else jacorbidl_version=`$JACORBIDL -v | sed '2,$d' | sed 's/^[[^0-9.]]*\([[0-9.]]*\)[[^0-9.]].*/\1/'` AC_MSG_CHECKING([for jacorb idl $jacorbidl_version >= $1]) VERSION_CHECK=`expr $jacorbidl_version \>\= $1` if test "$VERSION_CHECK" = "1" ; then AC_MSG_RESULT(yes) else if test -n "$2" then AC_MSG_ERROR($JACORBIDL is too old) else AC_MSG_RESULT(no) JACORBIDL=no fi fi fi AC_MSG_NOTICE([JACORBIDL is ${JACORBIDL}]) AC_SUBST([JACORBIDL]) AC_PROVIDE([JACORBIDL]) ]) dnl this macro looks for the JACORB_TOP (often in the environment) AC_DEFUN([AX_CHECK_JACORB],[ AC_ARG_WITH( [jacorb-prefix], AS_HELP_STRING([--with-jacorb-prefix=DIR, search for files installed by JacORB in DIR.]), [JACORB_TOP="${withval}"], [JACORB_TOP=""]) checkJacORBTop() { JACORB_TOP="${1}" AC_MSG_NOTICE(["$JACORB_TOP"]) JACORB_TOP=`echo ${JACORB_TOP} | sed 's|[[\\/]]$||'` if ! test -d "$JACORB_TOP/idl/omg" then JACORB_TOP="" fi } findJacORBTop() { JACORB="no" AC_MSG_NOTICE([checking for JacORB...]) AC_MSG_NOTICE([JACORB_TOP is ${JACORB_TOP}]) if test "x${JACORB_TOP}" = "x" then dnl this section is taken from the ai_omniorb.m4, and we have not omniORB we will check that it is the same as OMNIORB_PREFIX if test "x$JACORBIDL" = "xno" -o "x$JACORBIDL" = "x" then AC_MSG_NOTICE([Calling check to locate jacorbidl]) AX_PROG_JACORBIDL([2.2]) fi AC_MSG_NOTICE([JACORBIDL is $JACORBIDL]) if test "x$JACORBIDL" = "xno" then AC_MSG_NOTICE([Looking for jacorb in typical locations]) for JACORB_TOP in "/usr/local" "/usr" "/usr/pkg" "/opt/sfw" "/usr/sfw" "/opt/local" do checkJacORBTop "${JACORB_TOP}" if test "x${JACORB_TOP}" != "x" then break fi done else AC_MSG_NOTICE([getting JACORB_TOP from idl path $JACORBIDL]) JACORB_TOP=`echo ${JACORBIDL} | sed 's|[[\\/]][[^\\/]]\{1,\}[[\\/]][[^\\/]]\{1,\}$||'` checkJacORBTop "${JACORB_TOP}" fi else checkJacORBTop "${JACORB_TOP}" fi if test "x${JACORB_TOP}" = "x" then return fi ORB_JAVA_COSS_IDL_DIRS="${JACORB_TOP}/idl/omg" if test ! -f "${JACORB_TOP}/bin/idl" then AC_MSG_WARN("idl not found in $JACORB_TOP/bin") JACORB_TOP="" return fi ORB_JAVA_BIN_DIRS="${JACORB_TOP}/bin" ORB_JAVA_LIB_DIRS="${OMNIORB_PREFIX}/lib" _AI_LIST_ADD_SUFFIX([${ORB_JAVA_BIN_DIRS}], [${PATH_SEPARATOR}], JAVA_IDLC_DIR) JAVA_IDLC_PATH="${ORB_JAVA_BIN_DIRS}/idl" JAVA_IDLC_DIR="${JAVA_IDLC_DIR}\$\$PATH" JAVA_IDLC="PATH=${JAVA_IDLC_DIR} idl" JAVA_IDLC_FLAGS="-DJACORB_HAS_BROKEN_FORWARD_DECL" JACORB="yes" ORB_JAVA_TYPE="JacORB" } findJacORBTop if test "x${JACORB_TOP}" = "x" then AC_MSG_NOTICE([JacORB not found]) JAVA_IDLC_FLAGS="" ORB_JAVA_COSS_IDL_DIRS="" JAVA_IDLC_PATH="" else AC_MSG_NOTICE([found JacORB]) fi AC_SUBST([JAVA_IDLC]) AC_SUBST([JAVA_IDLC_PATH]) AC_SUBST([JAVA_IDLC_FLAGS]) AC_SUBST([JACORB_TOP]) AC_SUBST([ORB_JAVA_COSS_IDL_DIRS]) AC_PROVIDE([JAVA_IDLC]) AC_PROVIDE([JAVA_IDLC_PATH]) AC_PROVIDE([JAVA_IDLC_FLAGS]) AC_PROVIDE([JACORB_TOP]) AC_PROVIDE([ORB_JAVA_COSS_IDL_DIRS]) ])