Get rid of more autotoolsisms.
Change-Id: I124732adf3c3da511c206932544b4d533404cfc5 Reviewed-on: https://code.wireshark.org/review/27332 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
ec5af355d3
commit
8db1616ec3
|
@ -1418,8 +1418,6 @@ endif()
|
||||||
include(gmxTestLargeFiles)
|
include(gmxTestLargeFiles)
|
||||||
gmx_test_large_files(GMX_LARGEFILES)
|
gmx_test_large_files(GMX_LARGEFILES)
|
||||||
|
|
||||||
add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" )
|
|
||||||
|
|
||||||
if (${GIT_EXECUTABLE})
|
if (${GIT_EXECUTABLE})
|
||||||
set(GIT_BIN_PARAM "--git-bin ${GIT_EXECUTABLE}")
|
set(GIT_BIN_PARAM "--git-bin ${GIT_EXECUTABLE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -915,18 +915,6 @@ void wslua_init(register_cb cb, gpointer client_data) {
|
||||||
|
|
||||||
/* load system's init.lua */
|
/* load system's init.lua */
|
||||||
filename = get_datafile_path("init.lua");
|
filename = get_datafile_path("init.lua");
|
||||||
/*
|
|
||||||
* CMake will normally always succeed with get_datafile_path (see also
|
|
||||||
* comments in wslua_get_actual_filename() and get_datafile_dir()), but for
|
|
||||||
* autotools we need to look in the build directory for an autogenerated
|
|
||||||
* epan/wslua/init.lua file.
|
|
||||||
*/
|
|
||||||
if (!file_exists(filename) && running_in_build_directory()) {
|
|
||||||
g_free(filename);
|
|
||||||
filename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "epan" G_DIR_SEPARATOR_S "wslua"
|
|
||||||
G_DIR_SEPARATOR_S "init.lua", get_progfile_dir());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (( file_exists(filename))) {
|
if (( file_exists(filename))) {
|
||||||
lua_load_internal_script(filename);
|
lua_load_internal_script(filename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,9 +217,7 @@ char* wslua_get_actual_filename(const char* fname) {
|
||||||
/*
|
/*
|
||||||
* Try to look in global data directory, nothing extraordinary for normal
|
* Try to look in global data directory, nothing extraordinary for normal
|
||||||
* installations. For executions from the build dir, it will look for files
|
* installations. For executions from the build dir, it will look for files
|
||||||
* copied to DATAFILE_DIR (cmake). In case autotools was used, files were
|
* copied to DATAFILE_DIR.
|
||||||
* not copied to that directory, so the next line will return a non-existing
|
|
||||||
* file.
|
|
||||||
*/
|
*/
|
||||||
filename = get_datafile_path(fname_clean);
|
filename = get_datafile_path(fname_clean);
|
||||||
if ( file_exists(filename) ) {
|
if ( file_exists(filename) ) {
|
||||||
|
@ -227,21 +225,6 @@ char* wslua_get_actual_filename(const char* fname) {
|
||||||
}
|
}
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
|
|
||||||
/*
|
|
||||||
* Fallback for autotools: assume that this is not an autogenerated file
|
|
||||||
* (like init.lua) but something that is available in the source tree (e.g.
|
|
||||||
* epan/wslua/console.lua). Assume that get_datafile_dir() returns the path
|
|
||||||
* to the source tree (TOP_SRCDIR).
|
|
||||||
*/
|
|
||||||
if (running_in_build_directory()) {
|
|
||||||
filename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "epan" G_DIR_SEPARATOR_S "wslua"
|
|
||||||
G_DIR_SEPARATOR_S "%s", get_datafile_dir(), fname_clean);
|
|
||||||
if ( file_exists(filename) ) {
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
g_free(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -844,23 +844,10 @@ get_datafile_dir(void)
|
||||||
* if we're started with special privileges, so we need
|
* if we're started with special privileges, so we need
|
||||||
* only check it; we don't need to call started_with_special_privs().)
|
* only check it; we don't need to call started_with_special_privs().)
|
||||||
*
|
*
|
||||||
* Use the top-level source directory as the datafile directory
|
* Data files (console.lua, radius/, etc.) are copied to the build
|
||||||
* because most of our data files (radius/, COPYING) are there.
|
* directory during the build.
|
||||||
*/
|
|
||||||
#ifdef TOP_SRCDIR
|
|
||||||
/*
|
|
||||||
* When TOP_SRCDIR is defined, assume autotools where files are not
|
|
||||||
* copied to the build directory. This fallback location is relied on by
|
|
||||||
* wslua_get_actual_filename().
|
|
||||||
*/
|
|
||||||
datafile_dir = TOP_SRCDIR;
|
|
||||||
#else
|
|
||||||
/*
|
|
||||||
* Otherwise assume CMake. Here, data files (console.lua, radius/, etc.)
|
|
||||||
* are copied to the build directory during the build.
|
|
||||||
*/
|
*/
|
||||||
datafile_dir = BUILD_TIME_DATAFILE_DIR;
|
datafile_dir = BUILD_TIME_DATAFILE_DIR;
|
||||||
#endif
|
|
||||||
return datafile_dir;
|
return datafile_dir;
|
||||||
} else {
|
} else {
|
||||||
if (g_getenv("WIRESHARK_DATA_DIR") && !started_with_special_privs()) {
|
if (g_getenv("WIRESHARK_DATA_DIR") && !started_with_special_privs()) {
|
||||||
|
|
Loading…
Reference in New Issue