Fix delete_hw_event_data() to free the scheduled events
[deliverable/binutils-gdb.git] / sim / common / aclocal.m4
index 990dfa217ae69fc1e338db4f6963ad11e05cda49..30934b24830010465577a155196ff966fc3759ff 100644 (file)
@@ -43,11 +43,23 @@ AR=${AR-ar}
 AC_SUBST(AR)
 AC_PROG_RANLIB
 
+dnl We don't use gettext, but bfd does.  So we do the appropriate checks
+dnl to see if there are intl libraries we should link against.
+ALL_LINGUAS=
+CY_GNU_GETTEXT
+
 # Check for common headers.
 # FIXME: Seems to me this can cause problems for i386-windows hosts.
 # At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
-AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h sys/time.h sys/resource.h)
-AC_CHECK_FUNCS(getrusage time sigaction)
+AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h)
+AC_CHECK_HEADERS(sys/time.h sys/resource.h)
+AC_CHECK_HEADERS(fcntl.h fpu_control.h)
+AC_CHECK_HEADERS(dlfcn.h errno.h sys/stat.h)
+AC_CHECK_FUNCS(getrusage time sigaction __setfpucw)
+
+# Check for socket libraries
+AC_CHECK_LIB(socket, bind)
+AC_CHECK_LIB(nsl, gethostbyname)
 
 . ${srcdir}/../../bfd/configure.host
 
@@ -60,10 +72,11 @@ dnl all shall eventually behave the same way.
 
 dnl We don't use automake, but we still want to support
 dnl --enable-maintainer-mode.
+USE_MAINTAINER_MODE=no
 AC_ARG_ENABLE(maintainer-mode,
 [  --enable-maintainer-mode            Enable developer functionality.],
 [case "${enableval}" in
-  yes) MAINT="" ;;
+  yes) MAINT="" USE_MAINTAINER_MODE=yes ;;
   no)  MAINT="#" ;;
   *)   AC_MSG_ERROR("--enable-maintainer-mode does not take a value"); MAINT="#" ;;
 esac
@@ -91,7 +104,7 @@ AC_SUBST(sim_bswap)
 AC_ARG_ENABLE(sim-cflags,
 [  --enable-sim-cflags=opts            Extra CFLAGS for use in building simulator],
 [case "${enableval}" in
-  yes)  sim_cflags="-O2";;
+  yes)  sim_cflags="-O2 -fomit-frame-pointer";;
   trace) AC_MSG_ERROR("Please use --enable-sim-debug instead."); sim_cflags="";;
   no)   sim_cflags="";;
   *)    sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
@@ -186,13 +199,15 @@ AC_ARG_ENABLE(sim-profile,
 esac
 if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then
   echo "Setting sim profile = $sim_profile" 6>&1
-fi],[sim_profile=""])dnl
+fi],[sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1"])dnl
 AC_SUBST(sim_profile)
 
 
 dnl Types used by common code
 AC_TYPE_SIGNAL
 
+dnl Detect exe extension
+AC_EXEEXT
 
 dnl These are available to append to as desired.
 sim_link_files=
@@ -472,19 +487,35 @@ fi])dnl
 AC_SUBST(sim_hostendian)
 
 
+dnl --enable-sim-float is for developers of the simulator
+dnl It specifies the presence of hardware floating point
+dnl And optionally the bitsize of the floating point register.
+dnl arg[1] specifies the presence (or absence) of floating point hardware
+dnl arg[2] specifies the number of bits in a floating point register
 AC_DEFUN(SIM_AC_OPTION_FLOAT,
 [
-default_sim_floating_point="ifelse([$1],,0,[$1])"
+default_sim_float="[$1]"
+default_sim_float_bitsize="[$2]"
 AC_ARG_ENABLE(sim-float,
 [  --enable-sim-float                  Specify that the target processor has floating point hardware.],
 [case "${enableval}" in
   yes | hard)  sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
   no | soft)   sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
+  32)           sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=32";;
+  64)           sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=64";;
   *)           AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
 esac
 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
   echo "Setting float flags = $sim_float" 6>&1
-fi],[sim_float="-DWITH_FLOATING_POINT=${default_sim_floating_point}"])dnl
+fi],[
+sim_float=
+if test x"${default_sim_float}" != x""; then
+  sim_float="-DWITH_FLOATING_POINT=${default_sim_float}"
+fi
+if test x"${default_sim_float_bitsize}" != x""; then
+  sim_float="$sim_float -DWITH_TARGET_FLOATING_POINT_BITSIZE=${default_sim_float_bitsize}"
+fi
+])dnl
 ])
 AC_SUBST(sim_float)
 
