diff -uNr ufoai-mini/configure.ac ufoai-mini-new/configure.ac --- ufoai-mini/configure.ac 2007-10-08 09:38:00 +0400 +++ ufoai-mini-new/configure.ac 2007-10-15 00:10:20 +0400 @@ -109,6 +109,7 @@ if test `echo $target_os | sed "s/\(linux\).*/\1/"` = "linux" then AC_SUBST([TARGET_OS],[linux-gnu]) + AC_SUBST([LIBDIR],[libdir]) elif test `echo $target_os | sed "s/\(freebsd\).*/\1/"` = "freebsd" then AC_SUBST([TARGET_OS],[freebsd]) diff -uNr ufoai-mini/Makefile.in ufoai-mini-new/Makefile.in --- ufoai-mini/Makefile.in 2007-10-08 09:38:00 +0400 +++ ufoai-mini-new/Makefile.in 2007-10-14 23:47:32 +0400 @@ -22,6 +22,8 @@ GAME_LIBS=@GAME_LIBS@ TOOLS_LIBS=@TOOLS_LIBS@ MASTER_LIBS=@MASTER_LIBS@ +LIBDIR=@libdir@ +CFLAGS += -DLIBDIR='"$(LIBDIR)/ufoai"' MMX=@MMX@ diff -uNr ufoai-mini/src/ports/unix/unix_main.c ufoai-mini-new/src/ports/unix/unix_main.c --- ufoai-mini/src/ports/unix/unix_main.c 2007-10-08 09:07:24 +0400 +++ ufoai-mini-new/src/ports/unix/unix_main.c 2007-10-15 00:36:08 +0400 @@ -33,9 +33,18 @@ #include #include + #include "../../common/common.h" #include "../unix/unix_glob.h" +#ifndef LIBDIR +# ifdef __x86_64__ +# define LIBDIR "/usr/lib64" +# else +# define LIBDIR "/usr/lib" +# endif +#endif + static void *game_library; const char *Sys_GetCurrentUser (void) @@ -248,29 +257,20 @@ Com_Printf("------- Loading game.%s -------\n", SHARED_EXT); /* now run through the search paths */ - path = NULL; - while (1) { - path = FS_NextPath(path); - if (!path) { - Com_Printf("LoadLibrary failed (game."SHARED_EXT")\n"); - Com_DPrintf(DEBUG_SYSTEM, "%s\n", dlerror()); - return NULL; /* couldn't find one anywhere */ - } - Com_sprintf(name, sizeof(name), "%s/game_"CPUSTRING".%s", path, SHARED_EXT); - game_library = dlopen(name, RTLD_LAZY); - if (game_library) { - Com_Printf("LoadLibrary (%s)\n", name); - break; - } else { - Com_sprintf(name, sizeof(name), "%s/game.%s", path, SHARED_EXT); - game_library = dlopen(name, RTLD_LAZY); - if (game_library) { - Com_Printf("LoadLibrary (%s)\n", name); - break; - } - } + Com_sprintf(name, sizeof(name), "%s/game.%s", LIBDIR, SHARED_EXT); + Com_Printf("------- %s/ -------\n", name); + game_library = dlopen(name, RTLD_LAZY); + if (game_library) + { + Com_Printf("LoadLibrary (%s)\n", name); } - + else + { + Com_Printf( "------- %s/ -------\n", dlerror()); + exit -1; + } + + GetGameAPI = (void *)dlsym(game_library, "GetGameAPI"); if (!GetGameAPI) { Sys_UnloadGame();