From patchwork Sat Jun 21 12:38:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 32302 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CAFA620675 for ; Sat, 21 Jun 2014 12:38:20 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id z60sf10845474qgd.9 for ; Sat, 21 Jun 2014 05:38: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=SPwgkvbT9HnYWmYC9kOfDFdhb0qiy2fQQer87DuphD0=; b=HEFMdd0SGugPWRoe83ndSZCAymcJqtDKI4JG3noYKY+FPs/2LD0Qeqd9p0DUxlncMd eU2u+xqUiusyd0+hxU27u84Pn8E9oZfT8Itvcy5qS9Tzhoiwyu5fzEcd+dYSfWaLe3Ln FDueCUh6HYURhCcXzVRtxz5SiVrWUsa5zvHMAHMOHhK+QlJL0Txv6KqdvU4hucF6j7rH shzSRoUrqFMXj1/IoDwAf8bGJMRWRYjQNWN+OiJSgN8j5BZiC5ivtOy+rgLzzowGMVRI uH0R2Fmvq0gZu2FbeSj5S/UMLYeAR/ZMCc6OksYfwaaE+dRh1DaY7Fk7rhHbXN8UMY9D dk6Q== X-Gm-Message-State: ALoCoQkaOF3tcZ1etYsDKxCbrHfmo7Amem6l41LPHRuLeHeRUd/hwxzRNQQOQCPaREJDgI34nmVl X-Received: by 10.58.237.130 with SMTP id vc2mr4199437vec.25.1403354300663; Sat, 21 Jun 2014 05:38:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.212 with SMTP id 78ls1264101qgp.39.gmail; Sat, 21 Jun 2014 05:38:20 -0700 (PDT) X-Received: by 10.58.128.229 with SMTP id nr5mr18850veb.76.1403354300576; Sat, 21 Jun 2014 05:38:20 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id dr2si5724287vdb.78.2014.06.21.05.38.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Jun 2014 05:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 as permitted sender) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id db12so4476022veb.21 for ; Sat, 21 Jun 2014 05:38:20 -0700 (PDT) X-Received: by 10.58.112.65 with SMTP id io1mr27478veb.61.1403354300487; Sat, 21 Jun 2014 05:38:20 -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 tc5csp21367vcb; Sat, 21 Jun 2014 05:38:20 -0700 (PDT) X-Received: by 10.229.192.5 with SMTP id do5mr14265664qcb.12.1403354300069; Sat, 21 Jun 2014 05:38:20 -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 b13si14802072qah.54.2014.06.21.05.38.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 21 Jun 2014 05:38:20 -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 1WyKX0-0007Qm-AD; Sat, 21 Jun 2014 12:36:30 +0000 Received: from mail-la0-f45.google.com ([209.85.215.45]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WyKWv-0007Qh-15 for lng-odp@lists.linaro.org; Sat, 21 Jun 2014 12:36:25 +0000 Received: by mail-la0-f45.google.com with SMTP id hr17so3070227lab.18 for ; Sat, 21 Jun 2014 05:38:07 -0700 (PDT) X-Received: by 10.112.16.40 with SMTP id c8mr6786975lbd.17.1403354286939; Sat, 21 Jun 2014 05:38:06 -0700 (PDT) Received: from localhost.localdomain ([81.200.0.212]) by mx.google.com with ESMTPSA id si9sm5016976lac.42.2014.06.21.05.38.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Jun 2014 05:38:06 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Sat, 21 Jun 2014 16:38:07 +0400 Message-Id: <1403354287-11130-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] [PATCHv2] 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.128.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 --- v2: remove Makefile.inc from commit, it's generated file now. 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 => Makefileinc.in | 8 +-- configure.in | 60 ++++++++++++++++++++++ platform/linux-generic/{Makefile => Makefile.in} | 10 +--- platform/linux-keystone2/{Makefile => Makefile.in} | 6 +-- 5 files changed, 66 insertions(+), 18 deletions(-) rename Makefile => Makefile.in (100%) rename Makefile.inc => Makefileinc.in (92%) 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/Makefileinc.in similarity index 92% rename from Makefile.inc rename to Makefileinc.in index ff16043..5076384 100644 --- a/Makefile.inc +++ b/Makefileinc.in @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: BSD-3-Clause -PLATFORM ?= linux-generic +PLATFORM ?= @PLATFORM@ OBJ_DIR = ./obj ODP_DIR = $(ODP_ROOT)/platform/$(PLATFORM) @@ -19,7 +19,7 @@ RM := rm -f COPY := cp -r SYNC := rsync -a --delete -ifneq ($(VERBOSE),yes) +ifneq (@VERBOSE@,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 (@ODP_DEBUG_PRINT@,no) EXTRA_CFLAGS += -DODP_DEBUG_PRINT=0 else EXTRA_CFLAGS += -DODP_DEBUG_PRINT=1 endif -ifeq ($(DEBUG),yes) +ifeq (@DEBUG@,yes) EXTRA_CFLAGS += -O0 -g else EXTRA_CFLAGS += -O3 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