<?xml?>


<gwbuild requiredVersion="5.9.0" >

  <project name="aqfinance" version="0.9.144-beta"
           so_current="0" so_age="0" so_revision="0"
           write_config_h="TRUE"
           >

    <setVar name="package">$(project_name)</setVar>
    <define name="PACKAGE" value="$(package)"  quoted="TRUE" />

    <!-- version -->
    <setVar name="AF_VERSION_STRING">$(project_vmajor).$(project_vminor).$(project_vpatchlevel)</setVar>
    <setVar name="AF_VERSION_FULL_STRING">
      $(project_vmajor).$(project_vminor).$(project_vpatchlevel).$(project_vbuild)$(project_vtag)
    </setVar>
    <define name="AF_VERSION_MAJOR"        value="$(project_vmajor)" />
    <define name="AF_VERSION_MINOR"        value="$(project_vminor)" />
    <define name="AF_VERSION_PATCHLEVEL"   value="$(project_vpatchlevel)" />
    <define name="AF_VERSION_BUILD"        value="$(project_vbuild)" />
    <define name="AF_VERSION_TAG"          value="$(project_vtag)" />
    <define name="AF_VERSION_STRING"       value="$(AF_VERSION_STRING)" quoted="TRUE" />
    <define name="AF_VERSION_FULL_STRING"  value="$(AF_VERSION_FULL_STRING)" quoted="TRUE" />
    <define name="AF_VERSION_FINTS_STRING" value="$(project_vmajor).$(project_vminor)" quoted="TRUE" />


    <!-- prefix handling -->
    <option id="prefix" type="string">
      <default>/usr/local</default>
    </option>
    <setVar name="prefix">$(option_prefix)</setVar>
    <setVar name="sysconfdir">$(option_prefix)/etc</setVar>
    <setVar name="bindir">$(option_prefix)/bin</setVar>
    <setVar name="libdir">$(option_prefix)/lib</setVar>
    <setVar name="includedir">$(option_prefix)/include</setVar>
    <setVar name="datadir">$(option_prefix)/share</setVar>
    <setVar name="localedir">$(option_prefix)/share/locale</setVar>

    <setVar name="pkglibdir">$(libdir)/$(package)</setVar>
    <setVar name="pkgincludedir">$(includedir)/$(package)</setVar>
    <setVar name="pkgdatadir">$(datadir)/$(package)</setVar>


    <!-- options -->
    <option id="enable_testcode" type="string">
      <default>TRUE</default>
      <choices>TRUE FALSE</choices>
    </option>
    <ifVarMatches name="option_enable_testcode" value="TRUE" >
      <define name="AQFINANCE_ENABLE_TESTCODE" value="1" />
    </ifVarMatches>

    <option id="local_install" type="string">
      <default>FALSE</default>
      <choices>TRUE FALSE</choices>
    </option>
    <ifVarMatches name="option_local_install" value="TRUE" >
      <define name="ENABLE_LOCAL_INSTALL" value="1" />
    </ifVarMatches>

    <option id="software_update" type="string">
      <default>FALSE</default>
      <choices>TRUE FALSE</choices>
    </option>
    <ifVarMatches name="option_software_update" value="TRUE" >
      <define name="WITH_AQUPDATER" value="1" />
    </ifVarMatches>

    <option id="packver" type="string">
      <default>$(AF_VERSION_FULL_STRING)</default>
    </option>

    <option id="debug" type="string">
      <default>TRUE</default>
      <choices>TRUE FALSE</choices>
    </option>
    <ifVarMatches name="option_debug" value="TRUE" >
      <setVar name="CFLAGS">-ggdb -O0 -Wall</setVar>
      <setVar name="CXXFLAGS">-ggdb -O0 -Wall</setVar>
    </ifVarMatches>


    <!-- paths -->
    <setVar name="aqfinance_plugin_installdir">$(pkglibdir)/plugins/$(project_so_effective)</setVar>
    <ifVarMatches name="GWBUILD_SYSTEM" value="windows" > <!-- long version of IF statement with THEN and ELSE -->
      <then>
        <define name="OS_WIN32" value="1" />
        <setVar name="aqfinance_sys_is_windows">1</setVar>
        <setVar name="aqfinance_cfg_searchdir">etc</setVar>
        <setVar name="aqfinance_locale_searchdir">share/locale</setVar>
        <setVar name="aqfinance_data_searchdir">share/aqfinance"</setVar>
        <setVar name="aqfints_datadir">share/aqfinance/backends/aqfints</setVar>
      </then>
      <else>
        <define       name="OS_POSIX" value="1" />
        <setVar       name="aqfinance_sys_is_windows">0</setVar>
        <ifVarMatches name="option_local_install"     value="TRUE" >
          <then>
            <setVar   name="aqfinance_cfg_searchdir">etc</setVar>
            <setVar   name="aqfinance_locale_searchdir">share/locale</setVar>
            <setVar   name="aqfinance_data_searchdir">share/aqfinance</setVar>
          </then>
          <else>
            <setVar name="aqfinance_cfg_searchdir">$(sysconfdir)</setVar>
            <setVar name="aqfinance_locale_searchdir">$(datadir)/locale</setVar>
            <setVar name="aqfinance_data_searchdir">$(datadir)/aqfinance</setVar>
          </else>
        </ifVarMatches>
      </else>
    </ifVarMatches>
    <define name="AF_SYS_IS_WINDOWS" value="$(aqfinance_sys_is_windows)" />


    <!-- dependencies ( pkg-config and libs) -->
    <dependencies>
      <dep id="gwenhywfar" name="gwenhywfar" minversion="5.5.1.1" required="TRUE" >
        <variables>gwengui-fox16</variables>
      </dep>
      <dep id="aqbanking"  name="aqbanking"  required="TRUE" />
      <dep id="aqdatabase" name="aqdatabase" required="TRUE">
        <variables>aqdatabase_typemakerdir</variables>
      </dep>
      <dep id="aqfoxext"  name="aqfoxext"  required="TRUE" />
      
      <dep id="gwengui_fox16" name="gwengui-fox16"    required="TRUE" />
      <dep id="fox16"      name="fox"    required="TRUE" />
      <dep id="cairo"      name="cairo"      required="TRUE" />
      <dep id="zlib" name="zlib" required="TRUE" />
    </dependencies>
  

    <checklibs>
      <lib id="gmp" name="gmp" function="__gmpz_init" />
    </checklibs>


    <!-- symbol visibility -->
    <checkCompiler>
      <arg name="has_symbol_visibility">-fvisibility=hidden</arg>
    </checkCompiler>
    
    <ifVarMatches name="has_symbol_visibility" value="TRUE" >
      <setVar name="visibility_cflags">-fvisibility=hidden</setVar>
      <define name="GCC_WITH_VISIBILITY_ATTRIBUTE" />
    </ifVarMatches>


    <checkheaders>
      locale.h libintl.h iconv.h
      fcntl.h stdlib.h string.h unistd.h
      assert.h ctype.h errno.h fcntl.h stdio.h stdlib.h string.h strings.h locale.h
      netinet/in.h signal.h
    </checkheaders>
  
  
    <checkfunctions type="c" >
      setlocale
      memmove 
      memset 
      strcasecmp 
      strdup 
      strerror 
      snprintf
    </checkfunctions>


    <checkProgs>
      <prog cmd="xgettext" id="xgettext" />
      <prog cmd="astyle"   id="astyle" />
    </checkProgs>


    <define name="LOCALEDIR"              value="$(aqfinance_locale_searchdir)" quoted="TRUE" />
    <define name="AQBANKING_DATA_DIR"     value="$(aqfinance_data_searchdir)"   quoted="TRUE" />

    <define name="OS_TYPE"                value="$(GWBUILD_SYSTEM)"             quoted="TRUE" />
    <define name="OS_SHORTNAME"           value="$(GWBUILD_SYSTEM)"             quoted="TRUE" />

    <subdirs>
      data
      src
      po
    </subdirs>


    <!-- Build with "gwbuild -B gettext-src" -->
    <ifVarMatches name="xgettext_EXISTS" value="TRUE" >
      <buildFiles name="gettext-src" auto="FALSE" >
        <input>
          <files match="*.c" />
          <files match="*.cpp" />
        </input>
  
        <output>
          aqfinance.pot
        </output>
        
        <cmd tool="$(xgettext)" checkDates="TRUE" deleteOutFileFirst="TRUE" >
          -C -c -ki18n -ktr2i18n -kI18N -kI18S -kI18N_NOOP -ktranslate -kaliasLocale -ktr -ktrUtf8
          --msgid-bugs-address=aqbanking-user@lists.aqbanking.de
          -o $(OUTPUT[0]) $(INPUT[])
        </cmd>
  
        <buildMessage>
          Extracting I18N strings into $(OUTPUT[0])
        </buildMessage>
      </buildFiles>
    </ifVarMatches>


    <!-- Build with "gwbuild -B format-src" -->
    <ifVarMatches name="astyle_EXISTS" value="TRUE" >
      <buildFiles name="format-src" auto="FALSE" >
        <input>
          <files match="*.c" />
          <files match="*.cpp" />
          <files match="*.h" />
        </input>
  
        <output>
        </output>
        
        <cmd tool="$(astyle)" checkDates="FALSE"  >
          --style=stroustrup
          -s2
          --min-conditional-indent=0
          --indent-labels
          --max-continuation-indent=80
          --pad-comma
          --pad-header
          --unpad-paren
          --align-pointer=name
          --break-closing-braces
          --break-one-line-headers
          --attach-return-type
          --convert-tabs
          --max-code-length=120
          --break-after-logical
          --preserve-date
          --suffix=none
             $(INPUT[])
        </cmd>
  
        <buildMessage>
          Formatting source files in-place.
        </buildMessage>
      </buildFiles>
    </ifVarMatches>


    <extradist>
      AUTHORS
      COPYING
      README
    </extradist>


  </project>
  
</gwbuild>

