Commits

Andreas Tscharner committed 0501f09

Use installed libtinyxml if available (internal is fallback)

Comments (0)

Files changed (2)

 AC_CHECK_LIB(bz2, BZ2_bzlibVersion, bz2Lib_ok=yes, bz2Lib_ok=no)
 AC_CHECK_LIB(SDL, SDL_Init, SDL_ok=yes, SDL_ok=no)
 AC_CHECK_LIB(SDL_image, IMG_Init, SDLIMAGE_ok=yes, SDLIMAGE_ok=no)
+PKG_CHECK_EXISTS([tinyxml], [LRC_XML="yes"], [LRC_XML="no (using internakl)"])
 
 #
 # Check for header files
 AM_CONDITIONAL(HAVE_DOXYGEN, test "$doxy_ok" = yes)
 AM_CONDITIONAL(HAVE_ZLIB, test "$zLib_ok" = yes)
 AM_CONDITIONAL(HAVE_ALL_SDL, test "$SDL_ok" = yes && test "$SDLIMAGE_ok" = yes)
+AM_CONDITIONAL(HAVE_TINYXML, test "$LRC_XML" = yes)
 
 #
 # Check for library functions

src/compiler/Makefile.am

 
 #
 # tinyXML library in subdirectory
+if !HAVE_TINYXML
 SUBDIRS = tinyxml
+endif
 
 
 #
 
 #
 # Define C/C++ compiler flags for libraries
+TINYXML_LIBADD = -ltinyxml
+
+if HAVE_TINYXML
+TINYXML_CFLAGS =
+TINYXML_CXXFLAGS =
+TINYXML_LIBFLAGS =
+else
+TINYXML_CFLAGS = -Itinyxml
+TINYXML_CXXFLAGS = -Itinyxml
+TINYXML_LIBFLAGS = -Ltinyxml
+endif
 
 
 #
 # Define compiler flags
-AM_CFLAGS = $(DEBUG_CFLAGS) -Itinyxml
-AM_CXXFLAGS = $(DEBUG_CXXFLAGS) -std=c++0x -Itinyxml
+AM_CFLAGS = $(DEBUG_CFLAGS) $(TINYXML_CFLAGS)
+AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(TINYXML_CXXFLAGS) -std=c++0x
 
 #
 # Define main program
 
 #
 # Library flags for main program
-lrc_LDADD = -lz -lbz2 -ltinyxml
-lrc_LDFLAGS = -Ltinyxml
+lrc_LDADD = $(TINYXML_LIBADD) -lz -lbz2
+lrc_LDFLAGS = $(TINYXML_LIBFLAGS)
 
 if !NO_ENCRYPTION
 lrc_LDADD += -lcryptopp
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.