ROOT v5-34-00-patches and v5-34-36 on Ubuntu 16.04

You now unconditionally define “GFAL2_API” in the “io/gfal/Module.mk” and the “io/gfal/CMakeLists.txt” files.
I don’t think this is a good idea.

This particular macro is internally used / defined by some versions of “gfal_api.h” (but not by all of them -> that’s where the problem with “io/gfal/src/TGFALFile.cxx” originated), so we should NOT redefine it (we also cannot guarantee that it will not be used in future again for different purposes).
If you want to modify the “io/gfal/Module.mk” and the “io/gfal/CMakeLists.txt” files (the way you did it), then please define another, completely new macro (using another, ROOT specific name) and then modify also the “io/gfal/src/TGFALFile.cxx” file to use this new (ROOT specific) macro INSTEAD of “GFAL2_API” (note: exactly the same changes need to be applied to the “v5-34-00-patches” and “v6-06-04” branches).
Please fix it.

Note: with your current modifications of the “io/gfal/Module.mk” file, buiding of “gfal2” on Ubuntu 14.04.4 dies with the error: [code]g++ -g -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -pthread -I/usr/include/gfal2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -D_FILE_OFFSET_BITS=64 -D_GFAL2_API_ -o io/gfal/src/TGFALFile.o -c /opt/R
OOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:77:24: error: redefinition of ‘struct stat’
#define stat64 stat
^
In file included from /usr/include/fcntl.h:68:0,
from include/TSystem.h:28,
from include/TGFALFile.h:71,
from /opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:80:
/usr/include/x86_64-linux-gnu/bits/stat.h:46:8: error: previous definition of ‘struct stat’
struct stat
^
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx: In constructor ‘TGFALFile::TGFALFile(const char*, Option_t*, const char*, Int_t)’:
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:128:11: error: ‘::gfal_access’ has not been declared
if (::gfal_access(fname, kFileExists) == 0)
^
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:129:10: error: ‘::gfal_unlink’ has not been declared
::gfal_unlink(fname);
^
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:134:18: error: ‘::gfal_access’ has not been declared
if (create && ::gfal_access(fname, kFileExists) == 0) {

(…)

/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:76:24: error: forward declaration of ‘struct TGFALSystem::GetDirEntry(void*)::dirent’
#define dirent64 dirent
^
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:425:11: note: in expansion of macro ‘dirent64’
struct dirent64 dp;
^
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx: In member function ‘virtual Int_t TGFALSystem::GetPathInfo(const char
, FileStat_t&)’:
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:448:16: error: ‘::gfal_stat’ has not been declared
if (path && ::gfal_stat64(url.GetFileAndOptions(), &sbuf) >= 0) {
^
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx: In member function ‘virtual Bool_t TGFALSystem::AccessPathName(const char*, EAccessMode)’:
/opt/ROOT/debug/v5-34-00-patches/io/gfal/src/TGFALFile.cxx:473:8: error: ‘::gfal_access’ has not been declared
if (::gfal_access(url.GetFileAndOptions(), mode) == 0)
^
make: *** [io/gfal/src/TGFALFile.o] Error 1[/code]
The brutal fix, needed for the moment, is: sed -i -e '{s/_GFAL2_API_/_KILROY_WAS_HERE_/}' `grep -r -l "_GFAL2_API_" ./`