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
|
dnl Process this file with autoconf to produce a configure script.
dnl Initialize.
AC_INIT(docs/fbgetty.8)
AC_REVISION($Revision: 1.4 $)
AC_PREFIX_DEFAULT(/usr)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(fbgetty,0.1.4)
dnl command line argument
dnl glibc support
AC_ARG_WITH(glibc,
[ --without-glibc disable glibc support],
[case "${withval}" in
yes) glibc=true ;;
no) glibc=false ;;
*) AC_MSG_ERROR(bad value ${withval} for glibc option) ;;
esac],
[glibc=true])
dnl Enable debug
AC_ARG_WITH(debug,
[ --with-debug enable debug support],
[case "${withval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR(bad value ${withval} for debug option) ;;
esac],
[debug=false])
dnl Disable Frame buffer
AC_ARG_WITH(frame_buffer,
[ --without-frame-buffer disable use of framebuffer (default is no)],
[case "${withval}" in
yes) frame_buffer=true ;;
no) frame_buffer=false ;;
*) AC_MSG_ERROR(bad value ${withval} for frame buffer option) ;;
esac],
[frame_buffer=true])
dnl login program
AC_ARG_ENABLE(login_program,
[ --enable-login-program=[LOGIN] use the specified LOGIN program as default],
[login_program="${enableval}"],
[login_program="default"])
dnl issue
AC_ARG_ENABLE(issue_file,
[ --enable-issue-file=[ISSUE] use the specified ISSUE as default],
[issue_file="${enableval}"],
[issue_file="default"])
dnl login prompt
AC_ARG_ENABLE(login_prompt,
[ --enable-login-prompt=[PROMPT] use the specified PROMPT as default],
[login_prompt="${enableval}"],
[login_prompt="default"])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_STAT
AC_HEADER_SYS_WAIT
AC_HEADER_MAJOR
AC_CHECK_HEADERS(unistd.h syslog.h fcntl.h sys/file.h paths.h utmp.h sys/ioctl.h linux/vt.h linux/fb.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_STRUCT_TM
AC_TYPE_OFF_T
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_DECL_SYS_SIGLIST
AC_TYPE_SIGNAL
AC_STRUCT_ST_RDEV
dnl Checks for library functions.
AC_FUNC_MMAP
AC_FUNC_SETPGRP
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
dnl this test generate a warning when running autoconf/autoheader
dnl so it must be rewriten
dnl AC_FUNC_SETVBUF_REVERSED
AC_CHECK_FUNCS(putenv strdup strtol setsid gethostname uname)
if test "$glibc" != "false" ; then
AC_CHECK_FUNCS(getopt_long updwtmp login_tty)
# in glibc-2.0, login_tty is in libutil
if test "$ac_cv_func_login_tty" = "no"; then
AC_CHECK_LIB(util, login_tty)
fi
fi
if test "$ac_cv_getopt_long" = "no" ; then
LIBOBJS="$LIBOBJS getopt.o getopt1.o"
AC_SUBST(LIBOBJS)
fi
if test "$issue_file" != "default"; then
AC_DEFINE_UNQUOTED(ISSUE_FILE, "${enableval}")
fi
if test "$login_prompt" != "default"; then
AC_DEFINE_UNQUOTED(LOGIN_PROMPT, "${enableval}")
fi
if test "$login_program" != "default"; then
AC_DEFINE_UNQUOTED(LOGIN_PROGRAM, "${enableval}")
fi
if test "$debug" = "true"; then
AC_DEFINE(FB_GETTY_DEBUG)
fi
if test "$frame_buffer" != "false"; then
AC_DEFINE(USE_FRAME_BUFFER)
fi
dnl some define used for information
AC_DEFINE_UNQUOTED(TARGET_SYSTEM, "${target}")
AC_DEFINE_UNQUOTED(HOST_SYSTEM, "${host}")
AC_DEFINE_UNQUOTED(BUILD_SYSTEM, "${build}")
AC_DEFINE_UNQUOTED(BUILD_USER, "$(whoami)")
AC_DEFINE_UNQUOTED(BUILD_HOSTNAME, "$(hostname)")
dnl config header file.
AM_CONFIG_HEADER(config.h)
dnl output file
AC_OUTPUT([
Makefile \
src/Makefile \
docs/Makefile \
scripts/Makefile \
scripts/MAKEDEV.fb \
scripts/issueconv \
examples/Makefile \
packages/Makefile
],
[
if test -f scripts/MAKEDEV.fb && test -f scripts/issueconv ; then
chmod +x scripts/MAKEDEV.fb
chmod +x scripts/issueconv
fi
]
)
|