@@ -526,34 +557,73 @@ fi],[sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'"
 AC_SUBST(sim_default_model)
 
 
+dnl --enable-sim-hardware is for users of the simulator
+dnl arg[1] Enable sim-hw by default? ("yes" or "no")
+dnl arg[2] is a space separated list of devices that override the defaults
+dnl arg[3] is a space separated list of extra target specific devices.
 AC_DEFUN(SIM_AC_OPTION_HARDWARE,
 [
+if test x"[$1]" = x"yes"; then
+  sim_hw_p=yes
+else
+  sim_hw_p=no
+fi
+if test "[$2]"; then
+  hardware="core pal glue"
+else
+  hardware="core pal glue [$3]"
+fi
+sim_hw_cflags="-DWITH_HW=1"
+sim_hw="$hardware"
+sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/dv-\1.o/g'`"
 AC_ARG_ENABLE(sim-hardware,
-[  --enable-sim-hardware=list          Specify the hardware to be included in the build.],
-[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+[  --enable-sim-hardware=LIST          Specify the hardware to be included in the build.],
+[
 case "${enableval}" in
-  yes) ;;
-  no)  AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
-  ,*)   hardware="${hardware}${enableval}";;
-  *,)   hardware="${enableval}${hardware}";;
-  *)   hardware="${enableval}"'';;
+  yes) sim_hw_p=yes;;
+  no)  sim_hw_p=no;;
+  ,*)   sim_hw_p=yes; hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
+  *,)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
+  *)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
 esac
-sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
-sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
-if test x"$silent" != x"yes" && test x"$hardware" != x""; then
-  echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
-fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
-sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
-sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
+if test "$sim_hw_p" != yes; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in x $hardware ; do
+    case " $f " in
+      x) ;;
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+fi
+if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi],[
+if test "$sim_hw_p" != yes; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+fi
 if test x"$silent" != x"yes"; then
-  echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
 fi])dnl
 ])
-AC_SUBST(sim_hardware)
+AC_SUBST(sim_hw_cflags)
+AC_SUBST(sim_hw_objs)
+AC_SUBST(sim_hw)
 
 
 dnl --enable-sim-inline is for users that wish to ramp up the simulator's
 dnl performance by inlining functions.
+dnl Guarantee that unconfigured simulators do not do any inlining
+sim_inline="-DDEFAULT_INLINE=0"
 AC_DEFUN(SIM_AC_OPTION_INLINE,
 [
 default_sim_inline="ifelse([$1],,,-DDEFAULT_INLINE=[$1])"
@@ -563,15 +633,15 @@ AC_ARG_ENABLE(sim-inline,
 case "$enableval" in
   no)          sim_inline="-DDEFAULT_INLINE=0";;
   0)           sim_inline="-DDEFAULT_INLINE=0";;
-  yes | 2)     sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
+  yes | 2)     sim_inline="-DDEFAULT_INLINE=ALL_C_INLINE";;
   1)           sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
   *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
        new_flag=""
        case "$x" in
         *_INLINE=*)    new_flag="-D$x";;
         *=*)           new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
-        *_INLINE)      new_flag="-D$x=ALL_INLINE";;
-        *)             new_flag="-D$x""_INLINE=ALL_INLINE";;
+        *_INLINE)      new_flag="-D$x=ALL_C_INLINE";;
+        *)             new_flag="-D$x""_INLINE=ALL_C_INLINE";;
        esac
        if test x"$sim_inline" = x""; then
         sim_inline="$new_flag"
@@ -582,13 +652,18 @@ case "$enableval" in
 esac
 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
   echo "Setting inline flags = $sim_inline" 6>&1
-fi],[if test x"$GCC" != "x" -a x"${default_sim_inline}" != "x" ; then
-  sim_inline="${default_sim_inline}"
-  if test x"$silent" != x"yes"; then
-    echo "Setting inline flags = $sim_inline" 6>&1
+fi],[
+if test "x$cross_compiling" = "xno"; then
+  if test x"$GCC" != "x" -a x"${default_sim_inline}" != "x" ; then
+    sim_inline="${default_sim_inline}"
+    if test x"$silent" != x"yes"; then
+      echo "Setting inline flags = $sim_inline" 6>&1
+    fi
+  else
+    sim_inline=""
   fi
 else
-  sim_inline=""
+  sim_inline="-DDEFAULT_INLINE=0"
 fi])dnl
 ])
 AC_SUBST(sim_inline)
