From 71d2db02e5572bb8319802134029cf37813b6bca Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Fri, 8 Apr 2011 15:48:59 +0800 Subject: [PATCH] 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 --- .gitignore | 3 ++- configure.ac | 30 +++++++++++++++++------------- usbboot/src/.gitignore | 1 - usbboot/src/Makefile.am | 6 ------ usbboot/src/command_line.c | 1 - usbboot/src/main.c | 18 +++++++++--------- xbboot/host-app/.gitignore | 1 - xbboot/host-app/Makefile.am | 6 ------ xbboot/host-app/host_main.c | 6 +++--- 9 files changed, 31 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 392fb8a..2c1a823 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,8 @@ /stamp-h1 /m4/ /autom4te.cache/ +/Makefile +/xburst-tools-config.h* Makefile.in -/Makefile diff --git a/configure.ac b/configure.ac index 30dbf72..f21e31d 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/usbboot/src/.gitignore b/usbboot/src/.gitignore index a85de84..47d4c32 100644 --- a/usbboot/src/.gitignore +++ b/usbboot/src/.gitignore @@ -1,3 +1,2 @@ /.deps/ -/*_version.h /usbboot diff --git a/usbboot/src/Makefile.am b/usbboot/src/Makefile.am index 41f66de..ea0f7ca 100644 --- a/usbboot/src/Makefile.am +++ b/usbboot/src/Makefile.am @@ -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 diff --git a/usbboot/src/command_line.c b/usbboot/src/command_line.c index cfc5a53..a6dd12a 100644 --- a/usbboot/src/command_line.c +++ b/usbboot/src/command_line.c @@ -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; diff --git a/usbboot/src/main.c b/usbboot/src/main.c index 9de70b5..c5a12af 100644 --- a/usbboot/src/main.c +++ b/usbboot/src/main.c @@ -21,7 +21,7 @@ #include #include #include -#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" " \n\n" - "Report bugs to .\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; diff --git a/xbboot/host-app/.gitignore b/xbboot/host-app/.gitignore index faab10b..3f0e806 100644 --- a/xbboot/host-app/.gitignore +++ b/xbboot/host-app/.gitignore @@ -2,5 +2,4 @@ host_main.o Makefile Makefile.in -xbboot_version.h xbboot diff --git a/xbboot/host-app/Makefile.am b/xbboot/host-app/Makefile.am index 6f2296e..96f91b9 100644 --- a/xbboot/host-app/Makefile.am +++ b/xbboot/host-app/Makefile.am @@ -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 diff --git a/xbboot/host-app/host_main.c b/xbboot/host-app/host_main.c index 8d8a923..c834abb 100644 --- a/xbboot/host-app/host_main.c +++ b/xbboot/host-app/host_main.c @@ -13,7 +13,7 @@ #include #include #include -#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] branch to directly\n" "\n" "- all numbers can be prefixed 0x for hex otherwise decimal\n" - "\n", XBBOOT_VERSION); + "\n", PACKAGE_VERSION); }