Put the optional objects in EXTRA..SOURCES instead of EXTRA_DIST.
authorJeff Morriss <jeff.morriss@ulticom.com>
Sat, 29 May 2010 03:33:28 +0000 (03:33 -0000)
committerJeff Morriss <jeff.morriss@ulticom.com>
Sat, 29 May 2010 03:33:28 +0000 (03:33 -0000)
Put the optional objects in a _DEPENDENCIES rule so they actually get built
when needed.

Use libtool to make these objects.  Remove AC variables that are no longer
needed.

svn path=/trunk/; revision=33017

configure.in
wsutil/CMakeLists.txt
wsutil/Makefile.am

index e81ffa3cef6f71e6602fd5addfa121ca671fcc23..ffd5dd8d3a5c956c567a87681a4f9cf5f09ffb5a 100644 (file)
@@ -1550,63 +1550,44 @@ AC_C_BIGENDIAN
 # XXX - do we need this?
 AC_PROG_GCC_TRADITIONAL
 
-GETOPT_C=""
-GETOPT_O=""
+GETOPT_LO=""
 AC_CHECK_FUNC(getopt,
-  [GETOPT_O=""
+  [GETOPT_LO=""
    AC_DEFINE(HAVE_GETOPT_H, 1, [Define to 1 if you have the <getopt.h> header file.])
   ],
-  GETOPT_O="wsgetopt.o"
+  GETOPT_LO="wsgetopt.lo"
 )
 if test "$ac_cv_func_getopt" = no ; then
-  GETOPT_C="wsgetopt.c"
-  GETOPT_O="wsgetopt.o"
+  GETOPT_LO="wsgetopt.lo"
 fi
-AC_SUBST(GETOPT_C)
-AC_SUBST(GETOPT_O)
+AC_SUBST(GETOPT_LO)
 
-AC_CHECK_FUNC(strerror, STRERROR_O="",
-  [STRERROR_O="strerror.o"
+AC_CHECK_FUNC(strerror, STRERROR_LO="",
+  [STRERROR_LO="strerror.lo"
    AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
 ])
 if test "$ac_cv_func_strerror" = no ; then
-  STRERROR_C="strerror.c"
-  STRERROR_O="strerror.o"
+  STRERROR_LO="strerror.lo"
 fi
-AC_SUBST(STRERROR_C)
-AC_SUBST(STRERROR_O)
+AC_SUBST(STRERROR_LO)
 
-AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
-  STRNCASECMP_O="strncasecmp.o")
+AC_CHECK_FUNC(strncasecmp, STRNCASECMP_LO="",
+  STRNCASECMP_LO="strncasecmp.lo")
 if test "$ac_cv_func_strncasecmp" = no ; then
-  STRNCASECMP_C="strncasecmp.c"
-  STRNCASECMP_O="strncasecmp.o"
+  STRNCASECMP_LO="strncasecmp.lo"
 fi
-AC_SUBST(STRNCASECMP_C)
-AC_SUBST(STRNCASECMP_O)
+AC_SUBST(STRNCASECMP_LO)
 
 AC_CHECK_FUNCS(mkstemp mkdtemp)
 
-#
-# XXX - if inet_aton isn't found, the build fails, with a complaint from
-# libtool about inet_aton.lo not being a valid libtool object.  We
-# probably have to handle it - and all the other replacement functions that
-# get built into libwireshark - differently.
-#
 AC_SEARCH_LIBS(inet_aton, [socket nsl], have_inet_aton=yes,
     have_inet_aton=no)
 if test "$have_inet_aton" = no; then
-  INET_ATON_C="inet_aton.c"
-  INET_ATON_O="inet_aton.o"
   INET_ATON_LO="inet_aton.lo"
   AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
 else
-  INET_ATON_C=""
-  INET_ATON_O=""
   INET_ATON_LO=""
 fi
-AC_SUBST(INET_ATON_C)
-AC_SUBST(INET_ATON_O)
 AC_SUBST(INET_ATON_LO)
 
 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
@@ -1631,16 +1612,10 @@ have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
 have_inet_pton=no])],
 have_inet_pton=no)
 if test "$have_inet_pton" = no; then
-  INET_PTON_C="inet_pton.c"
-  INET_PTON_O="inet_pton.o"
   INET_PTON_LO="inet_pton.lo"
 else
-  INET_PTON_C=""
-  INET_PTON_O=""
   INET_PTON_LO=""
 fi
-AC_SUBST(INET_PTON_C)
-AC_SUBST(INET_PTON_O)
 AC_SUBST(INET_PTON_LO)
 
 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
