simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] help needed for autotools in simulavrxx


From: Russell Shaw
Subject: Re: [Simulavr-devel] help needed for autotools in simulavrxx
Date: Wed, 09 Feb 2005 01:13:25 +1100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1

Klaus Rudolph wrote:
Hi all,

we need very soon help for the autotools for the simulavr project. We are
not able to set up a working toolchain for linux, osx and maybe windows.
Actually we are not able to build on any os.
I will not spend more time for the simulator. My work is on the technical
side of simulation and testing not in configuration any kind of tools arround.
> If the project is not supported anymore I will drop the project.

Try this patch on the cvs version of simulavrxx.
diff -u simulavrxx/bootstrap simulavrxx-new/bootstrap
--- simulavrxx/bootstrap        2005-02-09 00:17:28.000000000 +1100
+++ simulavrxx-new/bootstrap    2005-02-09 00:49:08.000000000 +1100
@@ -1,7 +1,50 @@
-#! /bin/sh
-set -x
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+# For debug, do: ./configure CFLAGS="-O0 -g
+# Takes file/dir as parameter for a directory, and extra params for "configure"
+srcdir=`dirname $0`
+
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+PROJECT=simulavrxx
+TEST_TYPE=-d
+FILE=src
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "You must have autoconf installed to compile $PROJECT."
+    exit 1
+}
+
+(libtool --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "You must have libtool installed to compile $PROJECT."
+    exit 1
+}
+                 
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "You must have automake installed to compile $PROJECT."
+    exit 1
+}
+
+test $TEST_TYPE $FILE || {
+    echo "You must run this script in the top-level $PROJECT directory"
+    exit 1
+}
+
 aclocal -I config
 autoheader
 libtoolize --force
 automake --add-missing --copy
 autoconf
+
+cd $ORIGDIR
+
+echo
+echo "Now type './configure' to configure $PROJECT."
+
+
 
diff -u simulavrxx/configure.ac simulavrxx-new/configure.ac
--- simulavrxx/configure.ac     2005-02-09 00:17:29.000000000 +1100
+++ simulavrxx-new/configure.ac 2005-02-09 00:38:08.000000000 +1100
@@ -1,74 +1,104 @@
-dnl Process this file with autoconf to produce a configure script.
-AMDEP
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
 AC_PREREQ(2.59)
-AC_INIT
+AC_INIT([Simulavrxx], 0.8.004, [Klaus Rudolph <address@hidden>], [simulavrxx])
 AC_CONFIG_SRCDIR([src/main.cpp])
-AC_CONFIG_AUX_DIR(config)
-AM_CONFIG_HEADER(src/config.h)
-AM_INIT_AUTOMAKE(simulavrxx, 0.8.004)
-AM_MAINTAINER_MODE
+AC_CONFIG_HEADER([src/config.h])
+AC_CONFIG_AUX_DIR([config])
 
+AM_INIT_AUTOMAKE
 
-AC_PROG_CC
+AM_MAINTAINER_MODE
+
+# Checks for programs.
 AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
 AC_PROG_LIBTOOL
-
-AC_CHECK_PROG(AVR_AS, avr-as, avr-as)
-AC_CHECK_PROG(AVR_LD, avr-ld, avr-ld)
-AC_CHECK_PROG(AVR_GCC, avr-gcc, avr-gcc)
-AC_CHECK_PROG(AVR_GXX, avr-g++, avr-g++)
-AC_PATH_PROG(TCL_WISH, wish wish8.4 wish8.3 wish8.2)
-AC_CHECK_PROG(CCACHE, ccache, ccache, "")
 AC_SWIG
 
+AC_CHECK_PROG(AVR_AS, [avr-as], [avr-as])
+AC_CHECK_PROG(AVR_LD, [avr-ld], [avr-ld])
+AC_CHECK_PROG(AVR_GCC, [avr-gcc], [avr-gcc])
+AC_CHECK_PROG(AVR_GXX, [avr-g++], [avr-g++])
+AC_PATH_PROGS(TCL_WISH, [wish wish8.4 wish8.3 wish8.2])
+AC_CHECK_PROG(CCACHE, [ccache], [ccache], [""])
+
+AC_SUBST([AVR_AS])
+AC_SUBST([AVR_LD])
+AC_SUBST([AVR_GCC])
+AC_SUBST([AVR_GXX])
+AC_SUBST([TCL_WISH])
+AC_SUBST([CCACHE])
+
+
+# Checks for libraries.
+AC_CHECK_LIB([ncurses], [cbreak])
+
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h 
sys/socket.h unistd.h])
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_C_VOLATILE
+
+
 if test -e ${swig_path}; then
