diff --git a/configure.ac b/configure.ac index 17f4dab25..7f98c26a6 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,7 @@ AC_CONFIG_MACRO_DIR([m4]) dnl don't put anythingelse before AC_PROG_CC unless checking if macro still work for clang AC_PROG_CXX(["xcrun clang++" g++]) AC_PROG_CC(["xcrun clang" gcc]) -AC_PROG_OBJC +AC_PROG_OBJC(["xcrun clang" gcc]) gl_LD_OUTPUT_DEF diff --git a/tester/Makefile.am b/tester/Makefile.am index b59c1e077..92023f78c 100644 --- a/tester/Makefile.am +++ b/tester/Makefile.am @@ -3,9 +3,14 @@ EXTRA_DIST= tester_hosts sounds images certificates rcfiles if BUILD_CUNIT_TESTS -noinst_PROGRAMS=liblinphone_tester +# there are 2 targets: liblinphonetester.la and the executable liblinphone_tester -liblinphone_tester_SOURCES= liblinphone_tester.c liblinphone_tester.h\ +liblinphonedir = $(includedir)/linphone +liblinphone_HEADERS = liblinphone_tester.h + +lib_LTLIBRARIES = liblinphonetester.la + +liblinphonetester_la_SOURCES = \ setup_tester.c \ register_tester.c \ message_tester.c \ @@ -18,31 +23,34 @@ liblinphone_tester_SOURCES= liblinphone_tester.c liblinphone_tester.h\ remote_provisioning_tester.c -AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/coreapi +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coreapi +AM_CFLAGS = $(STRICT_OPTIONS) -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) +AM_OBJCFLAGS = $(AM_CFLAGS) -LDADD=$(top_builddir)/coreapi/liblinphone.la $(BELLESIP_LIBS) $(LIBXML2_LIBS) - -AM_LDFLAGS = $(CUNIT_LIBS) - -AM_CFLAGS = $(STRICT_OPTIONS) -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) -AM_OBJCFLAGS = $(AM_CFLAGS) -DNO_XCODE - -liblinphone_tester_LDFLAGS= if BUILD_IOS -liblinphone_tester_SOURCES += liblinphonetester_ios.m liblinphonetester_ios.h -liblinphone_tester_LDFLAGS += -framework CoreFoundation -framework AudioToolbox -framework CoreAudio -framework Foundation -framework QuartzCore -framework OpenGLES -framework UIKit -framework AVFoundation -# we have to force the linker to use c-style link when mixing Obj-C and C sources, otherwise the Obj-C linker is used, which gives strange errors (UTF8?) -liblinphone_tester_LINK = $(LINK) + +#we build the liblinphonetester as a library, not as an executable, so that it is usable in XCode +liblinphonetester_la_SOURCES += liblinphonetester_ios.m liblinphonetester_ios.h +liblinphonetester_la_LDFLAGS = -framework CoreFoundation -framework AudioToolbox -framework CoreAudio -framework Foundation -framework QuartzCore -framework OpenGLES -framework UIKit -framework AVFoundation $(CUNIT_LIBS) + +else + +noinst_PROGRAMS = liblinphone_tester + +liblinphone_tester_LDFLAGS = $(CUNIT_LIBS) +liblinphone_tester_SOURCES = liblinphone_tester.c +liblinphone_tester_LDADD = $(top_builddir)/coreapi/liblinphone.la $(BELLESIP_LIBS) $(LIBXML2_LIBS) liblinphonetester.la + endif test: liblinphone_tester ./liblinphone_tester --config $(abs_srcdir) -else +else !BUILD_CUNIT_TESTS test: @echo "CUnit must be installed to be able to run the tests!" -endif +endif !BUILD_CUNIT_TESTS diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index 1f8640063..36ff30de2 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -71,11 +71,11 @@ extern int liblinphone_tester_run_tests(const char *suite_name, const char *test #endif -const char* test_domain; -const char* auth_domain; -const char* test_username; -const char* test_password; -const char* test_route; +extern const char* test_domain; +extern const char* auth_domain; +extern const char* test_username; +extern const char* test_password; +extern const char* test_route; typedef struct _stats {