@@ -1666,27 +1641,21 @@ extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
       AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
       [Define if inet_ntop() prototype exists])], [
       AC_MSG_RESULT(no)])])
-  INET_NTOP_O=""
   INET_NTOP_LO=""], [
-  INET_NTOP_C="inet_ntop.c"
-  INET_NTOP_O="inet_ntop.o"
   INET_NTOP_LO="inet_ntop.lo"
   AC_DEFINE(NEED_INET_V6DEFS_H, 1,
   [Define if inet/v6defs.h needs to be included])])
-AC_SUBST(INET_NTOP_C)
-AC_SUBST(INET_NTOP_O)
 AC_SUBST(INET_NTOP_LO)
 
-AC_CHECK_FUNC(strptime, STRPTIME_O="",
-  [STRPTIME_O="strptime.o"
+AC_CHECK_FUNC(strptime, STRPTIME_LO="",
+  [STRPTIME_LO="strptime.lo"
    AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
 ])
 if test "$ac_cv_func_strptime" = no ; then
-  STRPTIME_C="strptime.c"
-  STRPTIME_O="strptime.o"
+  STRPTIME_LO="strptime.lo"
 fi
 AC_SUBST(STRPTIME_C)
-AC_SUBST(STRPTIME_O)
+AC_SUBST(STRPTIME_LO)
 
 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
 AC_CHECK_FUNCS(issetugid)
index 4bef18437d0d936c76d16db2e80df44f4b6e2459..887396807f722e81a9bd6c2c573f6de0e4d85721 100644 (file)
@@ -29,13 +29,13 @@ IF(WIN32)
 ENDIF(WIN32)
 
 set(WSUTIL_FILES
-#              @GETOPT_O@      # wsgetopt.c
+#              @GETOPT_LO@     # wsgetopt.c
 #              @INET_ATON_LO@  # inet_aton.c
 #              @INET_NTOP_LO@  # inet_ntop.c
 #              @INET_PTON_LO@  # inet_pton.c
-#              @STRERROR_O@    # strerror.c
-#              @STRNCASECMP_O@ # strncasecmp.c
-#              @STRPTIME_O@    # strptime.c
+#              @STRERROR_LO@   # strerror.c
+#              @STRNCASECMP_LO@ # strncasecmp.c
+#              @STRPTIME_LO@   # strptime.c
   mpeg-audio.c
   privileges.c
   str_util.c
index e4d42bd6d40d74b4ed2a0849bff6d7b6b86b84eb..a813ee5ab7307a409e3e5104a4926f8bd6a232be 100644 (file)
@@ -31,12 +31,13 @@ endif
 # Optional objects that I know how to build. These will be
 # linked into libwsutil.
 wsutil_optional_objects =      \
-       @GETOPT_O@              \
-       @STRERROR_O@            \
-       @STRNCASECMP_O@         \
-       @STRPTIME_O@            \
+       @GETOPT_LO@             \
+       @INET_ATON_LO@          \
+       @INET_NTOP_LO@          \
        @INET_PTON_LO@          \
-       @INET_NTOP_LO@
+       @STRERROR_LO@           \
+       @STRNCASECMP_LO@        \
+       @STRPTIME_LO@
 
 lib_LTLIBRARIES = libwsutil.la
 
@@ -48,7 +49,20 @@ libwsutil_la_SOURCES =               \
 
 EXTRA_libwsutil_la_SOURCES=    \
        inet_aton.c             \
-       inet_aton.h
+       inet_aton.h             \
+       inet_ntop.c             \
+       inet_pton.c             \
+       inet_v6defs.h           \
+       strerror.c              \
+       strerror.h              \
+       strncasecmp.c           \
+       strptime.c              \
+       strptime.h              \
+       wsgetopt.c              \
+       wsgetopt.h
+
+libwsutil_la_DEPENDENCIES=     \
+       $(wsutil_optional_objects)
 
 libwsutil_la_LIBADD =          \
        @GLIB_LIBS@             \
@@ -59,19 +73,9 @@ EXTRA_DIST =         \
        Makefile.nmake  \
        file_util.c     \
        file_util.h     \
-       inet_ntop.c     \
-       inet_pton.c     \
-       inet_v6defs.h   \
        libwsutil.def   \
-       strerror.c      \
-       strerror.h      \
-       strncasecmp.c   \
-       strptime.c      \
-       strptime.h      \
        unicode-utils.c \
-       unicode-utils.h \
-       wsgetopt.c      \
-       wsgetopt.h
+       unicode-utils.h
 
 CLEANFILES = \
        libwsutil.a     \