Hi,

This patch is using configure script to automatically detect if the
system has libselinux libraries and header installed, so we can use a
macro later on to actually check if SELinux is enabled. Otherwise, or if
you don't want to run configure script at all, the test and other tests
should behave as normal.

Also, it removes some unnecessary comments from the Makefile, and
replaces LOADLIBES to LDLIBS according to the LTP INSTALL file,

LDLIBS   - libraries listed after objects during link

Signed-off-by: CAI Qian <[email protected]>

--- /dev/null   2009-01-24 15:26:18.326002642 +0800
+++ m4/ltp-selinux.m4   2009-01-24 19:56:54.660651164 +0800
@@ -0,0 +1,29 @@
+dnl
+dnl Copyright (c) Red Hat Inc., 2009
+dnl
+dnl This program is free software;  you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+dnl the GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program;  if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+dnl USA
+
+dnl
+dnl LTP_CHECK_SELINUX
+dnl ----------------------------
+dnl
+AC_DEFUN([LTP_CHECK_SELINUX],
+[dnl
+AC_CHECK_HEADERS(selinux/selinux.h,[
+        SELINUX_LIBS="-lselinux"],[
+        SELINUX_LIBS=""])
+AC_SUBST(SELINUX_LIBS)
+])

--- testcases/kernel/fs/proc/Makefile.orig      2009-01-24 18:56:50.064650109 
+0800
+++ testcases/kernel/fs/proc/Makefile   2009-01-25 02:00:24.316649805 +0800
@@ -16,12 +16,10 @@
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-###########################################################################
-# name of file : Makefile                                                #
-# description  : make(1) description file for the send(2) tests.         #
-###########################################################################
-CFLAGS+=       -I../../../../include
-LOADLIBES+=    -L../../../../lib -lltp
+include ../../../../config.mk
+
+CFLAGS+=       -I../../../../include
+LDLIBS+=       -L../../../../lib -lltp $(SELINUX_LIBS)
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
@@ -33,5 +31,3 @@
 
 clean:
        rm -f $(TARGETS)
-
-

--- configure.ac.orig   2009-01-24 16:41:35.894653037 +0800
+++ configure.ac        2009-01-24 16:43:14.064654299 +0800
@@ -18,5 +18,6 @@
 LTP_CHECK_SYSCALL_EVENTFD
 LTP_CHECK_SYSCALL_MODIFY_LDT
 LTP_CHECK_SYSCALL_SIGNALFD
+LTP_CHECK_SELINUX
 
 AC_OUTPUT

--- config.mk.in.orig   2009-01-24 19:01:43.472650122 +0800
+++ config.mk.in        2009-01-24 19:03:11.001651581 +0800
@@ -7,3 +7,4 @@
 LDFLAGS = @LDFLAGS@
 
 AIO_LIBS = @AIO_LIBS@
+SELINUX_LIBS = @SELINUX_LIBS@

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to