]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Only compile getopt_long.c when needed
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 16:28:16 +0000 (18:28 +0200)
committerAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 16:28:16 +0000 (18:28 +0200)
ISO C disallows empty translation units

Makefile.in
configure.ac

index 6f94fb015f8bde54b02f6a95952dda3fc0ca3341..308fd562e9cfd06e45375e12ccb01b401990fe39 100644 (file)
@@ -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 \
index ae2c208bc034e44876797de8a99f0d7e4176664c..50211d85a69d92ac717cb1afeeb52fcf81d91f70 100644 (file)
@@ -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 <stdlib.h>],