configure.sh now will ignore appconfig files if CONFIG_NUTTX_NEWCONFIG is defined
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5080 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
45ce0132db
commit
6105b42d39
@ -115,6 +115,18 @@ if [ ! -r "${configpath}/defconfig" ]; then
|
|||||||
exit 6
|
exit 6
|
||||||
fi
|
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
|
# Check for the apps/ dir in the usual place if appdir was not provided
|
||||||
|
|
||||||
if [ -z "${appdir}" ]; then
|
if [ -z "${appdir}" ]; then
|
||||||
@ -150,9 +162,11 @@ chmod 755 "${TOPDIR}/setenv.sh"
|
|||||||
install -C "${configpath}/defconfig" "${TOPDIR}/.configX" || \
|
install -C "${configpath}/defconfig" "${TOPDIR}/.configX" || \
|
||||||
{ echo "Failed to copy ${configpath}/defconfig" ; exit 9 ; }
|
{ 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
|
if [ ! -r "${configpath}/appconfig" ]; then
|
||||||
echo "NOTE: No readable appconfig file found in ${configpath}"
|
echo "NOTE: No readable appconfig file found in ${configpath}"
|
||||||
else
|
else
|
||||||
|
@ -67,17 +67,27 @@ int g_lineno;
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: skip_space
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
static char *skip_space(char *ptr)
|
static char *skip_space(char *ptr)
|
||||||
{
|
{
|
||||||
while (*ptr && isspace((int)*ptr)) ptr++;
|
while (*ptr && isspace((int)*ptr)) ptr++;
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: copy_parm
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
static char *copy_parm(char *src, char *dest)
|
static char *copy_parm(char *src, char *dest)
|
||||||
{
|
{
|
||||||
char *start = src;
|
char *start = src;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* De-quote the parameter and copy it into the parameter array */
|
||||||
|
|
||||||
for (i = 0; i < MAX_PARMSIZE; i++)
|
for (i = 0; i < MAX_PARMSIZE; i++)
|
||||||
{
|
{
|
||||||
if (*src == '"')
|
if (*src == '"')
|
||||||
@ -100,6 +110,10 @@ static char *copy_parm(char *src, char *dest)
|
|||||||
exit(3);
|
exit(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: find_parm
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
static char *find_parm(char *ptr)
|
static char *find_parm(char *ptr)
|
||||||
{
|
{
|
||||||
char *start = ptr;
|
char *start = ptr;
|
||||||
@ -138,6 +152,10 @@ static char *find_parm(char *ptr)
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: read_line
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
char *read_line(FILE *stream)
|
char *read_line(FILE *stream)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
@ -166,6 +184,10 @@ char *read_line(FILE *stream)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: parse_csvline
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
int parse_csvline(char *ptr)
|
int parse_csvline(char *ptr)
|
||||||
{
|
{
|
||||||
int nparms;
|
int nparms;
|
||||||
@ -185,6 +207,10 @@ int parse_csvline(char *ptr)
|
|||||||
ptr++;
|
ptr++;
|
||||||
nparms = 0;
|
nparms = 0;
|
||||||
|
|
||||||
|
/* Copy each comma-separated value in an array (stripping quotes from each
|
||||||
|
* of the values).
|
||||||
|
*/
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ptr = copy_parm(ptr, &g_parm[nparms][0]);
|
ptr = copy_parm(ptr, &g_parm[nparms][0]);
|
||||||
@ -193,6 +219,8 @@ int parse_csvline(char *ptr)
|
|||||||
}
|
}
|
||||||
while (ptr);
|
while (ptr);
|
||||||
|
|
||||||
|
/* If debug is enabled, show what we got */
|
||||||
|
|
||||||
if (g_debug)
|
if (g_debug)
|
||||||
{
|
{
|
||||||
printf("Parameters: %d\n", nparms);
|
printf("Parameters: %d\n", nparms);
|
||||||
@ -201,5 +229,6 @@ int parse_csvline(char *ptr)
|
|||||||
printf(" Parm%d: \"%s\"\n", i+1, g_parm[i]);
|
printf(" Parm%d: \"%s\"\n", i+1, g_parm[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nparms;
|
return nparms;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user