1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-21 20:51:32 +02:00

update libusb-1.0 LIBS CFLAGS to configure.ac

update package version define in usbboot, xbboot
 update .gitignore
 resolve the confilict file on "config.h"

Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
Xiangfu Liu 2011-04-08 15:48:59 +08:00
parent fdbf94c903
commit 71d2db02e5
9 changed files with 31 additions and 41 deletions

3
.gitignore vendored
View File

@ -7,7 +7,8 @@
/stamp-h1
/m4/
/autom4te.cache/
/Makefile
/xburst-tools-config.h*
Makefile.in
/Makefile

View File

@ -2,10 +2,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.63)
AC_INIT([xburst-tools], [0.1])
AC_INIT([xburst-tools], [201104])
AC_CONFIG_AUX_DIR(m4)
AM_INIT_AUTOMAKE([foreign])
AM_CONFIG_HEADER([config.h])
AM_CONFIG_HEADER([xburst-tools-config.h])
AM_MAINTAINER_MODE
@ -39,17 +39,21 @@ AC_PROG_CXX
# Checks for libraries.
AC_CHECK_LIB([c], [main])
AC_CHECK_LIB([confuse], [main], [], [
echo "Error! You need to have libconfuse."
echo "Maybe run 'sudo apt-get install libconfuse-dev' under debian"
exit -1 ])
AC_CHECK_LIB([gcc], [main])
AC_CHECK_LIB([m], [main])
AC_CHECK_LIB([gcc], [main])
AC_CHECK_LIB([confuse], [main], [], [
echo "Error! You need to have libconfuse."
echo "Maybe run 'sudo apt-get install libconfuse-dev' under debian"
exit -1 ])
AC_CHECK_LIB([usb], [main], [], [
echo "Error! You need to have libusb-0.1. \n"
echo "Maybe run 'sudo apt-get install libusb-dev' under debian"
exit -1 ])
PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0])
echo "Error! You need to have libusb-0.1. \n"
echo "Maybe run 'sudo apt-get install libusb-dev' under debian"
exit -1 ])
PKG_CHECK_MODULES(LIBUSB, libusb-1.0 > 1.0,
[LIBS="$LIBS $LIBUSB_LIBS" CFLAGS="$CFLAGS $LIBUSB_CFLAGS"],
AC_MSG_ERROR(Maybe run 'sudo apt-get install libusb1.0-0-dev' under debian"))
AC_ARG_WITH([readline],
[AS_HELP_STRING([--with-readline],
@ -70,8 +74,8 @@ AS_IF([test "x$with_readline" != xno],
fi
], -lncurses)])
LIBS="$LIBS $USB_LIBS $READLINE_LIBS $LIBUSB1_LIBS"
CFLAGS="$CFLAGS $USB_CFLAGS $LIBUSB1_CFLAGS"
LIBS="$LIBS $USB_LIBS $READLINE_LIBS"
CFLAGS="$CFLAGS $USB_CFLAGS"
# Checks for header files.
AC_HEADER_STDC

View File

@ -1,3 +1,2 @@
/.deps/
/*_version.h
/usbboot

View File

@ -1,11 +1,5 @@
AM_CFLAGS = -pedantic -Wall -W -DCFGDIR=\"$(cfgdir)\" -DDATADIR=\"$(pkgdatadir)\"
xburst-tools_version.h:
echo -e '#ifndef XBURST_TOOLS_VERSION' \
'\n#define XBURST_TOOLS_VERSION "201103"' \
'\n#endif' > xburst-tools_version.h
BUILT_SOURCES = xburst-tools_version.h
bin_PROGRAMS = usbboot
usbboot_SOURCES = cmd.c command_line.c ingenic_cfg.c \
ingenic_usb.c main.c

View File

@ -22,7 +22,6 @@
#include "usb_boot_defines.h"
#include "ingenic_usb.h"
#include "cmd.h"
#include "xburst-tools_version.h"
extern struct nand_in nand_in;
extern struct sdram_in sdram_in;

View File

@ -21,7 +21,7 @@
#include <getopt.h>
#include <unistd.h>
#include <string.h>
#include "xburst-tools_version.h"
#include "xburst-tools-config.h"
#include "command_line.h"
#include "ingenic_usb.h"
#include "ingenic_cfg.h"
@ -43,16 +43,16 @@ static void help(void)
" -c --command\t\t\tDirect run the commands, split by ';'\n"
" \t\t\tNOTICE: the max commands count is 10!\n"
" -f --configure\t\tconfigure file path\n"
" -1 --stage1\t\tstage1 file path\n"
" -2 --stage2\t\tstage2 file path\n"
" -1 --stage1\t\t\tstage1 file path\n"
" -2 --stage2\t\t\tstage2 file path\n"
" <run without options to enter commands via usbboot prompt>\n\n"
"Report bugs to <xiangfu@sharism.cc>.\n"
"Report bugs to xiangfu@sharism.cc.\n"
);
}
static void print_version(void)
{
printf("usbboot version: %s\n", XBURST_TOOLS_VERSION);
printf("usbboot %s\n", PACKAGE_VERSION);
}
static struct option opts[] = {
@ -76,10 +76,6 @@ int main(int argc, char **argv)
stage1 = STAGE1_FILE_PATH;
stage2 = STAGE2_FILE_PATH;
printf("usbboot - Ingenic XBurst USB Boot Utility\n"
"(c) 2009 Ingenic Semiconductor Inc., Qi Hardware Inc., Xiangfu Liu, Marek Lindner\n"
"This program is Free Software and comes with ABSOLUTELY NO WARRANTY.\n\n");
while(1) {
int c, option_index = 0;
c = getopt_long(argc, argv, "hvc:f:1:2:", opts,
@ -113,6 +109,10 @@ int main(int argc, char **argv)
}
}
printf("\nusbboot version %s - Ingenic XBurst USB Boot Utility\n"
"(c) 2009 Ingenic Semiconductor Inc., Qi Hardware Inc., Xiangfu Liu, Marek Lindner\n"
"This program is Free Software and comes with ABSOLUTELY NO WARRANTY.\n\n", PACKAGE_VERSION);
if (usb_ingenic_init(&ingenic_dev) < 1)
return EXIT_FAILURE;

View File

@ -2,5 +2,4 @@
host_main.o
Makefile
Makefile.in
xbboot_version.h
xbboot

View File

@ -1,11 +1,5 @@
AM_CFLAGS = -pedantic -Wall -W -std=gnu99 -DDATADIR=\"$(pkgdatadir)\"
xbboot_version.h:
echo -e '#ifndef XBBOOT_VERSION' \
'\n#define XBBOOT_VERSION "201012"' \
'\n#endif' > xbboot_version.h
BUILT_SOURCES = xbboot_version.h
bin_PROGRAMS = xbboot
xbboot_SOURCES = host_main.c

View File

@ -13,7 +13,7 @@
#include <string.h>
#include <usb.h>
#include <time.h>
#include "xbboot_version.h"
#include "xburst-tools-config.h"
#define HIWORD(dw) (((dw) >> 16) & 0xFFFF)
#define LOWORD(dw) ((dw) & 0xFFFF)
@ -66,7 +66,7 @@ int main(int argc, char** argv)
return EXIT_SUCCESS;
}
if (!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version")) {
printf("xbboot version %s\n", XBBOOT_VERSION);
printf("xbboot version %s\n", PACKAGE_VERSION);
return EXIT_SUCCESS;
}
@ -445,5 +445,5 @@ void show_help()
" [start2 | VR_PROGRAM_START2] <addr> branch to <addr> directly\n"
"\n"
"- all numbers can be prefixed 0x for hex otherwise decimal\n"
"\n", XBBOOT_VERSION);
"\n", PACKAGE_VERSION);
}