Changeset 2248 for libcaca/trunk


Ignore:
Timestamp:
Feb 29, 2008, 11:29:08 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Don't use mygetopt.c in img2txt if the system has getopt_long.
  • Fix invalid pointer/int cast (Closes #39).
Location:
libcaca/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/configure.ac

    r2144 r2248  
    9292AC_CHECK_FUNCS(usleep gettimeofday)
    9393
     94ac_cv_have_getopt_long="no"
    9495AC_CHECK_FUNCS(getopt_long,
    95  [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)],
     96 [ac_cv_have_getopt_long="yes"],
    9697 [AC_CHECK_LIB(gnugetopt, getopt_long,
    97    [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
     98   [ac_cv_have_getopt_long="yes"
    9899    GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
     100if test "$ac_cv_have_getopt_long" != "no"; then
     101  AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
     102fi
     103AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
    99104AC_SUBST(GETOPT_LIBS)
    100105
  • libcaca/trunk/src/Makefile.am

    r1901 r2248  
    3030cacaserver_LDADD = ../cucul/libcucul.la
    3131
    32 img2txt_SOURCES = img2txt.c mygetopt.c mygetopt.h common-image.c common-image.h
     32img2txt_SOURCES = img2txt.c $(GETOPT) common-image.c common-image.h
    3333img2txt_LDADD = ../cucul/libcucul.la
    3434img2txt_CFLAGS = $(IMLIB2_CFLAGS)
    35 img2txt_LDFLAGS = $(IMLIB2_LIBS)
     35img2txt_LDFLAGS = $(IMLIB2_LIBS) $(GETOPT_LIBS)
    3636
    3737if USE_NETWORK
     
    4040fcntl_programs =
    4141endif
     42
     43if NEED_GETOPT_LONG
     44GETOPT = mygetopt.c mygetopt.h
     45endif
     46
  • libcaca/trunk/src/mygetopt.c

    r2225 r2248  
    1818
    1919#include "config.h"
     20#include "common.h"
    2021
    2122#if defined HAVE_STDINT_H
     
    2324#elif defined HAVE_INTTYPES_H
    2425#   include <inttypes.h>
    25 #endif
    26 
    27 /* DOS / Kernel driver */
    28 #ifndef __intptr_t_defined
    29 #ifndef _UINTPTR_T
    30 typedef unsigned int            uintptr_t;
    31 #endif
    3226#endif
    3327
Note: See TracChangeset for help on using the changeset viewer.