@@ -708,22 +783,41 @@ fi],[sim_xor_endian="-DWITH_XOR_ENDIAN=${default_sim_xor_endian}"])dnl
 AC_SUBST(sim_xor_endian)
 
 
-dnl --enable-sim-warnings is for developers of the simulator.
+dnl --enable-build-warnings is for developers of the simulator.
 dnl it enables extra GCC specific warnings.
 AC_DEFUN(SIM_AC_OPTION_WARNINGS,
 [
-AC_ARG_ENABLE(sim-warnings,
-[  --enable-sim-warnings=opts          Extra CFLAGS for turning on compiler warnings],
-[case "${enableval}" in
-  yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
-  no)  sim_warnings="-w";;
-  *)   sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+AC_ARG_ENABLE(build-warnings,
+[  --enable-build-warnings[=LIST]              Enable build-time compiler warnings],
+[build_warnings="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
+case "${enableval}" in
+  yes) ;;
+  no)  build_warnings="-w";;
+  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+       build_warnings="${build_warnings} ${t}";;
+  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+       build_warnings="${t} ${build_warnings}";;
+  *)   build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
 esac
-if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
-  echo "Setting warning flags = $sim_warnings" 6>&1
-fi],[sim_warnings=""])dnl
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+  echo "Setting warning flags = $build_warnings" 6>&1
+fi
+WARN_CFLAGS=""
+WERROR_CFLAGS=""
+if test "x${build_warnings}" != x -a "x$GCC" = xyes
+then
+  # Separate out the -Werror flag as some files just cannot be
+  # compiled with it enabled.
+  for w in ${build_warnings}; do
+    case $w in
+    -Werr*) WERROR_CFLAGS=-Werror ;;
+    *) WARN_CFLAGS="${WARN_CFLAGS} $w"
+    esac
+  done
+fi],[build_warnings=""])dnl
 ])
-AC_SUBST(sim_warnings)
+AC_SUBST(WARN_CFLAGS)
+AC_SUBST(WERROR_CFLAGS)
 
 
 dnl Generate the Makefile in a target specific directory.
@@ -752,3 +846,383 @@ AC_OUTPUT(Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdb
  case "x$CONFIG_HEADERS" in xconfig.h:config.in) echo > stamp-h ;; esac
 ])
 ])
