From patchwork Sat Jun 21 12:34:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 32301 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 92B5820675 for ; Sat, 21 Jun 2014 12:35:21 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id uz6sf11212986obc.0 for ; Sat, 21 Jun 2014 05:35:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=o/XMMY0CIK4fbVOICcEaGaFTB590tXjPKOEc2aXJ+pU=; b=MjHmq+04HuT28N/pBDXI9B1AAWL8q2ZmaYS3fdkYg3gDmOfjNSfHeCQ4YkxSpNeirK c1X0T5wvIGvMYk3UTQ58pfhy14gtZ/7xq8Ff8cukathkwRRa1fVw7IWhATSR0cNvjcu2 Wcu91y5SsoMcP+z4MzjQMnf9wuzRs5Tvd9NJsoZWBGKhrpYzYelg0nMztetp4Ayi+8f8 s/R4uBYK6JnRuVeTwjYdyuJEw7ojg+zfL3kcywHmyg9AbobjXM7RAmcCss2PyFiOzqkP Rsv1DA6fzbx/XiGFhh39fOVKDX8cih20/ttLjNzVmM0cOYzra9QEfj+JGDqW3JEGAYIx CEZQ== X-Gm-Message-State: ALoCoQnlbCUDXlrV1yeksJda0G/c95ZuMPT43e+o9CAvUKYbL3zKWe1WNJ0kVykk5Fd5X5PHk8mm X-Received: by 10.50.55.35 with SMTP id o3mr4205428igp.6.1403354120119; Sat, 21 Jun 2014 05:35:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.225 with SMTP id o88ls1234145qge.88.gmail; Sat, 21 Jun 2014 05:35:20 -0700 (PDT) X-Received: by 10.52.118.99 with SMTP id kl3mr7170365vdb.18.1403354119989; Sat, 21 Jun 2014 05:35:19 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id jv10si5109168veb.29.2014.06.21.05.35.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Jun 2014 05:35:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so4337152vcb.35 for ; Sat, 21 Jun 2014 05:35:19 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr7076254vdc.8.1403354119889; Sat, 21 Jun 2014 05:35:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp21225vcb; Sat, 21 Jun 2014 05:35:19 -0700 (PDT) X-Received: by 10.140.107.52 with SMTP id g49mr13556125qgf.100.1403354119395; Sat, 21 Jun 2014 05:35:19 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id s4si14793331qay.65.2014.06.21.05.35.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 21 Jun 2014 05:35:19 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WyKU5-0007Oy-By; Sat, 21 Jun 2014 12:33:29 +0000 Received: from mail-la0-f50.google.com ([209.85.215.50]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WyKU0-0007Oq-4U for lng-odp@lists.linaro.org; Sat, 21 Jun 2014 12:33:24 +0000 Received: by mail-la0-f50.google.com with SMTP id pv20so3014772lab.23 for ; Sat, 21 Jun 2014 05:35:06 -0700 (PDT) X-Received: by 10.152.5.194 with SMTP id u2mr7180383lau.1.1403354106447; Sat, 21 Jun 2014 05:35:06 -0700 (PDT) Received: from localhost.localdomain ([81.200.0.212]) by mx.google.com with ESMTPSA id qo1sm6599441lbb.48.2014.06.21.05.35.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Jun 2014 05:35:05 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Sat, 21 Jun 2014 16:34:59 +0400 Message-Id: <1403354099-11031-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCH] support autoconf X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Implement ./configure using original odp Makefiles Signed-off-by: Maxim Uvarov --- This is propose of patch to implement autoconf/automake for odp. If we already have all makefiles that might be no reason to use m4. And keep using configure.in and Makefile.in. Compilation now is standard procedure with autotools: autoreconf ./configure for KS2 ./configure --with-platform=linux-keystone2 Best regards, Maxim. Makefile => Makefile.in | 0 Makefile.inc | 6 +-- Makefileinc.in | 62 ++++++++++++++++++++++ configure.in | 60 +++++++++++++++++++++ platform/linux-generic/{Makefile => Makefile.in} | 10 +--- platform/linux-keystone2/{Makefile => Makefile.in} | 6 +-- 6 files changed, 127 insertions(+), 17 deletions(-) rename Makefile => Makefile.in (100%) create mode 100644 Makefileinc.in create mode 100644 configure.in rename platform/linux-generic/{Makefile => Makefile.in} (94%) rename platform/linux-keystone2/{Makefile => Makefile.in} (95%) diff --git a/Makefile b/Makefile.in similarity index 100% rename from Makefile rename to Makefile.in diff --git a/Makefile.inc b/Makefile.inc index ff16043..dfa92ed 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -19,7 +19,7 @@ RM := rm -f COPY := cp -r SYNC := rsync -a --delete -ifneq ($(VERBOSE),yes) +ifneq (no,yes) Q = @ MAKEFLAGS += --no-print-directory endif @@ -29,13 +29,13 @@ QUIET_LD = $(Q:@=@echo ' LD '$@;) QUIET_AR = $(Q:@=@echo ' AR '$@;) export Q QUIET_CC QUIET_LD QUIET_AR -ifeq ($(ODP_DEBUG_PRINT),no) +ifeq (yes,no) EXTRA_CFLAGS += -DODP_DEBUG_PRINT=0 else EXTRA_CFLAGS += -DODP_DEBUG_PRINT=1 endif -ifeq ($(DEBUG),yes) +ifeq (no,yes) EXTRA_CFLAGS += -O0 -g else EXTRA_CFLAGS += -O3 diff --git a/Makefileinc.in b/Makefileinc.in new file mode 100644 index 0000000..5076384 --- /dev/null +++ b/Makefileinc.in @@ -0,0 +1,62 @@ +# Copyright (c) 2013, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +PLATFORM ?= @PLATFORM@ +OBJ_DIR = ./obj +ODP_DIR = $(ODP_ROOT)/platform/$(PLATFORM) + +export DESTDIR = $(ODP_ROOT)/build + +CC ?= gcc +LD ?= gcc +AR ?= ar +ECHO := @echo +MKDIR := mkdir -p +RMDIR := rm -rf +RM := rm -f +COPY := cp -r +SYNC := rsync -a --delete + +ifneq (@VERBOSE@,yes) +Q = @ +MAKEFLAGS += --no-print-directory +endif + +QUIET_CC = $(Q:@=@echo ' CC '$@;) +QUIET_LD = $(Q:@=@echo ' LD '$@;) +QUIET_AR = $(Q:@=@echo ' AR '$@;) +export Q QUIET_CC QUIET_LD QUIET_AR + +ifeq (@ODP_DEBUG_PRINT@,no) +EXTRA_CFLAGS += -DODP_DEBUG_PRINT=0 +else +EXTRA_CFLAGS += -DODP_DEBUG_PRINT=1 +endif + +ifeq (@DEBUG@,yes) +EXTRA_CFLAGS += -O0 -g +else +EXTRA_CFLAGS += -O3 +endif + +EXTRA_CFLAGS += -pthread +EXTRA_CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes +EXTRA_CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith +EXTRA_CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral +EXTRA_CFLAGS += -Wformat-security -Wundef -Wwrite-strings + + +LDFLAGS += -pthread +LDFLAGS += $(CFLAGS) + +STD_LIBS += -lrt + +include $(wildcard $(ODP_DIR)/Makefile.inc) + +.PHONY: default +default: + +$(OBJ_DIR): + $(Q)$(MKDIR) $(OBJ_DIR) diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..fcfefc9 --- /dev/null +++ b/configure.in @@ -0,0 +1,60 @@ +AC_INIT([odp], 0.2) + +AC_MSG_CHECKING([checking for platform]) +AC_ARG_WITH([platform], +[ --with-platform=PLAT linux-generic (default) + linux-keystone2 ], +[if test x"$withval" != x ; then + PLATFORM="$withval" +fi], +[PLATFORM="linux-generic"]) +AC_MSG_RESULT($PLATFORM) +AC_SUBST(PLATFORM) + +ODP_HAVE_NETMAP="" +AC_ARG_ENABLE([reloc], + AS_HELP_STRING([--enable-netmap], [compile netmap support (linux-generic only)])) +AS_IF([test "x$enable_netmap" = "xyes"], [ + ODP_HAVE_NETMAP="-DODP_HAVE_NETMAP" + ]) +AC_SUBST(ODP_HAVE_NETMAP) + +ODP_RELOC="" +AC_ARG_ENABLE([reloc], + AS_HELP_STRING([--enable-reloc], [compile library with position independent code])) +AS_IF([test "x$enable_reloc" = "xyes"], [ + ODP_RELOC="-fpic" +]) +AC_SUBST(ODP_RELOC) + +ODP_DEBUG_PRINT="yes" +AC_ARG_ENABLE([debug_print], + AS_HELP_STRING([--disable-debug_print], [disable odp debug print])) +AS_IF([test "x$enable_debug" = "xyes"], [ + ODP_DEBUG_PRINT="no" +]) +AC_SUBST(ODP_DEBUG_PRINT) + +DEBUG="no" +AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-debug], [compile code with debug info])) +AS_IF([test "x$enable_debug" = "xyes"], [ + DEBUG="yes" +]) +AC_SUBST(DEBUG) + +VERBOSE="no" +AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-verbose], [enable compilation verbose])) +AS_IF([test "x$enable_debug" = "xyes"], [ + VERBOSE="yes" +]) +AC_SUBST(VERBOSE) + +AC_CONFIG_FILES(platform/linux-generic/Makefile) +AC_CONFIG_FILES(platform/linux-keystone2/Makefile) +AC_CONFIG_FILES(Makefile.inc:Makefileinc.in) +AC_CONFIG_FILES(Makefile) + +AC_PROG_CC +AC_OUTPUT diff --git a/platform/linux-generic/Makefile b/platform/linux-generic/Makefile.in similarity index 94% rename from platform/linux-generic/Makefile rename to platform/linux-generic/Makefile.in index 0737656..bb9b862 100644 --- a/platform/linux-generic/Makefile +++ b/platform/linux-generic/Makefile.in @@ -36,15 +36,7 @@ EXTRA_CFLAGS += -I$(ODP_ROOT)/include EXTRA_CFLAGS += -I./include EXTRA_CFLAGS += -I./include/api -# Option for shared libraries. -# Decreases performance with static libraries. -ifeq ($(ODP_RELOC),yes) -EXTRA_CFLAGS += -fpic -endif - -ifeq ($(ODP_HAVE_NETMAP),yes) -EXTRA_CFLAGS += -DODP_HAVE_NETMAP -endif +EXTRA_CFLAGS += @ODP_RELOC@ @ODP_HAVE_NETMAP@ include $(ODP_ROOT)/Makefile.inc STATIC_LIB = ./lib/libodp.a diff --git a/platform/linux-keystone2/Makefile b/platform/linux-keystone2/Makefile.in similarity index 95% rename from platform/linux-keystone2/Makefile rename to platform/linux-keystone2/Makefile.in index a0e2922..91e8162 100644 --- a/platform/linux-keystone2/Makefile +++ b/platform/linux-keystone2/Makefile.in @@ -13,11 +13,7 @@ DOC_DIR = ./doc LINUX_GENERIC_DIR = ../linux-generic -# Option for shared libraries. -# Decreases performance with static libraries. -ifeq ($(ODP_RELOC),yes) -EXTRA_CFLAGS += -fpic -endif +EXTRA_CFLAGS += @ODP_RELOC@ MY_PLATFORM = DEVICE_K2K