• R/O
  • SSH
  • HTTPS

avrdude: Commit


Commit MetaInfo

Revision1445 (tree)
Time2020-01-06 18:31:18
AuthorGottfried

Log Message

load correct libraries and set defines in makefile

Change Summary

Incremental Difference

--- trunk/portable/linux/config.h (revision 1444)
+++ trunk/portable/linux/config.h (revision 1445)
@@ -3,5 +3,3 @@
33 // configuration for i386 or amd64 linux
44 // Debian
55
6-#undef HAVE_HIDAPI_HIDAPI_H
7-#undef HAVE_LIBHIDAPI
--- trunk/portable/linux-arm/config.h (revision 1444)
+++ trunk/portable/linux-arm/config.h (revision 1445)
@@ -3,15 +3,11 @@
33 // configuration for amd linux
44 // Raspberry Pi
55
6-#define HAVE_LIBFTDI 1
7-#define HAVE_LIBFTDI_TYPE_232H 1
8-#define HAVE_LINUX_SPI_SPIDEV_H 1
9-#define HAVE_SPIDEV 1
6+#define HAVE_LINUX_SPI_SPIDEV_H
7+#define HAVE_SPIDEV
108
119 #undef HAVE_GETADDRINFO
12-#undef HAVE_LIBFTDI1
13-#undef HAVE_LIBHIDAPI
14-#undef HAVE_LIBWS2_32
1510 #undef HAVE_NETINET_IN_H
11+// we have linux/parport.h but raspberry pi have no native parallel port
1612 #undef HAVE_PARPORT
1713
--- trunk/portable/msvc/config.h (revision 1444)
+++ trunk/portable/msvc/config.h (revision 1445)
@@ -2,4 +2,21 @@
22
33 // configuration for vc compiler
44
5+#ifndef WIN32NATIVE
6+#define WIN32NATIVE
7+#endif
58
9+#define HAVE_LIBWS2_32
10+
11+// This we don't have for msvc
12+#undef HAVE_NETINET_IN_H
13+
14+//#define HAVE_LIBELF
15+//#define HAVE_LIBFTDI
16+//#define HAVE_LIBFTDI1
17+//#define HAVE_LIBUSB
18+//#define HAVE_LIBUSB_1_0
19+//#define HAVE_LIBHID
20+//#define HAVE_LIBHIDAPI
21+//#define HAVE_LIBPTHREAD
22+//#define HAVE_LIBREADLINE
--- trunk/Makefile (revision 1444)
+++ trunk/Makefile (revision 1445)
@@ -23,48 +23,15 @@
2323 #zusaetzliche Ausgabe Datei *.output -v
2424 YFLAGS = -t -v
2525
26-LIBELF = -lelf
27-LIBFTDI = -lftdi -lusb
28-LIBFTDI1 = -lftdi1
29-LIBHID =
30-LIBHIDAPI =
31-LIBUSB = -lusb
32-LIBUSB_1_0 = -lusb-1.0
33-LIBPTHREAD = -lpthread
34-LIPO =
3526 LEXLIB = -lfl
3627
37-ifdef HAVE_LIBELF
38-LIBS += $(LIBELF)
39-endif
40-ifdef HAVE_LIBFTDI
41-LIBS += $(LIBFTDI)
42-endif
43-ifdef HAVE_LIBFTDI1
44-LIBS += $(LIBFTDI1)
45-endif
46-ifdef HAVE_LIBUSB
47-LIBS += $(LIBUSB)
48-endif
49-ifdef HAVE_LIBUSB_1_0
50-LIBS += $(LIBUSB_1_0)
51-endif
52-ifdef HAVE_LIBPTHREAD
53-LIBS += $(LIBPTHREAD)
54-endif
28+LIBS += $(LEXLIB) $(PLATFORM_LIBS) -lm
29+CFLAGS += $(PLATFORM_CXXFLAGS) $(PLATFORM_INCLUDES)
30+CXXFLAGS += $(PLATFORM_CXXFLAGS) $(PLATFORM_INCLUDES)
5531
56-LIBS += $(LEXLIB) -lm
57-
5832 ifdef COMSPEC
5933 # Windows
60-CFLAGS += -DWIN32NATIVE
61-CXXFLAGS += -DWIN32NATIVE
6234 EXT = .exe
63-LIBS += -lws2_32 -lhidapi
64-MAKE_WINDOWS_LOADDRV = windows
65-else
66-# linux
67-#LIBS += -lreadline
6835 endif
6936
7037
@@ -94,7 +61,7 @@
9461
9562 LINK_OBJECTS = main.o
9663
97-all: printlibs depend $(TARGET) $(MAKE_WINDOWS_LOADDRV)
64+all: printlibs depend $(TARGET)
9865
9966 .PHONY: windows doc .depend
10067
--- trunk/ac_cfg.h (revision 1444)
+++ trunk/ac_cfg.h (revision 1445)
@@ -8,54 +8,6 @@
88 /* Define to 1 if you have the `gettimeofday' function. */
99 #define HAVE_GETTIMEOFDAY 1
1010
11-/* Define to 1 if you have the <inttypes.h> header file. */
12-#define HAVE_INTTYPES_H 1
13-
14-/* Define if ELF support is enabled via libelf */
15-#define HAVE_LIBELF 1
16-
17-/* Define to 1 if you have the <libelf.h> header file. */
18-#define HAVE_LIBELF_H 1
19-
20-/* Define to 1 if you have the <libelf/libelf.h> header file. */
21-#define HAVE_LIBELF_LIBELF_H 1
22-
23-/* Define if FTDI support is enabled via libftdi */
24-/* #undef HAVE_LIBFTDI */
25-
26-/* Define if FTDI support is enabled via libftdi1 */
27-#define HAVE_LIBFTDI1 1
28-
29-/* Define if libftdi supports FT232H, libftdi version >= 0.20 */
30-/* #undef HAVE_LIBFTDI_TYPE_232H */
31-
32-/* Define if HID support is enabled via the Win32 DDK */
33-/* #undef HAVE_LIBHID */
34-
35-/* Define if HID support is enabled via libhidapi */
36-#define HAVE_LIBHIDAPI 1
37-
38-/* Define to 1 if you have the `readline' library (-lreadline). */
39-/* #undef HAVE_LIBREADLINE */
40-
41-/* Define if USB support is enabled via libusb */
42-#define HAVE_LIBUSB 1
43-
44-/* Define if USB support is enabled via a libusb-1.0 compatible libusb */
45-#define HAVE_LIBUSB_1_0 1
46-
47-/* Define to 1 if you have the <libusb-1.0/libusb.h> header file. */
48-#define HAVE_LIBUSB_1_0_LIBUSB_H 1
49-
50-/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
51-#define HAVE_LIBWS2_32 1
52-
53-/* Linux sysfs GPIO support enabled */
54-#define HAVE_LINUXGPIO 1
55-
56-/* Define to 1 if you have the <lusb0_usb.h> header file. */
57-/* #undef HAVE_LUSB0_USB_H */
58-
5911 /* Define to 1 if you have the <netinet/in.h> header file. */
6012 #define HAVE_NETINET_IN_H 1
6113
@@ -62,24 +14,6 @@
6214 /* parallel port access enabled */
6315 #define HAVE_PARPORT 1
6416
65-/* Define to 1 if you have the <pthread.h> header file. */
66-#define HAVE_PTHREAD_H 1
67-
68-/* Define to 1 if you have the <stdint.h> header file. */
69-#define HAVE_STDINT_H 1
70-
71-/* Define to 1 if the system has the type `uint_t'. */
72-/* #undef HAVE_UINT_T */
73-
74-/* Define to 1 if the system has the type `ulong_t'. */
75-/* #undef HAVE_ULONG_T */
76-
77-/* Define to 1 if you have the <usb.h> header file. */
78-#define HAVE_USB_H 1
79-
80-/* Define to 1 if you have the `usleep' function. */
81-#define HAVE_USLEEP 1
82-
8317 /* Define if lex/flex has yylex_destroy */
8418 #define HAVE_YYLEX_DESTROY 1
8519
@@ -86,7 +20,4 @@
8620 /* Version number of package */
8721 #define VERSION "6.3-20171130"
8822
89-/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
90- `char[]'. */
91-#define YYTEXT_POINTER 1
9223
--- trunk/avrdude.h (revision 1444)
+++ trunk/avrdude.h (revision 1445)
@@ -45,10 +45,6 @@
4545 extern "C" {
4646 #endif
4747
48-#if !defined(HAVE_USLEEP)
49-int usleep(unsigned int us);
50-#endif
51-
5248 #if !defined(HAVE_GETTIMEOFDAY)
5349 struct timezone;
5450 int gettimeofday(struct timeval *tv, struct timezone *tz);
--- trunk/avrftdi_private.h (revision 1444)
+++ trunk/avrftdi_private.h (revision 1445)
@@ -4,15 +4,10 @@
44 #include <stdint.h>
55
66 #if defined(HAVE_LIBFTDI1) && defined(HAVE_LIBUSB_1_0)
7-# if defined(HAVE_LIBUSB_1_0_LIBUSB_H)
8-# include <libusb-1.0/libusb.h>
9-# else
10-# include <libusb.h>
11-# endif
7+# include <libusb.h>
128 # include <libftdi1/ftdi.h>
13-# undef HAVE_LIBFTDI_TYPE_232H
14-# define HAVE_LIBFTDI_TYPE_232H 1
15-#elif defined(HAVE_LIBFTDI) && defined(HAVE_USB_H)
9+# define HAVE_LIBFTDI_TYPE_232H
10+#elif defined(HAVE_LIBFTDI)
1611 /* ftdi.h includes usb.h */
1712 #include <ftdi.h>
1813 #else
--- trunk/dfu.h (revision 1444)
+++ trunk/dfu.h (revision 1445)
@@ -23,14 +23,8 @@
2323 #include "portable/arch.h"
2424
2525 #ifdef HAVE_LIBUSB
26-#if defined(HAVE_USB_H)
27-# include <usb.h>
28-#elif defined(HAVE_LUSB0_USB_H)
29-# include <lusb0_usb.h>
30-#else
31-# error "libusb needs either <usb.h> or <lusb0_usb.h>"
26+# include <usb.h>
3227 #endif
33-#endif
3428
3529 #include <limits.h>
3630
--- trunk/fileio.cpp (revision 1444)
+++ trunk/fileio.cpp (revision 1445)
@@ -28,11 +28,7 @@
2828 #include <stdint.h>
2929
3030 #ifdef HAVE_LIBELF
31-#ifdef HAVE_LIBELF_H
3231 #include <libelf.h>
33-#elif defined(HAVE_LIBELF_LIBELF_H)
34-#include <libelf/libelf.h>
35-#endif
3632 #define EM_AVR32 0x18ad /* inofficial */
3733 #endif
3834
--- trunk/flip1.cpp (revision 1444)
+++ trunk/flip1.cpp (revision 1445)
@@ -29,11 +29,7 @@
2929 #include <limits.h>
3030 #include <unistd.h>
3131
32-#if HAVE_STDINT_H
3332 #include <stdint.h>
34-#elif HAVE_INTTYPES_H
35-#include <inttypes.h>
36-#endif
3733
3834
3935 #include "avrdude.h"
--- trunk/flip2.cpp (revision 1444)
+++ trunk/flip2.cpp (revision 1445)
@@ -26,11 +26,7 @@
2626 #include <limits.h>
2727 #include <unistd.h>
2828
29-#if HAVE_STDINT_H
3029 #include <stdint.h>
31-#elif HAVE_INTTYPES_H
32-#include <inttypes.h>
33-#endif
3430
3531 #include "avrdude.h"
3632 #include "libavrdude.h"
--- trunk/ft245r.cpp (revision 1444)
+++ trunk/ft245r.cpp (revision 1445)
@@ -72,13 +72,9 @@
7272 #endif
7373
7474 #if defined(HAVE_LIBFTDI1) && defined(HAVE_LIBUSB_1_0)
75-# if defined(HAVE_LIBUSB_1_0_LIBUSB_H)
76-# include <libusb-1.0/libusb.h>
77-# else
78-# include <libusb.h>
79-# endif
75+# include <libusb.h>
8076 # include <libftdi1/ftdi.h>
81-#elif defined(HAVE_LIBFTDI) && defined(HAVE_USB_H)
77+#elif defined(HAVE_LIBFTDI)
8278 /* ftdi.h includes usb.h */
8379 #include <ftdi.h>
8480 #else
@@ -86,7 +82,7 @@
8682 #define DO_NOT_BUILD_FT245R
8783 #endif
8884
89-#ifndef HAVE_PTHREAD_H
85+#ifndef HAVE_LIBPTHREAD
9086
9187 static int ft245r_nopthread_open (struct programmer_t *pgm, char * name) {
9288 avrdude_message(MSG_INFO, "%s: error: no pthread support. Please compile again with pthread installed."
--- trunk/libavrdude.h (revision 1444)
+++ trunk/libavrdude.h (revision 1445)
@@ -27,16 +27,8 @@
2727 #include <stdbool.h>
2828
2929 /* lets try to select at least 32 bits */
30-#ifdef HAVE_STDINT_H
3130 #include <stdint.h>
3231 typedef uint32_t pinmask_t;
33-#else
34-#if UINT_MAX >= 0xFFFFFFFF
35-typedef unsigned int pinmask_t;
36-#else
37-typedef unsigned long pinmask_t;
38-#endif
39-#endif
4032
4133
4234 /* formerly lists.h */
--- trunk/pickit2.cpp (revision 1444)
+++ trunk/pickit2.cpp (revision 1445)
@@ -65,14 +65,8 @@
6565 #endif
6666 #include <setupapi.h>
6767 #else
68-#if defined(HAVE_USB_H)
69-# include <usb.h>
70-#elif defined(HAVE_LUSB0_USB_H)
71-# include <lusb0_usb.h>
72-#else
73-# error "libusb needs either <usb.h> or <lusb0_usb.h>"
68+# include <usb.h>
7469 #endif
75-#endif
7670
7771 #if 0
7872 #define DEBUG(...) do { avrdude_message(MSG_DEBUG, __VA_ARGS__); } while(0)
--- trunk/term.cpp (revision 1444)
+++ trunk/term.cpp (revision 1445)
@@ -26,11 +26,9 @@
2626 #include <limits.h>
2727
2828 #if defined(HAVE_LIBREADLINE)
29-#if !defined(WIN32NATIVE)
3029 # include <readline/readline.h>
3130 # include <readline/history.h>
3231 #endif
33-#endif
3432
3533 #include "avrdude.h"
3634 #include "term.h"
@@ -889,7 +887,7 @@
889887
890888 char * terminal_get_input(const char *prompt)
891889 {
892-#if defined(HAVE_LIBREADLINE) && !defined(WIN32NATIVE)
890+#if defined(HAVE_LIBREADLINE)
893891 char *input;
894892 input = readline(prompt);
895893 if ((input != NULL) && (strlen(input) >= 1))
--- trunk/usb_libusb.cpp (revision 1444)
+++ trunk/usb_libusb.cpp (revision 1445)
@@ -34,13 +34,7 @@
3434 #include <sys/types.h>
3535 #include <sys/time.h>
3636
37-#if defined(HAVE_USB_H)
38-# include <usb.h>
39-#elif defined(HAVE_LUSB0_USB_H)
40-# include <lusb0_usb.h>
41-#else
42-# error "libusb needs either <usb.h> or <lusb0_usb.h>"
43-#endif
37+#include <usb.h>
4438
4539 #include "avrdude.h"
4640 #include "libavrdude.h"
--- trunk/usbasp.cpp (revision 1444)
+++ trunk/usbasp.cpp (revision 1445)
@@ -50,19 +50,9 @@
5050 #endif
5151
5252 #if defined(USE_LIBUSB_1_0)
53-# if defined(HAVE_LIBUSB_1_0_LIBUSB_H)
54-# include <libusb-1.0/libusb.h>
55-# else
56-# include <libusb.h>
57-# endif
53+# include <libusb.h>
5854 #else
59-# if defined(HAVE_USB_H)
60-# include <usb.h>
61-# elif defined(HAVE_LUSB0_USB_H)
62-# include <lusb0_usb.h>
63-# else
64-# error "libusb needs either <usb.h> or <lusb0_usb.h>"
65-# endif
55+# include <usb.h>
6656 #endif
6757
6858 #ifdef USE_LIBUSB_1_0
--- trunk/usbtiny.cpp (revision 1444)
+++ trunk/usbtiny.cpp (revision 1445)
@@ -39,13 +39,7 @@
3939 #include "usbdevs.h"
4040
4141 #if defined(HAVE_LIBUSB) // we use LIBUSB to talk to the board
42-#if defined(HAVE_USB_H)
43-# include <usb.h>
44-#elif defined(HAVE_LUSB0_USB_H)
45-# include <lusb0_usb.h>
46-#else
47-# error "libusb needs either <usb.h> or <lusb0_usb.h>"
48-#endif
42+#include <usb.h>
4943
5044 #include "tpi.h"
5145
@@ -60,15 +54,8 @@
6054 # define LITTLE_TO_BIG_16(x) ((((x) << 8) & 0xFF00) | (((x) >> 8) & 0x00FF))
6155 #endif
6256
63-#ifndef HAVE_UINT_T
64-typedef unsigned int uint_t;
65-#endif
66-#ifndef HAVE_ULONG_T
67-typedef unsigned long ulong_t;
68-#endif
69-
7057 extern int avr_write_byte_default ( PROGRAMMER* pgm, AVRPART* p,
71- AVRMEM* mem, ulong_t addr,
58+ AVRMEM* mem, unsigned long addr,
7259 unsigned char data );
7360 /*
7461 * Private data for this programmer.
Show on old repository browser