1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_AUX_DIR(../config)
4 AM_INIT_AUTOMAKE(sidcomp,0.1)
5 AM_CONFIG_HEADER(config.h:config.in)
21 AC_CHECK_LIB(stdc++, main)
24 dnl For lcd component only.
25 dnl Check if we can link curses programs without libtermcap.
26 dnl If not, add it in.
28 AC_CHECK_LIB(curses, refresh, lcd_libs="-lcurses $lcd_libs",
29 AC_CHECK_LIB(curses, refresh,
30 lcd_libs="-lcurses -ltermcap", ,-ltermcap))
33 dnl For socket-related components only.
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"))
41 AC_CHECK_FUNCS(ftime gettimeofday usleep strtoul strtoull select)
44 LIBS="$LIBS $socket_libs"
45 AC_CHECK_FUNCS(inet_aton inet_addr)
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)
53 AC_CHECK_HEADERS(../ucbinclude/sys/ioctl.h)
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
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])
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
64 if test x$ac_cv_decl_usleep = xyes; then
65 AC_DEFINE(HAVE_USLEEP_DECL, 1, [Define if usleep(2) via unistd.h])
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
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])
78 dnl Perform --target/--enable-targets processing.
82 dnl All self-configuring component subdirectories should be listed here.
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])
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)
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
106 lcd/Makefile lcd/testsuite/Makefile
108 mapper/Makefile mapper/testsuite/Makefile
115 uart/Makefile uart/testsuite/Makefile])