Ignore:
Timestamp:
Feb 7, 2010, 1:22:31 AM (10 years ago)
Author:
Sam Hocevar
Message:

Move some configuration stuff from build-kernel into configure.ac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/configure.ac

    r4296 r4317  
    5555AC_MSG_RESULT($LT_SUFFIX)
    5656AC_SUBST(LT_SUFFIX)
     57
     58dnl global configuration features
     59AC_ARG_ENABLE(kernel,
     60  [  --enable-kernel         kernel mode (default no)])
    5761
    5862dnl output driver features
     
    7276  [  --enable-cocoa          Cocoa support (autodetected)])
    7377AC_ARG_ENABLE(network,
    74   [  --enable-network        Network support (autodetected)])
     78  [  --enable-network        network support (autodetected)])
    7579AC_ARG_ENABLE(vga,
    76   [  --enable-vga            VGA support (default disabled)])
     80  [  --enable-vga            VGA support for kernel mode (autodetected)])
    7781
    7882dnl language bindings
     
    103107AC_ARG_ENABLE(zzuf,
    104108  [  --enable-zzuf           use zzuf for fuzzing tests (autodetected)])
     109
     110ac_cv_my_have_kernel="no"
     111if test "${enable_kernel}" = "yes"; then
     112  ac_cv_my_have_kernel="yes"
     113  CPPFLAGS="${CPPFLAGS} -I. -D__KERNEL__ -nostdinc -include kernel/klibc.h -fno-stack-protector"
     114  CCASFLAGS="${CCASFLAGS} -I. -fno-stack-protector"
     115  CFLAGS="${CFLAGS} -fno-builtin -O0 -I. -I.. -I../caca/ -Wall -D__KERNEL__ -fno-stack-protector -m32"
     116  LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -fno-stack-protector"
     117  AC_DEFINE(USE_KERNEL, 1, Define to 1 to activate kernel mode)
     118fi
     119AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_kernel}" = "yes")
    105120
    106121AC_CHECK_HEADERS(stdio.h stdarg.h signal.h sys/ioctl.h sys/time.h endian.h unistd.h arpa/inet.h netinet/in.h winsock2.h errno.h locale.h getopt.h dlfcn.h termios.h)
     
    309324fi
    310325
    311 if test "${enable_vga}" = "yes"; then
    312   ac_cv_my_have_vga="yes"
    313   CPPFLAGS="${CPPFLAGS} -I. -D__KERNEL__ -nostdinc -include kernel/klibc.h -fno-stack-protector"
    314   CFLAGS="${CFLAGS} -fno-builtin -O2 -Wall -fno-stack-protector"
    315   CCASFLAGS="${CCASFLAGS} -I. -fno-stack-protector"
    316   LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -fno-stack-protector"
    317   AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver)
    318   CACA_DRIVERS="${CACA_DRIVERS} vga"
    319 fi
    320 AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes")
     326if test "${enable_vga}" != "no"; then
     327  if test "${ac_cv_my_have_kernel}" = "yes"; then
     328    AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver)
     329    CACA_DRIVERS="${CACA_DRIVERS} vga"
     330  elif test "${enable_vga}" = "yes"; then
     331    AC_MSG_ERROR([--enable-vga requires --enable-kernel])
     332  fi
     333fi
    321334
    322335if test "${enable_debug}" = "yes"; then
     
    359372# How to get the C99 types. See caca/caca_types.h.in for details about
    360373# the CACA_TYPES variable
    361 if test "${ac_cv_my_have_vga}" = "yes"; then
     374if test "${ac_cv_my_have_kernel}" = "yes"; then
    362375  CACA_TYPES=0
    363376else
     
    413426# Build the Java bindings?
    414427ac_cv_my_have_java="no"
    415 if test "${enable_java}" != "no"; then
     428if test "${enable_java}" != "no" -a "${ac_cv_my_have_kernel}" != "yes"; then
    416429  AC_PATH_PROG(JAVAC, javac, no)
    417430  AC_PATH_PROG(JAVAH, javah, no)
Note: See TracChangeset for help on using the changeset viewer.