OSDN Git Service

* public snapshot of sid simulator
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(Makefile.in)
3 AC_CONFIG_AUX_DIR(../config)
4 AM_INIT_AUTOMAKE(sidcomp,0.1)
5 AM_CONFIG_HEADER(config.h:config.in)
6
7 dnl automake support
8 AM_MAINTAINER_MODE
9 AC_LIBTOOL_WIN32_DLL
10 AM_PROG_LIBTOOL
11
12 AC_EXEEXT
13 AC_PROG_CXX
14 AC_PROG_CXXCPP
15 AC_PROG_MAKE_SET
16 AC_ARG_PROGRAM
17 AC_LANG_CPLUSPLUS
18 AC_HEADER_STDC
19 AC_HEADER_TIME
20
21 AC_CHECK_LIB(stdc++, main)
22 AC_CHECK_LIB(m, main)
23
24 dnl For lcd component only.
25 dnl Check if we can link curses programs without libtermcap.
26 dnl If not, add it in.
27 lcd_libs=
28 AC_CHECK_LIB(curses, refresh, lcd_libs="-lcurses $lcd_libs",
29              AC_CHECK_LIB(curses, refresh,
30                 lcd_libs="-lcurses -ltermcap", ,-ltermcap)) 
31 AC_SUBST(lcd_libs)
32
33 dnl For socket-related components only.
34 socket_libs=
35 AC_CHECK_LIB(socket, connect, socket_libs="-lsocket $socket_libs")
36 AC_CHECK_LIB(nsl, gethostbyname, socket_libs="$socket_libs -lnsl",
37         AC_CHECK_LIB(resolv, gethostbyname,
38                 socket_libs="$socket_libs -lresolv"))
39 AC_SUBST(socket_libs)
40
41 AC_CHECK_FUNCS(ftime gettimeofday usleep strtoul strtoull select)
42
43 old_libs="$LIBS"
44 LIBS="$LIBS $socket_libs"
45 AC_CHECK_FUNCS(inet_aton inet_addr)
46 LIBS="$old_libs"
47
48 AC_CHECK_HEADERS(curses.h time.h unistd.h)
49 AC_CHECK_HEADERS(sys/time.h sys/timeb.h sys/types.h )
50 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netinet/tcp.h arpa/inet.h)
51
52 dnl XXX: for Solaris?
53 AC_CHECK_HEADERS(../ucbinclude/sys/ioctl.h)
54
55 AC_CACHE_CHECK(whether ftime is declared, ac_cv_decl_ftime, [
56 AC_EGREP_HEADER(ftime, sys/timeb.h, [ac_cv_decl_ftime=yes], [ac_cv_decl_ftime=no
57 ])])
58 if test x$ac_cv_decl_ftime = xyes; then
59   AC_DEFINE(HAVE_FTIME_DECL, 1, [Define if ftime(3) is declared via sys/timeb.h])
60 fi
61 AC_CACHE_CHECK(whether usleep is declared, ac_cv_decl_usleep, [
62 AC_EGREP_HEADER(usleep, unistd.h, [ac_cv_decl_usleep=yes], [ac_cv_decl_usleep=no
63 ])])
64 if test x$ac_cv_decl_usleep = xyes; then
65   AC_DEFINE(HAVE_USLEEP_DECL, 1, [Define if usleep(2) via unistd.h])
66 fi
67
68 AC_CACHE_CHECK(whether socklen_t is declared, ac_cv_decl_socklen_t, [
69 AC_EGREP_HEADER(socklen_t, sys/socket.h, [ac_cv_decl_socklen_t=yes], [ac_cv_decl_socklen_t=no
70 ])])
71 if test x$ac_cv_decl_socklen_t = xyes; then
72   AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if socklen_t is declared via sys/socket.h])
73 fi
74
75 AC_SUBST(CYGWIN)
76
77
78 dnl Perform --target/--enable-targets processing.
79 CY_SIDTARGET_CHECK
80
81
82 dnl All self-configuring component subdirectories should be listed here.
83 dnl
84 dnl cfgroot is here because it's statically linked, and libltdl is its baby.
85 dnl tcl is here because it looks for tcl/tk in a too complex way for this file.
86 dnl audio is here because it has more host-dependent configuration
87 dnl cgen-cpu is here because it has target-dependent configuration
88 AC_CONFIG_SUBDIRS([cfgroot tcl audio cgen-cpu timers])
89
90
91
92 dnl All other component subdirectories should be listed here, so "make"
93 dnl can recursively descend there - see "Makefile.am".
94 make_subdirs="consoles gdb gloss glue ide interrupt lcd loader mapper memory mmu parport profiling rtc sched uart testsuite"
95 AC_SUBST(make_subdirs)
96
97 dnl List all component subdirectory files not covered by AC_CONFIG_SUBDIRS
98 dnl that need autoconf @substitution@.
99 AC_OUTPUT([Makefile testsuite/Makefile tconfig.h:tconfig.in siddoc
100         consoles/Makefile
101         gdb/Makefile
102         gloss/Makefile
103         glue/Makefile
104         ide/Makefile
105         interrupt/Makefile
106         lcd/Makefile lcd/testsuite/Makefile
107         loader/Makefile
108         mapper/Makefile mapper/testsuite/Makefile
109         memory/Makefile
110         mmu/Makefile
111         parport/Makefile
112         profiling/Makefile
113         rtc/Makefile
114         sched/Makefile
115         uart/Makefile uart/testsuite/Makefile])