From: Anders F Björklund Date: Sun, 16 Sep 2018 16:28:16 +0000 (+0200) Subject: Only compile getopt_long.c when needed X-Git-Tag: v3.5~26^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5922ffcfa75a18e78c4ae75bb447b34a0d91d12b;p=thirdparty%2Fccache.git Only compile getopt_long.c when needed ISO C disallows empty translation units --- diff --git a/Makefile.in b/Makefile.in index 6f94fb015..308fd562e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -45,7 +45,7 @@ non_3pp_sources = \ generated_sources = \ src/version.c 3pp_sources = \ - src/getopt_long.c \ + @getopt_long_c@ \ src/hashtable.c \ src/hashtable_itr.c \ src/murmurhashneutral2.c \ diff --git a/configure.ac b/configure.ac index ae2c208bc..50211d85a 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,7 @@ case $host in esac AC_SUBST(extra_libs) +AC_SUBST(getopt_long_c) AC_SUBST(include_dev_mk) AC_SUBST(test_suites) AC_SUBST(disable_man) @@ -67,6 +68,10 @@ AC_CHECK_FUNCS(strtok_r) AC_CHECK_FUNCS(unsetenv) AC_CHECK_FUNCS(utimes) +if test x"$ac_cv_func_getopt_long" != x"yes"; then + getopt_long_c="src/getopt_long.c" +fi + AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [ AC_TRY_COMPILE( [#include ],