Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (revision 35928) +++ trunk/config.h.in (revision 35929) @@ -70,6 +70,9 @@ as ~/DOT_PCB_RND/ */ #define DOT_PCB_RND "@/local/pcb/dot_pcb_rnd@" +#define PCB_LIBRND_VER_REQ_MAJOR @/local/librnd_ver_req_major@ +#define PCB_LIBRND_VER_REQ_MINOR @/local/librnd_ver_req_minor@ + #endif @] Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 35928) +++ trunk/scconfig/hooks.c (revision 35929) @@ -16,6 +16,9 @@ #define REQ_LIBRND_MAJOR 3 #define REQ_LIBRND_MINOR 1 +#define TOSTR_(x) #x +#define TOSTR(x) TOSTR_(x) + #include #include @@ -320,6 +323,8 @@ put("/local/version", version); put("/local/version_major", version_major); put("/local/apiver", apiver); + put("/local/librnd_ver_req_major", TOSTR(REQ_LIBRND_MAJOR)); + put("/local/librnd_ver_req_minor", TOSTR(REQ_LIBRND_MINOR)); printf("\n"); Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 35928) +++ trunk/src/main.c (revision 35929) @@ -469,6 +469,15 @@ rnd_main_args_t ga; + if (((rnd_api_ver & 0xFF0000) >> 16) != PCB_LIBRND_VER_REQ_MAJOR) { + fprintf(stderr, "librnd version problem: need %d.x.x but installed version is %d.x.x (major version mismatch)\n", PCB_LIBRND_VER_REQ_MAJOR, (int)(rnd_api_ver & 0xFF0000) >> 16); + exit(1); + } + if (((rnd_api_ver & 0x00FF00) >> 8) < PCB_LIBRND_VER_REQ_MINOR) { + fprintf(stderr, "librnd version problem: need >=%d.%d.x but installed version is %d.%d.x (minor version mismatch)\n", PCB_LIBRND_VER_REQ_MAJOR, PCB_LIBRND_VER_REQ_MINOR, (int)(rnd_api_ver & 0xFF0000) >> 16, (int)(rnd_api_ver & 0x00FF00) >> 8); + exit(1); + } + rnd_app.menu_file_paths = menu_file_paths; rnd_app.menu_name_fmt = menu_name_fmt; rnd_app.default_embedded_menu = rnd_hidlib_default_embedded_menu;