Andreas Tscharner avatar Andreas Tscharner committed c2db6a8

Close #3: Use installed libcrypto++ if available (internal is fallback)

Comments (0)

Files changed (4)

 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)"])
+PKG_CHECK_EXISTS([tinyxml], [TINYXML_ok="yes"], [TINYXML_ok="no (using internal)"])
+PKG_CHECK_EXISTS([libcryptopp], [CRYPTOPP_ok="yes"], [CRYPTOPP_ok="no (using internal)"])
+PKG_CHECK_EXISTS([libcrypto++], [PPCRYPTO_ok="yes"], [PPCRYPTO_ok="no (using internal)"])
 
 #
 # 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)
+AM_CONDITIONAL(HAVE_TINYXML, test "$TINYXML_ok" = yes)
+AM_CONDITIONAL(HAVE_CRYPTOPP, test "$CRYPTOPP_ok" = yes || test "$PPCRYPTO_ok" = yes)
 
 #
 # Check for library functions

src/compiler/Makefile.am

 #
 # Define C/C++ compiler flags for libraries
 TINYXML_LIBADD = -ltinyxml
-
 if HAVE_TINYXML
 TINYXML_CFLAGS =
 TINYXML_CXXFLAGS =
 TINYXML_LIBFLAGS = -Ltinyxml
 endif
 
+if NO_ENCRYPTION
+CRYPTOPP_LIBADD=
+else
+CRYPTOPP_LIBADD = -lcryptopp
+if HAVE_CRYPTOPP
+CRYPTOPP_LIBFLAGS=
+else
+CRYPTOPP_LIBFLAGS = -L../strategies/cryptopp
+endif
+endif
+
 
 #
 # Define compiler flags
 
 #
 # Library flags for main program
-lrc_LDADD = $(TINYXML_LIBADD) -lz -lbz2
-lrc_LDFLAGS = $(TINYXML_LIBFLAGS)
-
-if !NO_ENCRYPTION
-lrc_LDADD += -lcryptopp
-lrc_LDFLAGS += -L../strategies/cryptopp
-endif
+lrc_LDADD = $(TINYXML_LIBADD) $(CRYPTOPP_LIBADD) -lz -lbz2
+lrc_LDFLAGS = $(TINYXML_LIBFLAGS) $(CRYPTOPP_LIBFLAGS)

src/lib/Makefile.am

 
 #
 # Define C/C++ compiler flags for libraries
+if NO_ENCRYPTION
+CRYPTOPP_LIBADD=
+else
+CRYPTOPP_LIBADD = -lcryptopp
+if HAVE_CRYPTOPP
+CRYPTOPP_LIBFLAGS=
+else
+CRYPTOPP_LIBFLAGS = -L../strategies/cryptopp
+endif
+endif
 
 
 #
 
 #
 # Library flags for main program
-liblrc_la_LIBADD = -lz -lbz2
-liblrc_la_LDFLAGS = -version-info 0:0:0
-
-if !NO_ENCRYPTION
-liblrc_la_LIBADD += -lcryptopp
-liblrc_la_LDFLAGS += -L../strategies/cryptopp
-endif
+liblrc_la_LIBADD = $(CRYPTOPP_LIBADD) -lz -lbz2
+liblrc_la_LDFLAGS = $(CRYPTOPP_LIBFLAGS) -version-info 0:0:0

src/strategies/Makefile.am

 if NO_ENCRYPTION
 LIBCRYPTOPP=
 else
+if HAVE_CRYPTOPP
+LIBCRYPTOPP=
+else
 LIBCRYPTOPP=cryptopp/libcryptopp.a
 endif
+endif
 
 #
 # How to create "main" target
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.