From 8db1616ec382ca8eca3c6059fdfa32378a7918fb Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 4 May 2018 11:45:10 -0700 Subject: [PATCH] Get rid of more autotoolsisms. Change-Id: I124732adf3c3da511c206932544b4d533404cfc5 Reviewed-on: https://code.wireshark.org/review/27332 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- CMakeLists.txt | 2 -- epan/wslua/init_wslua.c | 12 ------------ epan/wslua/wslua_util.c | 19 +------------------ wsutil/filesystem.c | 17 ++--------------- 4 files changed, 3 insertions(+), 47 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1404cbc8f1..edaaa020ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1418,8 +1418,6 @@ endif() include(gmxTestLargeFiles) gmx_test_large_files(GMX_LARGEFILES) -add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" ) - if (${GIT_EXECUTABLE}) set(GIT_BIN_PARAM "--git-bin ${GIT_EXECUTABLE}") endif() diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index d3e8260a5c..48a5c5e38e 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -915,18 +915,6 @@ void wslua_init(register_cb cb, gpointer client_data) { /* load system's 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))) { lua_load_internal_script(filename); } diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c index ec3ee45d9a..bd706071d7 100644 --- a/epan/wslua/wslua_util.c +++ b/epan/wslua/wslua_util.c @@ -217,9 +217,7 @@ char* wslua_get_actual_filename(const char* fname) { /* * Try to look in global data directory, nothing extraordinary for normal * installations. For executions from the build dir, it will look for files - * copied to DATAFILE_DIR (cmake). In case autotools was used, files were - * not copied to that directory, so the next line will return a non-existing - * file. + * copied to DATAFILE_DIR. */ filename = get_datafile_path(fname_clean); if ( file_exists(filename) ) { @@ -227,21 +225,6 @@ char* wslua_get_actual_filename(const char* fname) { } 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; } diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 5bb03bc3f4..e76e285414 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -844,23 +844,10 @@ get_datafile_dir(void) * if we're started with special privileges, so we need * only check it; we don't need to call started_with_special_privs().) * - * Use the top-level source directory as the datafile directory - * because most of our data files (radius/, COPYING) are there. - */ -#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. + * Data files (console.lua, radius/, etc.) are copied to the build + * directory during the build. */ datafile_dir = BUILD_TIME_DATAFILE_DIR; -#endif return datafile_dir; } else { if (g_getenv("WIRESHARK_DATA_DIR") && !started_with_special_privs()) {