libimobiledevice / libusbmuxd

A client library to multiplex connections from and to iOS devices
https://libimobiledevice.org
GNU Lesser General Public License v2.1
574 stars 270 forks source link

Compile fail if older version installed #111

Open dmacks opened 3 years ago

dmacks commented 3 years ago

Equivalent cause as https://github.com/libimobiledevice/libplist/issues/185, but now it's a plain compile fail. I have libusbmuxd v1 installed, so building the new version fails beginning with:

gcc -DHAVE_CONFIG_H -I. -I..   -I/sw/include -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden -pthread -I../common -I../src -I../include -g -O2 -MT inetcat-inetcat.o -MD -MP -MF .deps/inetcat-inetcat.Tpo -c -o inetcat-inetcat.o `test -f 'inetcat.c' || echo './'`inetcat.c
inetcat.c:116:39: error: variable has incomplete type 'enum usbmux_lookup_options'
    static enum usbmux_lookup_options lookup_opts = 0;
                                      ^

because global -I/sw/include masks source-dist -I../common

dmacks commented 3 years ago

Fix here is simple. In tools/Makefile.am, change:

AM_CFLAGS = $(GLOBAL_CFLAGS) -I$(top_srcdir)/common -I$(top_srcdir)/src -I$(top_srcdir)/include

to:

AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/src -I$(top_srcdir)/include $(GLOBAL_CFLAGS)

as a side benefit, that allows you to scrap iproxy_CFLAGS and iproxy_CFLAGS altogether