+
+# This file is derived from `gettext.m4'.  The difference is that the
+# included macros assume Cygnus-style source and build trees.
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 3
+
+AC_DEFUN(CY_WITH_NLS,
+  [AC_MSG_CHECKING([whether NLS is requested])
+    dnl Default is enabled NLS
+    AC_ARG_ENABLE(nls,
+      [  --disable-nls           do not use Native Language Support],
+      USE_NLS=$enableval, USE_NLS=yes)
+    AC_MSG_RESULT($USE_NLS)
+    AC_SUBST(USE_NLS)
+
+    USE_INCLUDED_LIBINTL=no
+
+    dnl If we use NLS figure out what method
+    if test "$USE_NLS" = "yes"; then
+      AC_DEFINE(ENABLE_NLS)
+      AC_MSG_CHECKING([whether included gettext is requested])
+      AC_ARG_WITH(included-gettext,
+        [  --with-included-gettext use the GNU gettext library included here],
+        nls_cv_force_use_gnu_gettext=$withval,
+        nls_cv_force_use_gnu_gettext=no)
+      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+        dnl User does not insist on using GNU NLS library.  Figure out what
+        dnl to use.  If gettext or catgets are available (in this order) we
+        dnl use this.  Else we have to fall back to GNU NLS library.
+       dnl catgets is only used if permitted by option --with-catgets.
+       nls_cv_header_intl=
+       nls_cv_header_libgt=
+       CATOBJEXT=NONE
+
+       AC_CHECK_HEADER(libintl.h,
+         [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
+           [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
+              gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
+
+          if test "$gt_cv_func_gettext_libc" != "yes"; then
+            AC_CHECK_LIB(intl, bindtextdomain,
+              [AC_CACHE_CHECK([for gettext in libintl],
+                gt_cv_func_gettext_libintl,
+                [AC_TRY_LINK([], [return (int) gettext ("")],
+                gt_cv_func_gettext_libintl=yes,
+                gt_cv_func_gettext_libintl=no)])])
+          fi
+
+          if test "$gt_cv_func_gettext_libc" = "yes" \
+             || test "$gt_cv_func_gettext_libintl" = "yes"; then
+             AC_DEFINE(HAVE_GETTEXT)
+             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+               [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+             if test "$MSGFMT" != "no"; then
+               AC_CHECK_FUNCS(dcgettext)
+               AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+               AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+                 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+               AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+                              return _nl_msg_cat_cntr],
+                 [CATOBJEXT=.gmo
+                  DATADIRNAME=share],
+                 [CATOBJEXT=.mo
+                  DATADIRNAME=lib])
+               INSTOBJEXT=.mo
+             fi
+           fi
+       ])
+
+       dnl In the standard gettext, we would now check for catgets.
+        dnl However, we never want to use catgets for our releases.
+
+        if test "$CATOBJEXT" = "NONE"; then
+         dnl Neither gettext nor catgets in included in the C library.
+         dnl Fall back on GNU gettext library.
+         nls_cv_use_gnu_gettext=yes
+        fi
+      fi
+
+      if test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions used to generate GNU NLS library.
+        INTLOBJS="\$(GETTOBJS)"
+        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+        AC_SUBST(MSGFMT)
+       USE_INCLUDED_LIBINTL=yes
+        CATOBJEXT=.gmo
+        INSTOBJEXT=.mo
+        DATADIRNAME=share
+       INTLDEPS='$(top_builddir)/../intl/libintl.a'
+       INTLLIBS=$INTLDEPS
+       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+        nls_cv_header_intl=libintl.h
+        nls_cv_header_libgt=libgettext.h
+      fi
+
+      dnl Test whether we really found GNU xgettext.
+      if test "$XGETTEXT" != ":"; then
+       dnl If it is no GNU xgettext we define it as : so that the
+       dnl Makefiles still can work.
+       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+         : ;
+       else
+         AC_MSG_RESULT(
+           [found xgettext programs is not GNU xgettext; ignore it])
+         XGETTEXT=":"
+       fi
+      fi
+
+      # We need to process the po/ directory.
+      POSUB=po
+    else
+      DATADIRNAME=share
+      nls_cv_header_intl=libintl.h
+      nls_cv_header_libgt=libgettext.h
+    fi
+
+    # If this is used in GNU gettext we have to set USE_NLS to `yes'
+    # because some of the sources are only built for this goal.
+    if test "$PACKAGE" = gettext; then
+      USE_NLS=yes
+      USE_INCLUDED_LIBINTL=yes
+    fi
+
+    dnl These rules are solely for the distribution goal.  While doing this
+    dnl we only have to keep exactly one list of the available catalogs
+    dnl in configure.in.
+    for lang in $ALL_LINGUAS; do
+      GMOFILES="$GMOFILES $lang.gmo"
+      POFILES="$POFILES $lang.po"
+    done
+
+    dnl Make all variables we use known to autoconf.
+    AC_SUBST(USE_INCLUDED_LIBINTL)
+    AC_SUBST(CATALOGS)
+    AC_SUBST(CATOBJEXT)
+    AC_SUBST(DATADIRNAME)
+    AC_SUBST(GMOFILES)
+    AC_SUBST(INSTOBJEXT)
+    AC_SUBST(INTLDEPS)
+    AC_SUBST(INTLLIBS)
+    AC_SUBST(INTLOBJS)
+    AC_SUBST(POFILES)
+    AC_SUBST(POSUB)
+  ])
+
+AC_DEFUN(CY_GNU_GETTEXT,
+  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+   AC_REQUIRE([AC_PROG_CC])dnl
+   AC_REQUIRE([AC_PROG_RANLIB])dnl
+   AC_REQUIRE([AC_ISC_POSIX])dnl
+   AC_REQUIRE([AC_HEADER_STDC])dnl
+   AC_REQUIRE([AC_C_CONST])dnl
+   AC_REQUIRE([AC_C_INLINE])dnl
+   AC_REQUIRE([AC_TYPE_OFF_T])dnl
+   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+   AC_REQUIRE([AC_FUNC_MMAP])dnl
+
+   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h])
+   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+   if test "${ac_cv_func_stpcpy+set}" != "set"; then
+     AC_CHECK_FUNCS(stpcpy)
+   fi
+   if test "${ac_cv_func_stpcpy}" = "yes"; then
+     AC_DEFINE(HAVE_STPCPY)
+   fi
+
+   AM_LC_MESSAGES
+   CY_WITH_NLS
+
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       AC_MSG_CHECKING(for catalogs to be installed)
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       AC_MSG_RESULT($LINGUAS)
+     fi
+
+     dnl Construct list of names of catalog files to be constructed.
+     if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+   dnl The reference to <locale.h> in the installed <libintl.h> file
+   dnl must be resolved because we cannot expect the users of this
+   dnl to define HAVE_LOCALE_H.
+   if test $ac_cv_header_locale_h = yes; then
+     INCLUDE_LOCALE_H="#include <locale.h>"
+   else
+     INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>.  Take care yourself.  */"
+   fi
+   AC_SUBST(INCLUDE_LOCALE_H)
+
+   dnl Determine which catalog format we have (if any is needed)
+   dnl For now we know about two different formats:
+   dnl   Linux libc-5 and the normal X/Open format
+   if test -f $srcdir/po2tbl.sed.in; then
+      if test "$CATOBJEXT" = ".cat"; then
+        AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
+
+        dnl Transform the SED scripts while copying because some dumb SEDs
+         dnl cannot handle comments.
+        sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
+      fi
+      dnl po2tbl.sed is always needed.
+      sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+        $srcdir/po2tbl.sed.in > po2tbl.sed
+   fi
+
+   dnl In the intl/Makefile.in we have a special dependency which makes
+   dnl only sense for gettext.  We comment this out for non-gettext
+   dnl packages.
+   if test "$PACKAGE" = "gettext"; then
+     GT_NO="#NO#"
+     GT_YES=
+   else
+     GT_NO=
+     GT_YES="#YES#"
+   fi
+   AC_SUBST(GT_NO)
+   AC_SUBST(GT_YES)
+
+   MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
+   AC_SUBST(MKINSTALLDIRS)
+
+   dnl *** For now the libtool support in intl/Makefile is not for real.
+   l=
+   AC_SUBST(l)
+
+   dnl Generate list of files to be processed by xgettext which will
+   dnl be included in po/Makefile.  But only do this if the po directory
+   dnl exists in srcdir.
+   if test -d $srcdir/po; then
+      test -d po || mkdir po
+      if test "x$srcdir" != "x."; then
+        if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+           posrcprefix="$srcdir/"
+        else
+           posrcprefix="../$srcdir/"
+        fi
+      else
+        posrcprefix="../"
+      fi
+      rm -f po/POTFILES
+      sed -e "/^#/d" -e "/^\$/d" -e "s,.*,     $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+        < $srcdir/po/POTFILES.in > po/POTFILES
+   fi
+  ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+#
+# This file file be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  /*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in ifelse([$5], , $PATH, [$5]); do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if [$3]; then
+       ac_cv_path_$1="$ac_dir/$ac_word"
+       break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+  ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+AC_DEFUN(AM_LC_MESSAGES,
+  [if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES)
+    fi
+  fi])
+
+
+dnl --enable-cgen-maint support
+AC_DEFUN(SIM_AC_OPTION_CGEN_MAINT,
+[
+cgen_maint=no
+dnl Default is to use one in build tree.
+cgen=guile
+cgendir='$(srcdir)/../../cgen'
+dnl Having --enable-maintainer-mode take arguments is another way to go.
+dnl ??? One can argue --with is more appropriate if one wants to specify
+dnl a directory name, but what we're doing here is an enable/disable kind
+dnl of thing and specifying both --enable and --with is klunky.
+dnl If you reeely want this to be --with, go ahead and change it.
+AC_ARG_ENABLE(cgen-maint,
+[  --enable-cgen-maint[=DIR]    build cgen generated files],
+[case "${enableval}" in
+  yes) cgen_maint=yes ;;
+  no)  cgen_maint=no ;;
+  *)
+       # argument is cgen install directory (not implemented yet).
+       # Having a `share' directory might be more appropriate for the .scm,
+       # .cpu, etc. files.
+       cgendir=${cgen_maint}/lib/cgen
+       cgen=guile
+       ;;
+esac])dnl
+dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} != xno)
+if test x${cgen_maint} != xno ; then
+  CGEN_MAINT=''
+else
+  CGEN_MAINT='#'
+fi
+AC_SUBST(CGEN_MAINT)
+AC_SUBST(cgendir)
+AC_SUBST(cgen)
+])
This page took 0.031293 seconds and 4 git commands to generate.