9
0
Fork 0

configure.sh now will ignore appconfig files if CONFIG_NUTTX_NEWCONFIG is defined

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5080 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-09-03 15:16:32 +00:00
parent 06390e88a0
commit 7a6743a870
2 changed files with 45 additions and 2 deletions

View File

@ -115,6 +115,18 @@ if [ ! -r "${configpath}/defconfig" ]; then
exit 6
fi
# Extract values needed from the defconfig file. We need:
# (1) The CONFIG_NUTTX_NEWCONFIG setting to know if this is a "new" style
# configuration, and
# (2) The CONFIG_APPS_DIR to see if there is a configured location for the
# application directory.
newconfig=`grep CONFIG_NUTTX_NEWCONFIG= "${configpath}/defconfig" | cut -d'=' -f2`
if [ -z "${appdir}" ]; then
appdir=`grep CONFIG_APPS_DIR= "${configpath}/defconfig" | cut -d'=' -f2`
fi
# Check for the apps/ dir in the usual place if appdir was not provided
if [ -z "${appdir}" ]; then
@ -150,9 +162,11 @@ chmod 755 "${TOPDIR}/setenv.sh"
install -C "${configpath}/defconfig" "${TOPDIR}/.configX" || \
{ echo "Failed to copy ${configpath}/defconfig" ; exit 9 ; }
# Copy option appconfig
# Copy appconfig file. The appconfig file will be copied to ${appdir}/.config
# if both (1) ${appdir} is defined and (2) we are not using the new configuration
# (which does not require a .config file in the appsdir.
if [ ! -z "${appdir}" ]; then
if [ ! -z "${appdir}" -a "X${newconfig}" != "Xy" ]; then
if [ ! -r "${configpath}/appconfig" ]; then
echo "NOTE: No readable appconfig file found in ${configpath}"
else

View File

@ -67,17 +67,27 @@ int g_lineno;
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: skip_space
****************************************************************************/
static char *skip_space(char *ptr)
{
while (*ptr && isspace((int)*ptr)) ptr++;
return ptr;
}
/****************************************************************************
* Name: copy_parm
****************************************************************************/
static char *copy_parm(char *src, char *dest)
{
char *start = src;
int i;
/* De-quote the parameter and copy it into the parameter array */
for (i = 0; i < MAX_PARMSIZE; i++)
{
if (*src == '"')
@ -100,6 +110,10 @@ static char *copy_parm(char *src, char *dest)
exit(3);
}
/****************************************************************************
* Name: find_parm
****************************************************************************/
static char *find_parm(char *ptr)
{
char *start = ptr;
@ -138,6 +152,10 @@ static char *find_parm(char *ptr)
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: read_line
****************************************************************************/
char *read_line(FILE *stream)
{
char *ptr;
@ -166,6 +184,10 @@ char *read_line(FILE *stream)
}
}
/****************************************************************************
* Name: parse_csvline
****************************************************************************/
int parse_csvline(char *ptr)
{
int nparms;
@ -185,6 +207,10 @@ int parse_csvline(char *ptr)
ptr++;
nparms = 0;
/* Copy each comma-separated value in an array (stripping quotes from each
* of the values).
*/
do
{
ptr = copy_parm(ptr, &g_parm[nparms][0]);
@ -193,6 +219,8 @@ int parse_csvline(char *ptr)
}
while (ptr);
/* If debug is enabled, show what we got */
if (g_debug)
{
printf("Parameters: %d\n", nparms);
@ -201,5 +229,6 @@ int parse_csvline(char *ptr)
printf(" Parm%d: \"%s\"\n", i+1, g_parm[i]);
}
}
return nparms;
}