autoconf provides a special macro AC_USE_SYSTEM_EXTENSIONS, which results in -D_GNU_SOURCE on glibc-based systems or -DEXTENSIONS on Solaris-based systems
Synopsis:
if g++ -I/home/pashev/build/include -I/home/pashev/build/lib/Support -I/home/pashev/llvm/include -I/home/pashev/llvm/lib/Support -D_DEBUG -include llvm/Su
pport/Solaris.h -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fn
o-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-uninitialized -Wno-missing-field-initia
lizers -c -MMD -MP -MF "/home/pashev/build/lib/Support/Release+Asserts/Path.d.tmp" -MT "/home/pashev/build/lib/Support/Release+Asserts/Path.o" -MT "/home/pa
shev/build/lib/Support/Release+Asserts/Path.d" /home/pashev/llvm/lib/Support/Path.cpp -o /home/pashev/build/lib/Support/Release+Asserts/Path.o ; \
then /usr/bin/mv -f "/home/pashev/build/lib/Support/Release+Asserts/Path.d.tmp" "/home/pashev/build/lib/Support/Release+Asserts/Path.d"; else /usr/b
in/rm "/home/pashev/build/lib/Support/Release+Asserts/Path.d.tmp"; exit 1; fi
In file included from /home/pashev/llvm/lib/Support/Path.cpp:986:0:
/home/pashev/llvm/lib/Support/Unix/Path.inc: In function ‘std::string llvm::sys::fs::getMainExecutable(const char, void)’:
/home/pashev/llvm/lib/Support/Unix/Path.inc:278:3: error: ‘Dl_info’ was not declared in this scope
/home/pashev/llvm/lib/Support/Unix/Path.inc:278:11: error: expected ‘;’ before ‘DLInfo’
/home/pashev/llvm/lib/Support/Unix/Path.inc:279:31: error: ‘DLInfo’ was not declared in this scope
/home/pashev/llvm/lib/Support/Unix/Path.inc:279:37: error: ‘dladdr’ was not declared in this scope
rm: /home/pashev/build/lib/Support/Release+Asserts/Path.d.tmp: No such file or directory
gmake[1]: *** [/home/pashev/build/lib/Support/Release+Asserts/Path.o] Error 1
In the example above DLInfo and dladdr() are not exposed on Solaris unless EXTENSIONS is defined.
Extended Description
autoconf provides a special macro AC_USE_SYSTEM_EXTENSIONS, which results in -D_GNU_SOURCE on glibc-based systems or -DEXTENSIONS on Solaris-based systems
Synopsis:
if g++ -I/home/pashev/build/include -I/home/pashev/build/lib/Support -I/home/pashev/llvm/include -I/home/pashev/llvm/lib/Support -D_DEBUG -include llvm/Su pport/Solaris.h -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fn o-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-uninitialized -Wno-missing-field-initia lizers -c -MMD -MP -MF "/home/pashev/build/lib/Support/Release+Asserts/Path.d.tmp" -MT "/home/pashev/build/lib/Support/Release+Asserts/Path.o" -MT "/home/pa shev/build/lib/Support/Release+Asserts/Path.d" /home/pashev/llvm/lib/Support/Path.cpp -o /home/pashev/build/lib/Support/Release+Asserts/Path.o ; \ then /usr/bin/mv -f "/home/pashev/build/lib/Support/Release+Asserts/Path.d.tmp" "/home/pashev/build/lib/Support/Release+Asserts/Path.d"; else /usr/b in/rm "/home/pashev/build/lib/Support/Release+Asserts/Path.d.tmp"; exit 1; fi In file included from /home/pashev/llvm/lib/Support/Path.cpp:986:0: /home/pashev/llvm/lib/Support/Unix/Path.inc: In function ‘std::string llvm::sys::fs::getMainExecutable(const char, void)’: /home/pashev/llvm/lib/Support/Unix/Path.inc:278:3: error: ‘Dl_info’ was not declared in this scope /home/pashev/llvm/lib/Support/Unix/Path.inc:278:11: error: expected ‘;’ before ‘DLInfo’ /home/pashev/llvm/lib/Support/Unix/Path.inc:279:31: error: ‘DLInfo’ was not declared in this scope /home/pashev/llvm/lib/Support/Unix/Path.inc:279:37: error: ‘dladdr’ was not declared in this scope rm: /home/pashev/build/lib/Support/Release+Asserts/Path.d.tmp: No such file or directory gmake[1]: *** [/home/pashev/build/lib/Support/Release+Asserts/Path.o] Error 1
In the example above DLInfo and dladdr() are not exposed on Solaris unless EXTENSIONS is defined.