From 3bd48376ad42f7f992078041895a3a32d37a5909 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 4 Oct 2015 15:46:05 +0100 Subject: [PATCH] Updated build system. --- source/Makefile.in | 11 +++- source/configure | 149 ++++++++++++++++++++++++++------------------ source/configure.ac | 46 +++++++++----- 3 files changed, 128 insertions(+), 78 deletions(-) diff --git a/source/Makefile.in b/source/Makefile.in index 17383a6..272370e 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -1,6 +1,6 @@ CPP=g++ STRIP=strip -CPPFLAGS=`xml2-config --cflags` `wx-config --cxxflags --libs` `curl-config --libs` -lossp-uuid++ -lmagic -lsfml-audio -lxml2 -std=c++11 @DBGOUT@ +CPPFLAGS=`xml2-config --cflags` `wx-config --cxxflags --libs` `curl-config --libs` -lmagic -lsfml-audio -lxml2 -std=c++11 @DBGOUT@ @DBGSTATUS@ XAB_OUT=xestiaab @@ -92,3 +92,12 @@ bitmaphelperobjs: $(BMCOOBJS) bitmaphelper: bitmaphelperobjs $(CPP) $(CPPFLAGS) $(BMCOOBJS) -o $(BMCO_HELP) $(BMCO_HELP) bitmaps/ + +install: + cp $(XAB_OUT) @BINDIR@/$(XAB_OUT) + +uninstall: + rm @BINDIR@/$(XAB_OUT) + +docs: + @SOFFICEOUT@ diff --git a/source/configure b/source/configure index 9cc227f..5dee0e5 100755 --- a/source/configure +++ b/source/configure @@ -627,6 +627,9 @@ DBGSTATUS DBGOUT DEBUG_FALSE DEBUG_TRUE +FOUND_UUIDGEN_RES_FALSE +FOUND_UUIDGEN_RES_TRUE +FOUND_UUIDGEN FOUND_XML2CONFIG_RES_FALSE FOUND_XML2CONFIG_RES_TRUE FOUND_XML2CONFIG @@ -649,6 +652,8 @@ WX_CONFIG_PATH EGREP GREP CXXCPP +BINDIR +PREFIX CPP ac_ct_CC CFLAGS @@ -1330,7 +1335,7 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-debug Enable a debugging build + --enable-debug Enable debugging features for the build. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -3391,6 +3396,25 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Check prefix directories. + +if test "x$prefix" = "xNONE" ; then + prefix="/usr/local" +fi + +if test "x$exec_prefix" = "xNONE" ; then + exec_prefix=$prefix +fi + +PREFIX=$prefix + + +if test "x$bindir" = "xNONE" ; then + bindir="/bin" +fi +BINDIR=`eval echo $bindir` + + # Checks for libraries. # wxWidgets @@ -4188,67 +4212,6 @@ fi -# ossp-uuid Library - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lossp-uuid++" >&5 -$as_echo_n "checking for main in -lossp-uuid++... " >&6; } -if ${ac_cv_lib_ossp_uuidpp_main+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lossp-uuid++ $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_ossp_uuidpp_main=yes -else - ac_cv_lib_ossp_uuidpp_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuidpp_main" >&5 -$as_echo "$ac_cv_lib_ossp_uuidpp_main" >&6; } -if test "x$ac_cv_lib_ossp_uuidpp_main" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBOSSP_UUID__ 1 -_ACEOF - - LIBS="-lossp-uuid++ $LIBS" - -else - echo "The OSSP UUID C++ library must be installed on your system. -Please check that this library is installed properly before -running configure again." - exit -1 - -fi - - -ac_fn_cxx_check_header_mongrel "$LINENO" "ossp/uuid++.hh" "ac_cv_header_ossp_uuidpp_hh" "$ac_includes_default" -if test "x$ac_cv_header_ossp_uuidpp_hh" = xyes; then : - -else - echo "The OSSP UUID C++ library headers must be installed on your system. -Please check that the library headers are installed properly -before running configure again." - exit -1 - -fi - - - ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4497,6 +4460,64 @@ variable before running configure again." fi +# uuidgen application + +# Extract the first word of "uuidgen", so it can be a program name with args. +set dummy uuidgen; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_FOUND_UUIDGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$FOUND_UUIDGEN"; then + ac_cv_prog_FOUND_UUIDGEN="$FOUND_UUIDGEN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_FOUND_UUIDGEN="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_FOUND_UUIDGEN" && ac_cv_prog_FOUND_UUIDGEN="no" +fi +fi +FOUND_UUIDGEN=$ac_cv_prog_FOUND_UUIDGEN +if test -n "$FOUND_UUIDGEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOUND_UUIDGEN" >&5 +$as_echo "$FOUND_UUIDGEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$FOUND_UUIDGEN = xyes; then + FOUND_UUIDGEN_RES_TRUE= + FOUND_UUIDGEN_RES_FALSE='#' +else + FOUND_UUIDGEN_RES_TRUE='#' + FOUND_UUIDGEN_RES_FALSE= +fi + + +if test -z "$FOUND_UUIDGEN_RES_TRUE"; then : + else + echo "Cannot find the uuidgen program on your system. +If it is installed on your system, adjust your PATH environment +variable before running configure again." + exit -1 + +fi + # Checks for header files. for ac_header in stdlib.h string.h iostream iomanip ios algorithm map vector utility do : @@ -4846,6 +4867,10 @@ if test -z "${FOUND_XML2CONFIG_RES_TRUE}" && test -z "${FOUND_XML2CONFIG_RES_FAL as_fn_error $? "conditional \"FOUND_XML2CONFIG_RES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${FOUND_UUIDGEN_RES_TRUE}" && test -z "${FOUND_UUIDGEN_RES_FALSE}"; then + as_fn_error $? "conditional \"FOUND_UUIDGEN_RES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/source/configure.ac b/source/configure.ac index 6e792d3..16eb213 100644 --- a/source/configure.ac +++ b/source/configure.ac @@ -13,6 +13,25 @@ AC_PROG_CXX AC_PROG_CC AC_PROG_CPP +# Check prefix directories. + +if test "x$prefix" = "xNONE" ; then + prefix="/usr/local" +fi + +if test "x$exec_prefix" = "xNONE" ; then + exec_prefix=$prefix +fi + +PREFIX=$prefix +AC_SUBST([PREFIX]) + +if test "x$bindir" = "xNONE" ; then + bindir="/bin" +fi +BINDIR=`eval echo $bindir` +AC_SUBST([BINDIR]) + # Checks for libraries. # wxWidgets @@ -63,20 +82,6 @@ before running configure again." exit -1 ]) -# ossp-uuid Library - -AC_CHECK_LIB([ossp-uuid++], [main], [], [echo "The OSSP UUID C++ library must be installed on your system. -Please check that this library is installed properly before -running configure again." - exit -1 - ]) - -AC_CHECK_HEADER([ossp/uuid++.hh], [], [echo "The OSSP UUID C++ library headers must be installed on your system. -Please check that the library headers are installed properly -before running configure again." - exit -1 - ]) - AC_LANG_PUSH([C++]) # curl Library @@ -125,6 +130,17 @@ variable before running configure again." exit -1 ]) +# uuidgen application + +AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no]) +AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes]) + +AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system. +If it is installed on your system, adjust your PATH environment +variable before running configure again." + exit -1 + ]) + # Checks for header files. AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility]) @@ -135,7 +151,7 @@ AC_C_INLINE # Setup the debug setting. AC_ARG_ENABLE([debug], -[ --enable-debug Enable a debugging build], +[ --enable-debug Enable debugging features for the build.], [case "${enableval}" in yes) debug=true;; no) debug=false;; -- 2.39.2