]> granicus.if.org Git - curl/commitdiff
build: Added batch wrapper to checksrc.pl
authorSteve Holme <steve_holme@hotmail.com>
Sat, 13 Sep 2014 10:24:07 +0000 (11:24 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 13 Sep 2014 10:33:54 +0000 (11:33 +0100)
Makefile.am
projects/checksrc.bat [new file with mode: 0644]

index 847782539c82274ab742a2716ba6d901468d492f..e66b2361db8df234b038ffb94598e42e50858cf0 100644 (file)
@@ -87,6 +87,7 @@ VC12_SRCVCXPROJ_DEPS = $(VC12_SRCTMPL) Makefile.am src/Makefile.inc
 
 VC_DIST = projects/README      \
  projects/build-openssl.bat    \
+ projects/checksrc.bat \
  projects/Windows/VC6/curl.dsw \
  projects/Windows/VC6/lib/libcurl.dsw $(VC6_LIBDSP)    \
  projects/Windows/VC6/src/curlsrc.dsw $(VC6_SRCDSP)    \
diff --git a/projects/checksrc.bat b/projects/checksrc.bat
new file mode 100644 (file)
index 0000000..e2e2574
--- /dev/null
@@ -0,0 +1,81 @@
+@echo off
+rem ***************************************************************************
+rem *                                  _   _ ____  _
+rem *  Project                     ___| | | |  _ \| |
+rem *                             / __| | | | |_) | |
+rem *                            | (__| |_| |  _ <| |___
+rem *                             \___|\___/|_| \_\_____|
+rem *
+rem * Copyright (C) 2014, Steve Holme, <steve_holme@hotmail.com>.
+rem *
+rem * This software is licensed as described in the file COPYING, which
+rem * you should have received as part of this distribution. The terms
+rem * are also available at http://curl.haxx.se/docs/copyright.html.
+rem *
+rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+rem * copies of the Software, and permit persons to whom the Software is
+rem * furnished to do so, under the terms of the COPYING file.
+rem *
+rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+rem * KIND, either express or implied.
+rem *
+rem ***************************************************************************
+
+:begin
+  rem Check we are running on a Windows NT derived OS
+  if not "%OS%" == "Windows_NT" goto nodos
+  setlocal
+
+  rem Display the help
+  if /i "%~1" == "-?" goto syntax
+  if /i "%~1" == "-h" goto syntax
+  if /i "%~1" == "-help" goto syntax
+
+:prerequisites
+  rem Check we have Perl installed
+  if not exist "C:\Perl" (
+    if not exist "C:\Perl64" goto noperl
+  )
+
+:configure
+  if "%1" == "" set SRC_DIR=..
+  if not "%1" == "" set SRC_DIR=%~1%
+  if not exist "%SRC_DIR%" goto nosrc
+
+:start
+  for /F %%i in ('dir %SRC_DIR%\src\*.c.* /b') do @perl %SRC_DIR%\lib\checksrc.pl -D%SRC_DIR%\src %%i
+  for /F %%i in ('dir %SRC_DIR%\src\*.h.* /b') do @perl %SRC_DIR%\lib\checksrc.pl -D%SRC_DIR%\src %%i
+  for /F %%i in ('dir %SRC_DIR%\lib\*.c.* /b') do @perl %SRC_DIR%\lib\checksrc.pl -D%SRC_DIR%\lib %%i
+  for /F %%i in ('dir %SRC_DIR%\lib\*.h.* /b') do @perl %SRC_DIR%\lib\checksrc.pl -D%SRC_DIR%\lib -Wcurl_config.h.cmake %%i
+  goto success
+
+:syntax
+  rem Display the help
+  echo.
+  echo Usage: checksrc [directory]
+  echo.
+  echo directory - Specifies the curl source directory
+  goto success
+
+:nodos
+  echo.
+  echo Error: Only a Windows NT based Operating System is supported
+  goto error
+
+:noperl
+  echo.
+  echo Error: Perl is not installed
+  goto error
+
+:nosrc
+  echo.
+  echo Error: "%SRC_DIR%" does not exist
+  goto error
+
+:error
+  if "%OS%" == "Windows_NT" endlocal
+  exit /B 1
+
+:success
+  endlocal
+  exit /B 0