diff options
| author | Chris Mayo <aklhfex@gmail.com> | 2019-03-21 19:53:37 +0000 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2019-03-22 13:00:46 +0100 |
| commit | 3182dfb02123ffe5708ea2dd232afa4701f11ddc (patch) | |
| tree | 80c15d5b049bf22cc3c858bdb1971ed2e15d6536 | |
| parent | 371cf6dd5de00742e4c6b6ff4465ad02bb3b2a5a (diff) | |
| download | PROJ-3182dfb02123ffe5708ea2dd232afa4701f11ddc.tar.gz PROJ-3182dfb02123ffe5708ea2dd232afa4701f11ddc.zip | |
Build: automatically enable system error messages
Define HAVE_STRERROR during configuration.
Before:
$ cs2cs +proj=latlong +to +proj=latlong dummy
<cs2cs>:
Sys errno: 2: <system mess. texts unavail.>
dummy
After:
$ cs2cs +proj=latlong +to +proj=latlong dummy
<cs2cs>:
Sys errno: 2: No such file or directory
dummy
| -rw-r--r-- | cmake/ProjConfig.cmake | 3 | ||||
| -rw-r--r-- | cmake/proj_config.cmake.in | 3 | ||||
| -rw-r--r-- | configure.ac | 1 | ||||
| -rw-r--r-- | src/apps/emess.cpp | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/cmake/ProjConfig.cmake b/cmake/ProjConfig.cmake index ada827ea..cd5a635e 100644 --- a/cmake/ProjConfig.cmake +++ b/cmake/ProjConfig.cmake @@ -24,7 +24,8 @@ check_include_files (sys/types.h HAVE_SYS_TYPES_H) check_include_files (unistd.h HAVE_UNISTD_H) check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) -CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV) +check_function_exists(localeconv HAVE_LOCALECONV) +check_function_exists(strerror HAVE_STRERROR) # check libm need on unix check_library_exists(m ceil "" HAVE_LIBM) diff --git a/cmake/proj_config.cmake.in b/cmake/proj_config.cmake.in index bbdf3249..caeb0934 100644 --- a/cmake/proj_config.cmake.in +++ b/cmake/proj_config.cmake.in @@ -22,6 +22,9 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #cmakedefine HAVE_STDLIB_H 1 +/* Define to 1 if you have the `strerror' function. */ +#cmakedefine HAVE_STRERROR 1 + /* Define to 1 if you have the <strings.h> header file. */ #cmakedefine HAVE_STRINGS_H 1 diff --git a/configure.ac b/configure.ac index d0aecf75..f35c97fe 100644 --- a/configure.ac +++ b/configure.ac @@ -219,6 +219,7 @@ CFLAGS="$save_CFLAGS $C99_MATH" AC_SEARCH_LIBS([sqrt], [m]) AC_CHECK_FUNC(localeconv, [AC_DEFINE(HAVE_LOCALECONV,1,[Define to 1 if you have localeconv])]) +AC_CHECK_FUNCS([strerror]) dnl --------------------------------------------------------------------------- dnl Check for JNI support. diff --git a/src/apps/emess.cpp b/src/apps/emess.cpp index 144e9e23..52f88aa3 100644 --- a/src/apps/emess.cpp +++ b/src/apps/emess.cpp @@ -20,6 +20,7 @@ #include <string.h> #include "proj_api.h" +#include "proj_config.h" #define EMESS_ROUTINE #include "emess.h" |
