File: configure.ac

package info (click to toggle)
tinyos-tools 1.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 3,164 kB
  • ctags: 1,629
  • sloc: cpp: 10,398; sh: 1,229; python: 1,200; ansic: 562; makefile: 305; xml: 24
file content (175 lines) | stat: -rw-r--r-- 4,175 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/bin/sh
# Copyright (c) 2005 Intel Corporation
# All rights reserved.
#
# This file is distributed under the terms in the attached INTEL-LICENSE     
# file. If you do not find these files, copies can be found by writing to
# Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 
# 94704.  Attention:  Intel License Inquiry.

dnl -*- m4 -*-

# force autoconf 2.5 on Debian systems
AC_PREREQ(2.50)

AC_INIT(tinyos-tools, 1.4.2)
AC_CONFIG_AUX_DIR(config-aux)
AM_INIT_AUTOMAKE
AC_CANONICAL_HOST

AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB

AC_PATH_PROG(pathperl, perl)
if test -z "$pathperl" ; then
  AC_MSG_ERROR(I can't find perl); 
fi

AC_PATH_PROGS(pathpython, [python2 python])
if test -z "$pathpython" ; then
  AC_MSG_ERROR(I can't find python); 
fi

if test -z "$NESCC_PREFIX"; then
  AC_PATH_PROG(pathnescc, nescc)
  if test -z "$pathnescc"; then
    AC_MSG_ERROR(I can't find nescc)
  else
    NESCC_PREFIX=`dirname "$pathnescc"`
    NESCC_PREFIX=`dirname "$NESCC_PREFIX"`
  fi
fi
nescc_prefix=`(cd $NESCC_PREFIX;pwd)`
AC_SUBST(nescc_prefix)


if test -z "$DEFAULT_TARGET"; then
  DEFAULT_TARGET=mica
fi
default_target=$DEFAULT_TARGET
AC_MSG_NOTICE(Default ncc build target is $default_target)
AC_MSG_NOTICE(...but using a tos/.default-platform file is a better choice)
AC_SUBST(default_target)

if test -z "$TOSDIR"; then
  if test -d ../tos; then
    TOSDIR=../tos
  elif test -d ../../tos; then
    TOSDIR=../../tos
  elif test -d $HOME/nest/tos; then
    TOSDIR=$HOME/nest/tos
  else
    AC_MSG_ERROR(I can't find the tos directory);
  fi
fi
TOSDIR=`(cd $TOSDIR;pwd)`
AC_MSG_NOTICE(TinyOS directory is $TOSDIR)
AC_SUBST(TOSDIR)

AC_MSG_CHECKING(for cygwin)
case $host in
  *-*-cygwin*)
    AC_MSG_RESULT(yes)
    JNIPREFIX=
    JNISUFFIX=dll
    JNIVERSIONS=.
    INSTALLJNI="install --group=SYSTEM"
    CYGWIN=yes
    ;;
  *-apple-darwin*)
    JNIPREFIX=lib
    JNISUFFIX=jnilib
    JNIVERSIONS=.
    INSTALLJNI="install"
    AC_MSG_RESULT(no)
    DARWIN=yes
    ;;
  *)
    JNIPREFIX=lib
    JNISUFFIX=so
    JNIVERSIONS="-32. -64."
    INSTALLJNI="install"
    AC_MSG_RESULT(no)
esac

AM_CONDITIONAL([CYGWIN], [test "$CYGWIN"])
AM_CONDITIONAL([DARWIN], [test "$DARWIN"])

AC_MSG_CHECKING(for JDK location)
JAVAC_DIR=`/bin/sh tinyos/misc/tos-locate-jre --javac`
if test $? -ne 0; then
  AC_ERROR(java not found)
fi
JDK=`dirname "$JAVAC_DIR"`
AC_MSG_RESULT($JDK)

function jnimap {
  for v in $JNIVERSIONS; do
    /bin/echo -n "${JNIPREFIX}$1$v$JNISUFFIX "
  done
}

GETENVLIB=`jnimap getenv`
TOSCOMMLIB=`jnimap toscomm`

AC_SUBST(GETENVLIB)
AC_SUBST(TOSCOMMLIB)
AC_SUBST(JDK)
AC_SUBST(INSTALLJNI)
AC_SUBST(JNIPREFIX)
AC_SUBST(JNISUFFIX)

AC_CONFIG_SUBDIRS(platforms/mica/uisp)

AC_OUTPUT(
	Makefile
	platforms/Makefile
	platforms/mica/Makefile
	platforms/mica/cc1000-channelgen/Makefile
	platforms/msp430/Makefile
	platforms/msp430/motelist/motelist-linux
	platforms/msp430/motelist/motelist-macos
	platforms/msp430/motelist/Makefile
	platforms/msp430/pybsl/Makefile
	platforms/msp430/pybsl/tos-bsl.1
	platforms/msp430/pybsl/serial/Makefile
	platforms/msp430/pybsl/serial/serialposix.py
	platforms/msp430/pybsl/serial/__init__.py
	platforms/msp430/pybsl/serial/serialwin32.py
	platforms/msp430/pybsl/elf.py
	platforms/msp430/pybsl/tos-bsl
	platforms/sam3/samba-program.py
	platforms/sam3/Makefile
	platforms/intelmote2/openocd/imote2-ocd-program.py
	tinyos/Makefile
	tinyos/java/Makefile
	tinyos/java/env/Makefile
	tinyos/java/serial/Makefile
	tinyos/misc/tos-ident-flags
	tinyos/misc/tos-install-jni
	tinyos/misc/tos-set-symbols
	tinyos/misc/tos-write-buildinfo
	tinyos/misc/tos-write-image
	tinyos/misc/tos-storage-at45db
	tinyos/misc/tos-storage-stm25p
	tinyos/misc/tos-storage-pxa27xp30
	tinyos/misc/tos-dump.py
	tinyos/misc/tos-nwprog
	tinyos/misc/tos-deluge
	tinyos/misc/tos-build-deluge-image
	tinyos/misc/tos-mote-key
	tinyos/misc/tos-check-env
	tinyos/misc/Makefile
	tinyos/ncc/Makefile
	tinyos/ncc/mig
	tinyos/ncc/ncc
	tinyos/ncc/ncg
	tinyos/ncc/nesdoc
	tinyos/ncc/nesdoc-py/Makefile
	tinyos/tosthreads/Makefile
	tinyos/tosthreads/tosthreads_standard_api.py
	tinyos/safe/Makefile
	tinyos/safe/tos-decode-flid
	tinyos/safe/tos-ramsize
)