# HG changeset patch # User Olaf Wintermann # Date 1564823703 -7200 # Node ID 895bf81d3b6e18c89578b5c1cc25c5bae871d323 # Parent 6bf4c948d0baaa388c2a228c210ffc619d236aa6 add missing source changes diff -r 6bf4c948d0ba -r 895bf81d3b6e src/main/java/de/unixwork/uwproj/Dependency.java --- a/src/main/java/de/unixwork/uwproj/Dependency.java Sat Aug 03 11:02:55 2019 +0200 +++ b/src/main/java/de/unixwork/uwproj/Dependency.java Sat Aug 03 11:15:03 2019 +0200 @@ -18,10 +18,12 @@ public class Dependency { private String name; private String platform; + private String not; private List flags = new LinkedList<>(); private List pkgconfig = new LinkedList<>(); private List tests = new LinkedList<>(); + private StringBuilder make = new StringBuilder(); private boolean abortOnError = false; @@ -32,12 +34,16 @@ String name = element.getAttribute("name"); String platform = element.getAttribute("platform"); + String not = element.getAttribute("not"); if(name.length() > 0) { d.setName(name); } if(platform.length() > 0) { d.setPlatform(platform); } + if(not.length() > 0) { + d.setNotString(not); + } NodeList nodes = element.getChildNodes(); for(int i=0;i getNotList() { + List notPlatforms = new LinkedList<>(); + if(not != null) { + String[] n = not.split(","); + for(String s : n) { + notPlatforms.add(s); + } + } + return notPlatforms; + } public void setPlatform(String platform) { this.platform = platform; @@ -119,4 +143,13 @@ public List getTests() { return tests; } + + public void addMake(String m) { + make.append(m.trim()); + make.append('\n'); + } + + public String getMake() { + return make.toString(); + } } diff -r 6bf4c948d0ba -r 895bf81d3b6e src/main/java/de/unixwork/uwproj/Target.java --- a/src/main/java/de/unixwork/uwproj/Target.java Sat Aug 03 11:02:55 2019 +0200 +++ b/src/main/java/de/unixwork/uwproj/Target.java Sat Aug 03 11:15:03 2019 +0200 @@ -31,7 +31,9 @@ Target target = new Target(); String name = element.getAttribute("name"); - target.setName(name); + if(name.length() > 0) { + target.setName(name); + } NodeList nodes = element.getChildNodes(); for(int i=0;i /dev/null - if [ $? -ne 0 ]; then - break - fi - echo yes - return 0 - done - - echo no - return 1 -} -dependency_curl() +dependency_libpq() { - printf "checking for curl... " - # dependency curl platform="windows" - while true - do - if ! isplatform "windows"; then - break - fi - CFLAGS+="-I/mingw/include" - LDFLAGS+="-lcurl" - echo yes - return 0 - done - - # dependency curl platform="macos" - while true - do - if ! isplatform "macos"; then - break - fi - curl-config --cflags > /dev/null - if [ $? -eq 0 ]; then - CFLAGS+=" `curl-config --cflags`" - else - break - fi - curl-config --ldflags > /dev/null - if [ $? -eq 0 ]; then - LDFLAGS+=" `curl-config --ldflags`" - else - break - fi - echo yes - return 0 - done - - # dependency curl + printf "checking for libpq... " + # dependency libpq while true do if [ -z "PKG_CONFIG" ]; then break fi - if ! pkg-config libcurl ; then + if ! pkg-config libpq ; then break fi - CFLAGS+=" `pkg-config --cflags libcurl`" - LDFLAGS+=" `pkg-config --libs libcurl`" + CFLAGS+=" `pkg-config --cflags libpq`" + LDFLAGS+=" `pkg-config --libs libpq`" echo yes return 0 done @@ -300,104 +238,20 @@ echo no return 1 } -dependency_test() +dependency_openssl() { - printf "checking for test... " - # dependency test platform="bsd" - while true - do - if ! isplatform "bsd"; then - break - fi - if isplatform "macos"; then - break - fi - CFLAGS+="-DBSD" - echo yes - return 0 - done - - # dependency test - while true - do - CFLAGS+="-DTEST" - echo yes - return 0 - done - - echo no - return 1 -} -dependency_sqlite() -{ - printf "checking for sqlite... " - # dependency sqlite + printf "checking for openssl... " + # dependency openssl while true do if [ -z "PKG_CONFIG" ]; then break fi - if ! pkg-config sqlite3 ; then - break - fi - CFLAGS+=" `pkg-config --cflags sqlite3`" - LDFLAGS+=" `pkg-config --libs sqlite3`" - echo yes - return 0 - done - - echo no - return 1 -} -dependency_gtk2() -{ - printf "checking for gtk2... " - # dependency gtk2 - while true - do - if [ -z "PKG_CONFIG" ]; then - break - fi - if ! pkg-config gtk+-2.0 ; then + if ! pkg-config openssl ; then break fi - CFLAGS+=" `pkg-config --cflags gtk+-2.0`" - LDFLAGS+=" `pkg-config --libs gtk+-2.0`" - echo yes - return 0 - done - - echo no - return 1 -} -dependency_gtk3() -{ - printf "checking for gtk3... " - # dependency gtk3 - while true - do - if [ -z "PKG_CONFIG" ]; then - break - fi - if ! pkg-config gtk+-5.0 ; then - break - fi - CFLAGS+=" `pkg-config --cflags gtk+-5.0`" - LDFLAGS+=" `pkg-config --libs gtk+-5.0`" - echo yes - return 0 - done - - echo no - return 1 -} -dependency_deptest() -{ - printf "checking for deptest... " - # dependency deptest - while true - do - CFLAGS+="-DDEPTEST" + CFLAGS+=" `pkg-config --cflags openssl`" + LDFLAGS+=" `pkg-config --libs openssl`" echo yes return 0 done @@ -419,11 +273,6 @@ fi CFLAGS+=" `pkg-config --cflags libxml-2.0`" LDFLAGS+=" `pkg-config --libs libxml-2.0`" - cat >> $TEMP_DIR/make.mk << __EOF__ -# Dependency: libxml2 -xml = libxml2 - -__EOF__ echo yes return 0 done @@ -439,9 +288,49 @@ LDFLAGS= while true do + if ! isplatform "linux"; then + break + fi while true do + CFLAGS+="-DLINUX" + LDFLAGS+="-lpthread -ldl -lm -lldap" + + break + done + + break +done +while true +do + if ! isplatform "bsd"; then + break + fi + if isplatform "macos"; then + break + fi + while true + do + + CFLAGS+="-DBSD" + LDFLAGS+="-lpthread -lm -lldap" + + break + done + + break +done +while true +do + if ! isplatform "solaris"; then + break + fi + while true + do + + CFLAGS+="-DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" + LDFLAGS+="-lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" break done @@ -464,63 +353,6 @@ # # OPTION VALUES # -checkopt_toolkit_gtk3() -{ - VERR=0 - dependency_gtk3 - if [ $? -ne 0 ]; then - VERR=1 - fi - if [ $VERR -ne 0 ]; then - return 1 - fi - CFLAGS+=" -Da=b" - cat >> $TEMP_DIR/make.mk << __EOF__ -UIOBJ += graphics_cairo.o - -__EOF__ - return 0 -} -checkopt_toolkit_cli() -{ - VERR=0 - dependency_curl - if [ $? -ne 0 ]; then - VERR=1 - fi - dependency_test - if [ $? -ne 0 ]; then - VERR=1 - fi - if [ $VERR -ne 0 ]; then - return 1 - fi - return 0 -} -checkopt_toolkit_gtk2() -{ - VERR=0 - dependency_gtk2 - if [ $? -ne 0 ]; then - VERR=1 - fi - if [ $VERR -ne 0 ]; then - return 1 - fi - return 0 -} -checkopt_toolkit_wpf() -{ - VERR=0 - dependency_test - if [ $? -ne 0 ]; then - VERR=1 - fi - if [ $VERR -ne 0 ]; then - return 1 - fi - return 0 -} # # TARGETS @@ -529,110 +361,19 @@ CXXFLAGS= LDFLAGS= -# Target: dav +# Target CFLAGS= LDFLAGS= CXXFLAGS= -dependency_curl -if [ $? -ne 0 ]; then - DEPENDENCIES_FAILED+="curl " - ERROR=1 -fi dependency_libxml2 if [ $? -ne 0 ]; then DEPENDENCIES_FAILED+="libxml2 " ERROR=1 fi -dependency_test +dependency_openssl if [ $? -ne 0 ]; then - DEPENDENCIES_FAILED+="test " - ERROR=1 -fi - -# Option: --toolkit -if [ -z $OPT_TOOLKIT ]; then - SAVED_ERROR=$ERROR - SAVED_DEPENDENCIES_FAILED=$DEPENDENCIES_FAILED - ERROR=0 - while true - do - if isplatform "windows"; then - checkopt_toolkit_wpf - if [ $? -eq 0 ]; then - echo " toolkit: wpf" >> $TEMP_DIR/options - ERROR=0 - break - fi - fi - checkopt_toolkit_gtk3 - if [ $? -eq 0 ]; then - echo " toolkit: gtk3" >> $TEMP_DIR/options - ERROR=0 - break - fi - checkopt_toolkit_gtk2 - if [ $? -eq 0 ]; then - echo " toolkit: gtk2" >> $TEMP_DIR/options - ERROR=0 - break - fi - break - done - if [ $ERROR -ne 0 ]; then - SAVED_ERROR=1 - fi - ERROR=$SAVED_ERROR - DEPENDENCIES_FAILED=$SAVED_DEPENDENCIES_FAILED= -else - if false; then - false - elif [ $OPT_TOOLKIT = "gtk3" ]; then - echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options - checkopt_toolkit_gtk3 - if [ $? -ne 0 ]; then - ERROR=1 - fi - elif [ $OPT_TOOLKIT = "cli" ]; then - echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options - checkopt_toolkit_cli - if [ $? -ne 0 ]; then - ERROR=1 - fi - elif [ $OPT_TOOLKIT = "gtk2" ]; then - echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options - checkopt_toolkit_gtk2 - if [ $? -ne 0 ]; then - ERROR=1 - fi - elif [ $OPT_TOOLKIT = "wpf" ]; then - echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options - checkopt_toolkit_wpf - if [ $? -ne 0 ]; then - ERROR=1 - fi - fi -fi - -echo >> $TEMP_DIR/config.mk -if [[ ! -z ${CFLAGS} ]]; then - echo "DAV_CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk -fi -if [[ ! -z ${CXXFLAGS} ]]; then - echo "DAV_CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk -fi -if [[ ! -z ${LDFLAGS} ]]; then - echo "DAV_LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk -fi - -# Target -CFLAGS= -LDFLAGS= -CXXFLAGS= - -dependency_deptest -if [ $? -ne 0 ]; then - DEPENDENCIES_FAILED+="deptest " + DEPENDENCIES_FAILED+="openssl " ERROR=1 fi @@ -661,8 +402,6 @@ echo "Build Config:" echo " PREFIX: $PREFIX" echo " TOOLCHAIN: $TOOLCHAIN_NAME" -echo "Options:" -cat $TEMP_DIR/options echo cat $TEMP_DIR/config.mk $TEMP_DIR/make.mk > config.mk rm -Rf $TEMP_DIR diff -r 6bf4c948d0ba -r 895bf81d3b6e test/make/project.xml --- a/test/make/project.xml Sat Aug 03 11:02:55 2019 +0200 +++ b/test/make/project.xml Sat Aug 03 11:15:03 2019 +0200 @@ -1,81 +1,67 @@ - - -I/mingw/include - -lcurl - - - curl-config --cflags - curl-config --ldflags - - - -DBSD - - - libcurl + + + -DLINUX + -lpthread -ldl -lm -lldap + +# platform dependend source files +PLATFORM_DAEMONOBJ = event_linux.o + +# platform dependend vars +OBJ_EXT = .o +LIB_EXT = .so +APP_EXT = + - - libxml-2.0 - xml = libxml2 - - - sqlite3 - - - -DTEST - - - gtk+-5.0 - - - gtk+-2.0 - - - which qmake-qt4 + + + -DBSD + -lpthread -lm -lldap + +# platform dependend source files +PLATFORM_DAEMONOBJ = event_bsd.o + +# platform dependend vars +OBJ_EXT = .o +LIB_EXT = .so +APP_EXT = + - - -DDEPTEST + + -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS + -lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap + +# platform dependend source files +PLATFORM_DAEMONOBJ = event_solaris.o + +# platform dependend vars +OBJ_EXT = .o +LIB_EXT = .so +APP_EXT = + - - - MVAR = 123 - MVAR += 123 + + + + libxml-2.0 - - - sqlite - - - - gtk3 - - - - curl,libxml2,test - + + openssl + + + + + libpq + - deptest + + libpq + + libxml2,openssl diff -r 6bf4c948d0ba -r 895bf81d3b6e test/make/project2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/make/project2.xml Sat Aug 03 11:15:03 2019 +0200 @@ -0,0 +1,81 @@ + + + + -I/mingw/include + -lcurl + + + curl-config --cflags + curl-config --ldflags + + + -DBSD + + + libcurl + + + libxml-2.0 + xml = libxml2 + + + sqlite3 + + + -DTEST + + + gtk+-5.0 + + + gtk+-2.0 + + + which qmake-qt4 + + + + -DDEPTEST + + + + MVAR = 123 + MVAR += 123 + + + + + sqlite + + + + gtk3 + + + + curl,libxml2,test + + + + deptest + + +