]> sjero.net Git - wget/commitdiff
[svn] Don't compile getopt.c on systems that already have getopt_long.
authorhniksic <devnull@localhost>
Sun, 18 Nov 2001 04:52:18 +0000 (20:52 -0800)
committerhniksic <devnull@localhost>
Sun, 18 Nov 2001 04:52:18 +0000 (20:52 -0800)
Published in <sxshersbs0w.fsf@florida.arsdigita.de>.

ChangeLog
configure.in
src/ChangeLog
src/Makefile.in
src/main.c

index faf19c311c14dd3c7012b977c2180d48883f3db9..5fc352dffb967c8a641c1cc649116e616f7a4807 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * configure.in: Check for getopt_long in libc.
+
 2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * configure.in: Check for Solaris libmd5.
index 8f1c301159047dada95b6f0379c2b1ea53e6e322..0d7f0696e17659d10a984b8fd1949a33c33ff317 100644 (file)
@@ -177,6 +177,14 @@ AC_CHECK_FUNCS(gettimeofday mktime strptime)
 AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty)
 AC_CHECK_FUNCS(uname gethostname)
 
+dnl
+dnl Check if we need to compile in getopt.c.
+dnl
+AC_CHECK_FUNC(getopt_long, [], [
+  GETOPT_OBJ='getopt$o'
+])
+AC_SUBST(GETOPT_OBJ)
+
 dnl
 dnl Checks for libraries.
 dnl
index 0c727061ffead26356031cfc81deea3b7dac7cd4..d84c6305f00615e228ff3201080059551a0d04fb 100644 (file)
@@ -1,3 +1,7 @@
+2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * Makefile.in: Conditionally compile getopt.o.
+
 2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * md5.h: Renamed to gnu-md5.h.
index b217d32a31260687518ab055136d3fcff0a94efc..78d19f151f4a540e777db554bb960262219ecde3 100644 (file)
@@ -56,13 +56,14 @@ RM = rm -f
 ETAGS = etags
 
 # Conditional compiles
-ALLOCA = @ALLOCA@
-MD5_OBJ = @MD5_OBJ@
-OPIE_OBJ = @OPIE_OBJ@
-SSL_OBJ = @SSL_OBJ@
+ALLOCA     = @ALLOCA@
+MD5_OBJ    = @MD5_OBJ@
+OPIE_OBJ   = @OPIE_OBJ@
+SSL_OBJ    = @SSL_OBJ@
+GETOPT_OBJ = @GETOPT_OBJ@
 
 OBJ = $(ALLOCA) cmpt$o connect$o cookies$o fnmatch$o ftp$o        \
-      ftp-basic$o ftp-ls$o $(OPIE_OBJ) getopt$o hash$o            \
+      ftp-basic$o ftp-ls$o $(OPIE_OBJ) $(GETOPT_OBJ) hash$o       \
       headers$o host$o html-parse$o html-url$o http$o init$o      \
       log$o main$o $(MD5_OBJ) netrc$o rbuf$o recur$o res$o        \
       retr$o safe-ctype$o snprintf$o $(SSL_OBJ) url$o             \
@@ -148,7 +149,6 @@ ftp-basic$o: wget.h utils.h rbuf.h connect.h host.h
 ftp-ls$o: wget.h utils.h ftp.h url.h
 ftp-opie$o: wget.h
 ftp$o: wget.h utils.h url.h rbuf.h retr.h ftp.h connect.h host.h fnmatch.h netrc.h
-getopt$o: wget.h getopt.h
 hash$o: wget.h utils.h hash.h
 headers$o: wget.h connect.h rbuf.h headers.h
 host$o: wget.h utils.h host.h url.h hash.h
@@ -158,7 +158,7 @@ html$o: wget.h url.h utils.h ftp.h
 http$o: wget.h utils.h url.h host.h rbuf.h retr.h headers.h cookies.h connect.h fnmatch.h netrc.h
 init$o: wget.h utils.h init.h host.h recur.h netrc.h
 log$o: wget.h utils.h
-main$o: wget.h utils.h getopt.h init.h retr.h recur.h host.h cookies.h
+main$o: wget.h utils.h init.h retr.h recur.h host.h cookies.h
 gnu-md5$o: wget.h gnu-md5.h
 mswindows$o: wget.h url.h
 netrc$o: wget.h utils.h netrc.h init.h
index d1e9cb4dd3a0ddb7fc4b927db0975ef07325fdc8..6a79e0b07e2c2ed0105d31648789e64fe5517c44 100644 (file)
@@ -45,13 +45,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "wget.h"
 #include "utils.h"
-#include "getopt.h"
 #include "init.h"
 #include "retr.h"
 #include "recur.h"
 #include "host.h"
 #include "cookies.h"
 
+/* On GNU system this will include system-wide getopt.h. */
+#include "getopt.h"
+
 #ifndef PATH_SEPARATOR
 # define PATH_SEPARATOR '/'
 #endif