Rework parallel port configure script option handling:

- Move AC_ARG_ENABLE for secondary parallel port options:
  - These macros cause their configure options to appear unconditionally,
    so they should not be placed inside conditional logic.
  - Groups them with primary parallel port driver option.
- Update these options to show '-' instead of '_'; both still work.
- Update command help text to show host architecture/OS requirements.
- Display a warning when these options have been provided and the
  configure script will ignore the setting that the user specified.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2104 b42882b7-edfa-0310-969c-e2dbd0fdcd60
__archive__
zwelch 2009-06-08 04:34:45 +00:00
parent 1419a72892
commit 35f7c4e478
1 changed files with 39 additions and 22 deletions

View File

@ -283,24 +283,23 @@ if test $debug_malloc = yes; then
fi fi
AC_ARG_ENABLE(parport,
AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
[build_parport=$enableval], [build_parport=no])
AC_ARG_ENABLE(dummy, AC_ARG_ENABLE(dummy,
AS_HELP_STRING([--enable-dummy], [Enable building the dummy port driver]), AS_HELP_STRING([--enable-dummy], [Enable building the dummy port driver]),
[build_dummy=$enableval], [build_dummy=no]) [build_dummy=$enableval], [build_dummy=no])
case "${host_cpu}" in AC_ARG_ENABLE(parport,
i?86|x86*) AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
[build_parport=$enableval], [build_parport=no])
AC_ARG_ENABLE(parport_ppdev, AC_ARG_ENABLE(parport_ppdev,
AS_HELP_STRING([--enable-parport_ppdev], [Enable use of ppdev (/dev/parportN) for parport]), AS_HELP_STRING([--disable-parport-ppdev],
[parport_use_ppdev=$enableval], [parport_use_ppdev=no]) [Disable use of ppdev (/dev/parportN) for parport (for x86 only)]),
;; [parport_use_ppdev=$enableval], [parport_use_ppdev=])
*)
parport_use_ppdev=yes AC_ARG_ENABLE(parport_giveio,
;; AS_HELP_STRING([--enable-parport-giveio],
esac [Enable use of giveio for parport (for CygWin only)]),
[parport_use_giveio=$enableval], [parport_use_giveio=])
AC_ARG_ENABLE(ft2232_libftdi, AC_ARG_ENABLE(ft2232_libftdi,
AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX]), AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX]),
@ -423,18 +422,27 @@ else
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
case "${host_cpu}" in
i?86|x86*)
;;
*)
if test x$parport_use_ppdev = xno; then
AC_MSG_WARN([--disable-parport-ppdev is not supported by the host CPU])
fi
parport_use_ppdev=yes
;;
esac
case $host in case $host in
*-cygwin*) *-cygwin*)
is_win32=yes is_win32=yes
AC_ARG_ENABLE(parport_giveio,
AS_HELP_STRING([--enable-parport_giveio], [Enable use of giveio for parport instead of ioperm]),
[parport_use_giveio=$enableval], [parport_use_giveio=no])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]),[is_mingw=yes],[is_mingw=no]) AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]),[is_mingw=yes],[is_mingw=no])
if test $is_mingw = yes; then if test $is_mingw = yes; then
AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
if test x$parport_use_giveio = xno; then
AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts])
fi
parport_use_giveio=yes parport_use_giveio=yes
is_cygwin=no is_cygwin=no
else else
@ -449,6 +457,9 @@ case $host in
is_mingw=yes is_mingw=yes
is_win32=yes is_win32=yes
if test x$parport_use_giveio = xno; then
AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts])
fi
parport_use_giveio=yes parport_use_giveio=yes
AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
@ -458,6 +469,9 @@ case $host in
*darwin*) *darwin*)
is_darwin=yes is_darwin=yes
if test x$parport_use_giveio = xyes; then
AC_MSG_WARN([--enable-parport-giveio cannot be used by Darwin hosts])
fi
parport_use_giveio=no parport_use_giveio=no
AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.]) AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.])
@ -465,6 +479,9 @@ case $host in
AC_DEFINE(IS_DARWIN, 1, [1 if building for Darwin.]) AC_DEFINE(IS_DARWIN, 1, [1 if building for Darwin.])
;; ;;
*) *)
if test x$parport_use_giveio = xyes; then
AC_MSG_WARN([--enable-parport-giveio cannot be used by ]$host[ hosts])
fi
parport_use_giveio=no parport_use_giveio=no
AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.]) AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.])
AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.]) AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.])
@ -518,13 +535,13 @@ else
AC_DEFINE(BUILD_AT91RM9200, 0, [0 if you don't want at91rm9200.]) AC_DEFINE(BUILD_AT91RM9200, 0, [0 if you don't want at91rm9200.])
fi fi
if test $parport_use_ppdev = yes; then if test x$parport_use_ppdev = xyes; then
AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.]) AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.])
else else
AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.]) AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.])
fi fi
if test $parport_use_giveio = yes; then if test x$parport_use_giveio = xyes; then
AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.]) AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.])
else else
AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.]) AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.])
@ -872,7 +889,7 @@ AM_MAINTAINER_MODE
AM_CONDITIONAL(RELEASE, test $build_release = yes) AM_CONDITIONAL(RELEASE, test $build_release = yes)
AM_CONDITIONAL(PARPORT, test $build_parport = yes) AM_CONDITIONAL(PARPORT, test $build_parport = yes)
AM_CONDITIONAL(DUMMY, test $build_dummy = yes) AM_CONDITIONAL(DUMMY, test $build_dummy = yes)
AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes) AM_CONDITIONAL(GIVEIO, test x$parport_use_giveio = xyes)
AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes) AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes)
AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes) AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes)
AM_CONDITIONAL(IOUTIL, test $build_ioutil = yes) AM_CONDITIONAL(IOUTIL, test $build_ioutil = yes)