Changeset 2527 for zzuf


Ignore:
Timestamp:
Jul 15, 2008, 10:16:06 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Build on HP-UX systems: disable unsupported warning flags, define _XOPEN_SOURCE_EXTENDED where appropriate, use AC_C_INLINE to avoid using the inline keyword when unsupported, and use #pragma INIT for library initialisation routines.
Location:
zzuf/trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/Makefile.am

    r1657 r2527  
    44DIST_SUBDIRS = $(SUBDIRS)
    55
    6 EXTRA_DIST = bootstrap AUTHORS
     6EXTRA_DIST = bootstrap AUTHORS m4/cflags.m4
     7ACLOCAL_AMFLAGS = -I m4
    78AUTOMAKE_OPTIONS = foreign dist-bzip2
    89
  • zzuf/trunk/configure.ac

    r2526 r2527  
    1111AC_PROG_CPP
    1212AC_PROG_LIBTOOL
     13
     14AC_C_INLINE
     15
     16# Optimizations
     17AC_TRY_CFLAGS(-g -O2, CFLAGS="${CFLAGS} -g -O2")
     18# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
     19AC_TRY_CFLAGS(-Wall, CFLAGS="${CFLAGS} -Wall")
     20AC_TRY_CFLAGS(-W, CFLAGS="${CFLAGS} -W")
     21AC_TRY_CFLAGS(-Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare, CFLAGS="${CFLAGS} -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare")
    1322
    1423case "${host_os}" in
     
    5059AC_MSG_CHECKING(for recv() return value)
    5160ac_v_recv_t="int"
    52 AC_TRY_COMPILE([#include <sys/types.h>
    53   #include <sys/socket.h>],
     61AC_TRY_COMPILE([#define _XOPEN_SOURCE_EXTENDED
     62                #include <sys/types.h>
     63                #include <sys/socket.h>],
    5464 [ssize_t recv(int s, void *buf, size_t len, int flags);],
    5565 [ac_v_recv_t="ssize_t"])
    5666AC_MSG_RESULT($ac_v_recv_t)
    5767AC_DEFINE_UNQUOTED(RECV_T, $ac_v_recv_t, [Define to the recv() return type])
     68
     69AC_MSG_CHECKING(for pragma INIT/FINI)
     70AC_TRY_COMPILE([],
     71 [#pragma INIT "my_init"
     72  void my_init(void)],
     73 [AC_MSG_RESULT(yes)
     74  AC_DEFINE(HAVE_PRAGMA_INIT, 1, [Define to 1 if you have pragma INIT])],
     75 [AC_MSG_RESULT(no)])
    5876
    5977ac_cv_have_getopt_long="no"
     
    7492AC_SUBST(DL_LIBS)
    7593
    76 # Optimizations
    77 CFLAGS="${CFLAGS} -g -O2"
    78 # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
    79 CFLAGS="${CFLAGS} -Wall -W -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
    80 
    8194AC_OUTPUT([
    8295  Makefile
  • zzuf/trunk/src/lib-fd.c

    r2340 r2527  
    2626/* Use this to get lseek64() on glibc systems */
    2727#define _LARGEFILE64_SOURCE
     28/* Use this to get proper prototypes on HP-UX systems */
     29#define _XOPEN_SOURCE_EXTENDED
    2830
    2931#if defined HAVE_STDINT_H
  • zzuf/trunk/src/libzzuf.c

    r2354 r2527  
    4949
    5050/* Library initialisation shit */
     51#if defined __GNUC__
    5152void _zz_init(void) __attribute__((constructor));
    5253void _zz_fini(void) __attribute__((destructor));
     54#elif defined HAVE_PRAGMA_INIT
     55#   pragma INIT "_zz_init"
     56#   pragma FINI "_zz_fini"
     57#endif
     58
    5359#if defined HAVE_WINDOWS_H
    5460BOOL WINAPI DllMain(HINSTANCE, DWORD, PVOID);
Note: See TracChangeset for help on using the changeset viewer.