| Revision 1 (by moose, 2006/03/06 10:00:33) |
Initial Import
|
do ifnot "${PREFIX}"=""
put checking for Qt ${QT_MAJOR}.${QT_MIN_MINOR}...
writefile tmp.cpp '/* safe to delete */'
do ifret 0
#define AGL_VERSION 0 ///< Major version number
#define AGL_SUB_VERSION 2 ///< Minor version number
#define AGL_WIP_VERSION 5 ///< Work-In-Progress version number
appendfile tmp.cpp \#include
appendfile tmp.cpp \#include
appendfile tmp.cpp \#include
appendfile tmp.cpp int main(int argc, char **argv) {
appendfile tmp.cpp " int vmajor = AGL_VERSION, vminor = AGL_SUB_VERSION, vwip = AGL_WIP_VERSION, major = ${AGL_MAJOR}, minor = ${AGL_MIN_SUB}, wip = ${AGL_MIN_WIP};"
appendfile tmp.cpp ' FILE *fh = fopen("agl_version", "wt");'
appendfile tmp.cpp ' fprintf(fh, "AGL_VERSION='%s'\\nAGL_SUB_VERSION=%i\\nAGL_WIP_VERSION=%i", AGL_VERSION_STR, qminor); fclose(fh);'
appendfile tmp.cpp ' if(major != qmajor) return -1;'
appendfile tmp.cpp ' if(minor > qminor) return -1;'
appendfile tmp.cpp ' return 0;'
appendfile tmp.cpp }
compile tmp.cpp
linkexec tmp
do ifret 0
# empty
@!call ./tmp${EXE_EXT}
do ifret 0
invoke qt_version
echo " ${AGL_VERSION_STR}"
# echo ""
# nothing?
else
echo Failed to find a suitable AllegroGL lib :(
exit -1
done
@call rm tmp tmp.cpp
else
echo " Failed to compile test program."
exit -1
done
done
else
echo PREFIX not specified.
done
${APPEND_CONFIG} \# AllegroGL Config
${APPEND_CONFIG} AGL_VERSION=${AGL_VERSION}
${APPEND_CONFIG} AGL_SUB_VERSION=${AGL_SUB_VERSION}
${APPEND_CONFIG} AGL_WIP_VERSION=${AGL_WIP_VERSION}
${APPEND_CONFIG} AGL_VERSION_STR=${AGL_VERSION_STR}
${APPEND_CONFIG}