- echo "got swig"
+  AC_MSG_NOTICE([got swig])
 else
  swig_path=""
 fi
 
 if (echo $CXX | grep ccache); then
-echo
+  echo
 else 
-CC="$CCACHE $CC"
-CXX="$CCACHE $CXX"
+  CC="$CCACHE $CC"
+  CXX="$CCACHE $CXX"
 fi
 
+AC_SUBST([CXX])
+
 AM_CONDITIONAL(HAVE_WISH, test x$TCL_WISH != x)
 
+AC_MSG_CHECKING([for tclConfig.sh])
+AC_PATH_PROGS(TCL_CONFIG, [tclConfig.sh], [""], [/usr/lib/tcl /usr/lib/tcl8.4 
/usr/lib/tcl8.3 /usr/lib/tcl8.2])
+
 # find any old tcl, if present. (AC_SEARCH_LIBS more useful here? I
 # think we don't want to always include it in LIBS which AC_SERCH_LIBS
 # seems to do)
-if test x"${TCL_WISH}" != "x"; then
-        MY_WISH=`which ${TCL_WISH}`
-        LIBTCL_PATH=[`ldd ${MY_WISH} | grep libtcl | sed -e 's/.*=>[ 
\t]*\(.*\)\/[^/]\+[ \t]\+(0x[0-9a-f]\+)[ \t]*/\1/'`]
-        echo "LIBTCL_PATH = $LIBTCL_PATH"
-        LIBTCL_CONFIG=${LIBTCL_PATH}/tclConfig.sh
-        if test -f ${LIBTCL_CONFIG}; then
-           source `echo ${LIBTCL_CONFIG}`
-           # WAR: I don't know what I'm doing...TCL_LIB_SPEC contains
-           # an unepanded variable ${TCL_DBGX} when I looked..
-           MYTCL_LIB_SPEC=`eval echo ${TCL_LIB_SPEC}`
-           echo "MYTCL_LIB_SPEC=$MYTCL_LIB_SPEC"
-        else
-           AC_MSG_WARN( [Failed to find tclConfih.sh... tcl dependent code may 
fail to build...ask package maintainer to update configure process])
-        fi
-
+if test x"${TCL_CONFIG}" != "x"; then
+    source ${TCL_CONFIG}
+    # WAR: I don't know what I'm doing...TCL_LIB_SPEC contains
+    # an unepanded variable ${TCL_DBGX} when I looked..
+    MYTCL_LIB_SPEC=`eval echo "${TCL_LIB_SPEC}"`
+    echo "MYTCL_LIB_SPEC=$MYTCL_LIB_SPEC"
 else
-AC_MSG_WARN([Checking for tcl via ldd wish: no wish found])
+    AC_MSG_WARN([Failed to find tclConfig.sh... tcl dependent code may fail to 
build...ask package maintainer to update configure process])
 fi
 
-
-AC_SUBST([AVR_AS])
-AC_SUBST([AVR_LD])
-AC_SUBST([AVR_GCC])
-AC_SUBST([AVR_GXX])
-AC_SUBST([TCL_WISH])
 AC_SUBST([TCL_LIB_SPEC])
-AC_SUBST([CXX])
+AC_SUBST([MYTCL_LIB_SPEC])
+
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_TYPE_SIGNAL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([inet_ntoa memset socket strdup strerror])
+
 
 dnl This macro searches for python version 2.1.1 or newer
