Skip to content

Commit

Permalink
fix again .gitignore. Added m4
Browse files Browse the repository at this point in the history
  • Loading branch information
yersinia committed Feb 6, 2012
1 parent 288250d commit 4bda850
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ LINGUAS
logs
ltconfig
ltmain.sh
*.m4
Makefile
Makefile.in
Makefile.in.in
Expand Down
55 changes: 55 additions & 0 deletions m4/p0f.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# p0f.m4 serial 1
dnl Copyright (C) Elia Pinto ([email protected])
dnl Inspired from gnulib warning.m4 and other
dnl but not from ac_archive


# p0f_AS_VAR_APPEND(VAR, VALUE)
# ----------------------------
# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it.
m4_ifdef([AS_VAR_APPEND],
[m4_copy([AS_VAR_APPEND], [p0f_AS_VAR_APPEND])],
[m4_define([p0f_AS_VAR_APPEND],
[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])

# p0f_CFLAGS_ADD(PARAMETER, [VARIABLE = P0F_CFLAGS])
# ------------------------------------------------
# Adds parameter to P0F_CFLAGS if the compiler supports it. For example,
# p0f_CFLAGS_ADD([-Wall],[P0F_CFLAGS]).
AC_DEFUN([p0f_CFLAGS_ADD],
[AS_VAR_PUSHDEF([p0f_my_cflags], [p0f_cv_warn_$1])dnl
AC_CACHE_CHECK([whether compiler handles $1], [p0f_my_cflags], [
save_CFLAGS="$CFLAGS"
CFLAGS="${CFLAGS} $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AS_VAR_SET([p0f_my_cflags], [yes])],
[AS_VAR_SET([p0f_my_cflags], [no])])
CFLAGS="$save_CFLAGS"
])
AS_VAR_PUSHDEF([p0f_cflags], m4_if([$2], [], [[P0F_CFLAGS]], [[$2]]))dnl
AS_VAR_IF([p0f_my_cflags], [yes], [p0f_AS_VAR_APPEND([p0f_cflags], [" $1"])])
AS_VAR_POPDEF([p0f_cflags])dnl
AS_VAR_POPDEF([p0f_my_cflags])dnl
m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
])

# p0f_LDFLAGS_ADD(PARAMETER, [VARIABLE = P0F_LDFLAGS])
# ------------------------------------------------
# Adds parameter to P0F_LDFLAGS if the compiler supports it. For example,
# p0f_LDFLAGS_ADD([-Wall],[P0F_LDFLAGS]).
AC_DEFUN([p0f_LDFLAGS_ADD],
[AS_VAR_PUSHDEF([p0f_my_ldflags], [p0f_cv_warn_$1])dnl
AC_CACHE_CHECK([whether compiler handles $1], [p0f_my_ldflags], [
save_LDFLAGS="$LDFLAGS"
LDFLAGS="${LDFLAGS} $1"
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AS_VAR_SET([p0f_my_ldflags], [yes])],
[AS_VAR_SET([p0f_my_ldflags], [no])])
LDFLAGS="$save_LDFLAGS"
])
AS_VAR_PUSHDEF([p0f_ldflags], m4_if([$2], [], [[P0F_LDFLAGS]], [[$2]]))dnl
AS_VAR_IF([p0f_my_ldflags], [yes], [p0f_AS_VAR_APPEND([p0f_ldflags], [" $1"])])
AS_VAR_POPDEF([p0f_ldflags])dnl
AS_VAR_POPDEF([p0f_my_ldflags])dnl
m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
])

0 comments on commit 4bda850

Please sign in to comment.