From 4e5939be6a4bccc9e55dacfc551c11e0d6b41e10 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Tue, 11 Mar 2003 10:43:50 +0000 Subject: [PATCH] 2003-03-11 Marcel Telka * configure.ac: Improved openwince include package detection. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@390 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 4 ++++ jtag/autogen.sh | 2 +- jtag/configure.ac | 22 ++++++++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 1f049eb6..e6f9f89b 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,7 @@ +2003-03-11 Marcel Telka + + * configure.ac: Improved openwince include package detection. + 2003-03-07 Marcel Telka * src/lib/getdelim.c: Added unistd.h include for ssize_t. diff --git a/jtag/autogen.sh b/jtag/autogen.sh index 94db3e6d..dc57579d 100755 --- a/jtag/autogen.sh +++ b/jtag/autogen.sh @@ -33,4 +33,4 @@ else exit 1 fi -./configure --enable-maintainer-mode --with-include=/usr/local/include/openwince +./configure --enable-maintainer-mode diff --git a/jtag/configure.ac b/jtag/configure.ac index df090830..d1651e47 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -55,12 +55,26 @@ AM_GNU_GETTEXT_VERSION(0.11.5) AC_PROG_CC AC_PROG_RANLIB -AC_SUBST(OPENWINCE_INC) AC_ARG_WITH(include, AC_HELP_STRING([--with-include=PATH], [Path to the openwince includes]), - openwince_inc="$withval", - openwince_inc="/usr/include/openwince") -OPENWINCE_INC="-I$openwince_inc -I$openwince_inc/device" + openwince_inc="$withval") + +AC_CACHE_CHECK([for the openwince includes], openwince_includes_path, [ + openwince_includes_path="no" + for openwince_include in $openwince_inc /usr/include/openwince /usr/local/include/openwince; do + if test -f "$openwince_include/common.h"; then + openwince_includes_path="$openwince_include" + break + fi + done +]) + +if test "$openwince_includes_path" = "no"; then + AC_MSG_ERROR([The openwince include package not found.]) +fi + +AC_SUBST(OPENWINCE_INC) +OPENWINCE_INC="-I$openwince_includes_path -I$openwince_includes_path/device" AC_SEARCH_LIBS([ioperm], [ioperm]) AC_CHECK_FUNCS(getline getdelim)