-AC_CACHE_CHECK(for python >= 2.1.1, _cv_python_211, [
+AC_CACHE_CHECK([for python >= 2.1.1], [_cv_python_211], [
 
 changequote(<@, @>)
 
@@ -100,17 +130,13 @@
   AC_MSG_WARN([ ])
 fi
 AC_SUBST([ac_regression_subdir])
-AM_CONDITIONAL(COND_HAS_PYTHON, test "x$_cv_python_211" = "xyes")
+AM_CONDITIONAL(COND_HAS_PYTHON, [test "x$_cv_python_211" = "xyes"])
 
 
 
-dnl Checks for programs.
-
-dnl Checks for libraries.
-
-AC_ARG_WITH( [bfd-path],[--with-bfd-path=path location of AVR-binutils version 
of libbfd],
-[
-  AVR_BFD_SEARCH_STEP(${withval})
+AC_ARG_WITH([bfd-path],
+           [--with-bfd-path=path location of AVR-binutils version of libbfd],
+           [AVR_BFD_SEARCH_STEP([${withval}])
 ])
 if test x"$bfd_h_location" == "x"; then
   libbfd_root_location=$(which avr-readelf | sed -e ['s/\/[^\/]*\/[^\/]*$//']) 
2> /dev/null
@@ -123,62 +149,52 @@
 
 *** ERROR ***
 
-provide --with-bfd-path=path-to-your-avr-libbfd-files or
-ensure your AVR cross-compiler toolset is in the path
-\(read-elf is used to auto-detect where your 
-AVR-build libbfd library is\)
-
-for example, user the --enable-install-libbfd flag when configuring
-binutils for AVR or execute make install_libbfd from your
-AVR-binutil's bfd subdirectory to install the AVR-binutils version of
-libbfd. Observe where the files are installed. For example:
---with-bfd-path=/home/some_user/install/i686-pc-linux-gnu/avr
+Provide --with-bfd-path=path-to-your-avr-bfd.h to ".\configure" or ensure
+your AVR cross-compiler toolset is in the path (read-elf is used to auto-detect
+where your AVR-build libbfd library is).
+
+For example, use the --enable-install-libbfd flag when configuring binutils for
+the AVR or execute "make install_libbfd" from your AVR-binutils' bfd 
subdirectory.
+Observe where the files are installed. For example:
+
+  ./configure --with-bfd-path=/home/someuser/build-avr-binutils/bfd
 
 This will make include/bfd.h and lib/libbfd.a available as required 
-by this package
+by this package.
+
+Alternatively, you may just keep your AVR-binutils build files around
+and point to the bfd subdirectory there.
 
-alternatively you may just keep your AVR-binutils build files around
-and point to the bfd sibdirecotry there.
+GNU locate may be useful: locate bfd.h
+and see if there's a bfd.h in any of
+the AVR directories.
 
 ])
 fi
 
-AC_SUBST(bfd_h_location)
-AC_SUBST(bfd_a_location)
+AC_SUBST([bfd_h_location])
+AC_SUBST([bfd_a_location])
 
 echo set libbfd_root_location to ${libbfd_root_location}
 
-AVR_LIBIBERTY(${libbfd_root_location})
+AVR_LIBIBERTY([${libbfd_root_location}])
 avr_readelf=$(dirname $(dirname [$(which avr-readelf])))
-AVR_LIBIBERTY(${avr_readelf}/lib)
+AVR_LIBIBERTY([${avr_readelf}/lib])
 
 
-dnl Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h)
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-
-dnl Checks for library functions.
-AC_FUNC_VPRINTF
-
 AC_SUBST([ac_aux_dir])
 my_top_builddir=`pwd`/
 AC_SUBST([my_top_builddir])
-AC_SUBST([TCL_WISH])
-AC_SUBST([CCACHE])
-AC_SUBST([MYTCL_LIB_SPEC])
 
-AC_CONFIG_FILES([Makefile \
-        doc/Makefile \
-        src/Makefile \
-        regress/Makefile \
-        regress/regress.py \
-        regress/modules/Makefile \
-        regress/test_opcodes/Makefile \
-        examples/Makefile examples/anacomp/Makefile \
-        examples/gui.tcl examples/anacomp/check.tcl \
+AC_CONFIG_FILES([Makefile
+        doc/Makefile
+        src/Makefile
+        regress/Makefile
+        regress/regress.py
+        regress/modules/Makefile
+        regress/test_opcodes/Makefile
+        examples/Makefile examples/anacomp/Makefile
+        examples/gui.tcl examples/anacomp/check.tcl
         examples/anacomp/checkdebug.tcl ])
 AC_OUTPUT
 
Common subdirectories: simulavrxx/doc and simulavrxx-new/doc
Common subdirectories: simulavrxx/examples and simulavrxx-new/examples
Common subdirectories: simulavrxx/regress and simulavrxx-new/regress
Common subdirectories: simulavrxx/src and simulavrxx-new/src
Common subdirectories: simulavrxx/tests and simulavrxx-new/tests

reply via email to

[Prev in Thread] Current Thread [Next in Thread]